Add automated lint check
This commit is contained in:
Родитель
f93810198b
Коммит
56c4f85236
|
@ -0,0 +1,34 @@
|
|||
name: Lint and Check Markdown
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [docs/main]
|
||||
# only trigger when the PR contains a markdown file
|
||||
paths:
|
||||
- '**.md'
|
||||
- '**.markdown'
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
jobs:
|
||||
lint-markdown:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- run: |
|
||||
npm install markdownlint-cli
|
||||
- run: |
|
||||
node_modules/.bin/markdownlint -c .markdownlint.jsonc -i node_modules/ .
|
||||
|
||||
check-markdown-links:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Markdown Link Check
|
||||
uses: gaurav-nelson/github-action-markdown-link-check@v1
|
||||
with:
|
||||
check-modified-files-only: 'no' #todo make this dependent on label
|
||||
config-file: .markdown-link-check.jsonc
|
||||
use-quiet-mode: 'yes'
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"ignorePatterns": [
|
||||
{
|
||||
"pattern": "^http://modulename"
|
||||
},
|
||||
{
|
||||
"pattern": "^https://xxx"
|
||||
},
|
||||
{
|
||||
"pattern": "^http://localhost"
|
||||
},
|
||||
{
|
||||
"pattern": "^http://yourhost"
|
||||
}
|
||||
],
|
||||
"replacementPatterns": [
|
||||
{
|
||||
"pattern": "^/",
|
||||
"replacement": "{{BASEURL}}/"
|
||||
},
|
||||
{
|
||||
"pattern": "^./",
|
||||
"replacement": "{{BASEURL}}/"
|
||||
}
|
||||
],
|
||||
"aliveStatusCodes": [200, 206]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
// disable line length limitations for existing documentation
|
||||
"MD013": false,
|
||||
// allow same headings
|
||||
"MD024": false
|
||||
}
|
Загрузка…
Ссылка в новой задаче