Skip to content

Commit 367b3cf

Browse files
authored
Add auto-fix capabilities to linting scripts (#1863)
1 parent 863bb04 commit 367b3cf

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,22 @@ make generate-site
5454
make serve # Binds port 8000
5555
```
5656

57+
### Linting
58+
59+
To check markdown and terminology:
60+
61+
```sh
62+
npm run lint-markdown
63+
npm run lint-terminology
64+
```
65+
66+
To auto-fix linting issues:
67+
68+
```sh
69+
npm run lint-markdown-fix
70+
npm run lint-terminology-fix
71+
```
72+
5773
### Container Build
5874

5975
The OWASP Cheat Sheet Series website can be built and tested locally inside a container by issuing the following commands:

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"scripts": {
1313
"test": "npm run lint-markdown && npm run lint-terminology",
1414
"lint-terminology": "textlint ./cheatsheets/",
15+
"lint-terminology-fix": "textlint --fix ./cheatsheets/",
1516
"lint-markdown": "markdownlint ./ -c .markdownlint.json --ignore node_modules --ignore cheatsheets_excluded",
17+
"lint-markdown-fix": "markdownlint --fix ./ -c .markdownlint.json --ignore node_modules --ignore cheatsheets_excluded",
1618
"link-check": "find cheatsheets -name \\*.md -exec markdown-link-check -c markdown-link-check-config.json 1> log 2> err {} \\; && if [ -e err ] && grep -q \"ERROR:\" err ; then exit 113 ; else echo -e \"All good\"; fi"
1719
},
1820
"repository": {

0 commit comments

Comments
 (0)