Skip to content

Commit

Permalink
chore(ci): merge autocorrect into existing lint/fix system
Browse files Browse the repository at this point in the history
  • Loading branch information
yin1999 committed Oct 13, 2023
1 parent 2f278c6 commit 2f5140a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 64 deletions.
62 changes: 0 additions & 62 deletions .github/workflows/autocorrect-lint.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/markdown-lint-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
run: |
yarn markdownlint-cli2 --fix "**/${{ matrix.lang }}/**/*.md"
node ./scripts/check-url-locale.js --fix "files/${{ matrix.lang }}"
ls -d 2>/dev/null "files/${{ matrix.lang }}" "docs/${{ matrix.lang }}" | xargs yarn autocorrect --fix
yarn prettier -w "**/${{ matrix.lang }}/**/*.md"
cd ${{ github.workspace }}/mdn/content && yarn fix:fm --config-file ${{ github.workspace }}/front-matter-config.json "${{ github.workspace }}/files/${{ matrix.lang }}"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pr-check-lint_content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ jobs:
echo "Running url locale checker"
node ./scripts/check-url-locale.js --fix ${files_to_lint}
echo "Running autocorrect"
yarn autocorrect --fix ${files_to_lint}
echo "Running Prettier"
yarn prettier -w ${files_to_lint}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"type": "module",
"scripts": {
"fix:json": "prettier -w \"**/*.json(c)?\"",
"fix:md": "markdownlint-cli2 --fix \"**/*.md\" && node ./scripts/check-url-locale.js --fix files && prettier -w \"**/*.md\"",
"fix:md": "markdownlint-cli2 --fix \"**/*.md\" && node ./scripts/check-url-locale.js --fix files && yarn autocorrect --fix files docs && prettier -w \"**/*.md\"",
"fix:yml": "prettier -w \"**/*.yml\"",
"lint:json": "prettier -c \"**/*.json(c)?\"",
"lint:md": "markdownlint-cli2 \"**/*.md\" && node ./scripts/check-url-locale.js files && prettier -c \"**/*.md\"",
"lint:md": "markdownlint-cli2 \"**/*.md\" && node ./scripts/check-url-locale.js files && yarn autocorrect --lint files docs && prettier -c \"**/*.md\"",
"lint:yml": "prettier -c \"**/*.yml\"",
"prepare": "husky install"
},
Expand Down

0 comments on commit 2f5140a

Please sign in to comment.