Skip to content

Commit

Permalink
chore(lint): refactor Markdown linting to use markdownlint-cli2
Browse files Browse the repository at this point in the history
This switches from `markdownlint-cli` to `markdownlint-cli2` and drops
usage of the https://github.com/avto-dev/markdown-lint GitHub action in CI.

- The `avto-dev/markdown-lint` action was using a 4y old version of `markdownlint`.
  AFAICT that action is not being maintained.
- There is a new `npm run lint:markdown` and the `lint.yml` CI workflow uses it.
- The switch from `markdownlint-cli` to `markdownlint-cli2` and `.markdownlint-cli2.jsonc`
  as the config allows using the https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
  VSCode plugin for in-editor Markdown lint warnings and intellisense in the config file.

Refs: open-telemetry/opentelemetry-js#4713
  • Loading branch information
trentm committed May 22, 2024
1 parent 69cd638 commit f4c99dc
Show file tree
Hide file tree
Showing 8 changed files with 352 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/plugin_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ A clear and concise description of what the problem is. Ex. I'm always frustrate


### Do you expect this instrumentation to be commonly used?

Weekly Downloads:

### What version of instrumentation are you interested in using?

Versions:

### Additional context
Expand Down
5 changes: 0 additions & 5 deletions .github/markdown-lint.yml

This file was deleted.

12 changes: 3 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,8 @@ jobs:
with:
node-version: 18
cache: 'npm'

- name: Lint markdown files
uses: avto-dev/markdown-lint@v1
with:
config: '.github/markdown-lint.yml'
ignore: "./**/CHANGELOG.md"
args: "./**/*.md"

- run: npm ci
- name: Lint
run: npm run lint
run: |
npm run lint
npm run lint:markdown
17 changes: 17 additions & 0 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// https://github.com/DavidAnson/markdownlint-cli2#markdownlint-cli2jsonc
{
"config": {
// https://github.com/DavidAnson/markdownlint/blob/main/README.md#rules--aliases
"MD013": false,
"MD024": false,
"MD033": false,
"MD041": false,
"MD012": false, // no-multiple-blanks, common in CHANGELOG.md files
"MD045": false, // XXX no-alt-text
"MD026": false, // XXX drop?
// "MD004": { "style": "dash" } // ul-style
},
"gitignore": true,
"noBanner": true,
"noProgress": true
}
7 changes: 0 additions & 7 deletions .markdownlint.json

This file was deleted.

Loading

0 comments on commit f4c99dc

Please sign in to comment.