-
Notifications
You must be signed in to change notification settings - Fork 61.6k
chore: Add Markdownlint checking and CI #541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "markdownlint", | ||
"pattern": [ | ||
{ | ||
"regexp": "^([^:]*):(\\d+):?(\\d+)?\\s([\\w-\\/]*)\\s(.*)$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"code": 4, | ||
"message": 5 | ||
} | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Markdownlint Translations | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- translations | ||
push: | ||
branches: | ||
- translations | ||
|
||
jobs: | ||
see_if_should_skip: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- id: skip_check | ||
uses: fkirc/skip-duplicate-actions@36feb0d8d062137530c2e00bd278d138fe191289 | ||
with: | ||
cancel_others: 'false' | ||
github_token: ${{ github.token }} | ||
paths: '["translations/**/*.md", "package*.json", ".markdownlint.json", ".github/workflows/markdownlint-translations.yml", ".github/workflows/markdownlint-problem-matcher.json"]' | ||
lint: | ||
runs-on: ubuntu-latest | ||
needs: see_if_should_skip | ||
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }} | ||
steps: | ||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f | ||
|
||
- name: Get npm cache directory | ||
id: npm-cache | ||
run: | | ||
echo "::set-output name=dir::$(npm config get cache)" | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a | ||
with: | ||
path: ${{ steps.npm-cache.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run Markdownlint | ||
run: | | ||
echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json" | ||
npm run markdownlint:translations |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Markdownlint | ||
|
||
on: | ||
pull_request: | ||
branches-ignore: | ||
- translations | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
see_if_should_skip: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- id: skip_check | ||
uses: fkirc/skip-duplicate-actions@36feb0d8d062137530c2e00bd278d138fe191289 | ||
with: | ||
cancel_others: 'false' | ||
github_token: ${{ github.token }} | ||
paths: '["**/*.md", "!translations/**", "package*.json", ".markdownlint.json", ".github/workflows/markdownlint.yml", ".github/workflows/markdownlint-problem-matcher.json"]' | ||
paths_ignore: '["translations/**"]' | ||
lint: | ||
runs-on: ubuntu-latest | ||
needs: see_if_should_skip | ||
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }} | ||
steps: | ||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f | ||
|
||
- name: Get npm cache directory | ||
id: npm-cache | ||
run: | | ||
echo "::set-output name=dir::$(npm config get cache)" | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a | ||
with: | ||
path: ${{ steps.npm-cache.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run Markdownlint | ||
run: | | ||
echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this line doing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This registers the problem matcher file so that PRs get in-line comments on the file tab if the markdownlint job puts any issues to the jobs console |
||
npm run markdownlint |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"default": true, | ||
"MD001": false, | ||
"MD003": false, | ||
"MD004": false, | ||
"MD005": false, | ||
"MD007": false, | ||
"MD009": false, | ||
"MD010": false, | ||
"MD012": false, | ||
"MD013": false, | ||
"MD014": false, | ||
"MD019": false, | ||
"MD020": false, | ||
"MD022": false, | ||
"MD023": false, | ||
"MD024": false, | ||
"MD025": false, | ||
"MD026": false, | ||
"MD029": false, | ||
"MD030": false, | ||
"MD031": false, | ||
"MD032": false, | ||
"MD033": false, | ||
"MD034": false, | ||
"MD036": false, | ||
"MD037": false, | ||
"MD038": false, | ||
"MD039": false, | ||
"MD040": false, | ||
"MD041": false, | ||
"MD042": false, | ||
"MD045": false, | ||
"MD046": false, | ||
"MD047": false | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this to something other than "lint" to avoid confusion with the JavaScript-linting job? Maybe
mdlint
ormarkdown-lint
? 🤷♂️There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figured it was better to use the same job name so it stays a required check