|
10 | 10 | workflow_dispatch: |
11 | 11 |
|
12 | 12 | jobs: |
13 | | - |
14 | | - lint: |
15 | | - name: Lint |
| 13 | + mdlint: |
| 14 | + name: Markdown Lint |
16 | 15 | runs-on: ubuntu-latest |
17 | 16 | steps: |
18 | | - - uses: actions/checkout@v4 |
19 | | - with: |
20 | | - fetch-depth: '0' |
| 17 | + - uses: actions/checkout@v6 |
21 | 18 |
|
22 | | - - uses: actions/setup-python@v5 |
| 19 | + - uses: xt0rted/markdownlint-problem-matcher@v3 |
23 | 20 |
|
24 | | - - name: install dependencies |
25 | | - run: | |
26 | | - sudo apt-get install --yes zsh |
27 | | - pip install --user linkify-it-py mdformat mdformat-config mdformat-gfm mdformat-shfmt mdformat-tables mdformat-toc |
| 21 | + - run: npm install -g markdownlint-cli |
| 22 | + # disabled checks: |
| 23 | + # MD013/line-length |
| 24 | + # MD024/no-duplicate-heading |
| 25 | + # MD033/no-inline-html |
| 26 | + # MD034/no-bare-urls |
| 27 | + # MD036/no-emphasis-as-heading |
| 28 | + # MD041/first-line-heading/first-line-h1 |
| 29 | + # MD059/descriptive-link-text |
| 30 | + # MD060/table-column-style |
| 31 | + - run: | |
| 32 | + markdownlint --version |
28 | 33 |
|
29 | | - - name: commit |
30 | | - uses: wagoid/commitlint-github-action@v5 |
31 | | - with: |
32 | | - configFile: '.commitlintrc' |
33 | | - # run: commitlint --from=$(git cherry origin/main | head -n 1 | awk '{print $2}') |
| 34 | + # List files to lint |
| 35 | + ls *.md **/*.md |
34 | 36 |
|
35 | | - - name: markdown |
36 | | - run: find . -name '*.md' ! -name 'CHANGELOG.md' -type f -print0 | xargs -0 -n1 -P4 mdformat --check --wrap 120 --number |
| 37 | + markdownlint \ |
| 38 | + --disable MD013 MD024 MD029 MD033 MD034 MD036 MD041 MD059 MD060 \ |
| 39 | + --ignore '**/CHANGELOG.md' \ |
| 40 | + -- *.md **/*.md |
37 | 41 |
|
38 | | - # - name: shell (shfmt) |
39 | | - # run: find . -name '*.sh' -type f -print0 | xargs -0 -n1 -P4 shfmt -bn -ci -d -i 2 -ln bash -s -sr |
| 42 | + zshlint: |
| 43 | + name: ZSH Lint |
| 44 | + runs-on: ubuntu-latest |
40 | 45 |
|
41 | | - # - name: shell (shellcheck) |
42 | | - # run: find . -name '*.sh' -type f -print0 | xargs -0 -n1 -P4 shellcheck |
| 46 | + strategy: |
| 47 | + fail-fast: false |
| 48 | + matrix: |
| 49 | + task: [zsh-noexec, zsh-zcompile] |
43 | 50 |
|
44 | | - - name: zsh (noexec) |
45 | | - run: find . -name '*.zsh' -type f -print0 | xargs -0 -n1 -P4 zsh -n |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v6 |
| 53 | + with: |
| 54 | + fetch-depth: 0 |
| 55 | + |
| 56 | + - uses: actions/setup-python@v6 |
46 | 57 |
|
47 | | - - name: zsh (zcompile) |
48 | | - run: find . -name '*.zsh' -type f -exec zsh -fc "zcompile {}" \; |
| 58 | + - name: install dependencies |
| 59 | + run: | |
| 60 | + sudo apt-get update |
| 61 | + sudo apt-get install --yes zsh |
| 62 | +
|
| 63 | + - name: "run lint (${{ matrix.task }})" |
| 64 | + run: | |
| 65 | + case "${{ matrix.task }}" in |
| 66 | + zsh-noexec) |
| 67 | + find . -name '*.zsh' -type f -print0 \ |
| 68 | + | xargs -0 -n1 -P4 zsh -n |
| 69 | + ;; |
| 70 | + zsh-zcompile) |
| 71 | + find . -name '*.zsh' -type f \ |
| 72 | + -exec zsh -fc "zcompile {}" \; |
| 73 | + ;; |
| 74 | + *) |
| 75 | + echo "ERROR: unknown task ${{ matrix.task }}" >&2 |
| 76 | + exit 1 |
| 77 | + ;; |
| 78 | + esac |
0 commit comments