Skip to content

Commit

Permalink
fix: move output formatting to generators
Browse files Browse the repository at this point in the history
  • Loading branch information
osouthwell-scottlogic authored Nov 2, 2022
1 parent 0b1992f commit 1e1e358
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [main]

jobs:
run-eslint:
format:
name: Format
runs-on: ubuntu-latest

Expand All @@ -25,4 +25,4 @@ jobs:
run: npm ci

- name: Code Format Check
run: npm run format:check
run: npm run format:check:all
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [main]

jobs:
run-eslint:
lint:
name: Lint
runs-on: ubuntu-latest

Expand All @@ -25,4 +25,4 @@ jobs:
run: npm ci

- name: Code Linting Check
run: npm run lint:check
run: npm run lint:check:all
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
. "$(dirname -- "$0")/_/husky.sh"

echo 'Pre-commit checks'
npm run format:check
npm run lint:check
npm run format:check:all
npm run lint:check:all
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ npm test {featurePath} {generatorPath}
Two scripts are available to help you find linting errors:

```
npm run eslint:check
npm run eslint:check:all
```

This runs eslint in check mode which will raise errors found but not try and fix them. This is also ran on a PR and a push to main. It will fail if any errors were found.

```
npm run eslint:write
npm run eslint:write:all
```

This runs eslint in write mode which will raise errors found and try to fix them.
Expand Down
10 changes: 7 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
"prepare": "husky install",
"test": "\"./node_modules/.bin/cucumber-js\" -p default",
"test:defaultPath": "\"./node_modules/.bin/cucumber-js\" -p default \"node_modules/openapi-forge/features/*.feature\" \"openapi-forge/src/generate\"",
"format:check": "prettier --check .",
"format:write": "prettier --write .",
"lint:check": "eslint .",
"lint:write": "eslint --fix ."
"format:check:all": "prettier --check .",
"format:write:all": "prettier --write .",
"format:write": "prettier --write",
"lint:check:all": "eslint .",
"lint:write:all": "eslint --fix ."
},
"license": "MIT",
"devDependencies": {
Expand All @@ -29,11 +30,13 @@
"eslint": "^8.24.0",
"husky": "^8.0.1",
"openapi-forge": "github:ColinEberhardt/openapi-forge#1cd7b107fca832e286c40f9e8ec1e483e368b624",
"prettier": "^2.7.1",
"semantic-release": "^19.0.5",
"ts-node": "^8.0.3",
"typescript": "^4.7.4"
},
"dependencies": {
"prettier": "^2.7.1"
},
"engines": {
"node": ">=16.0.0"
}
Expand Down

0 comments on commit 1e1e358

Please sign in to comment.