-
Notifications
You must be signed in to change notification settings - Fork 832
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
chore(lint): refactor Markdown linting to use markdownlint-cli2 #4713
Conversation
- first commit is just config changes; lint updates will follow
special changelog lint rules in
|
# Commenting due to | |
# https://github.com/avto-dev/markdown-lint/blob/aab9be9823fcd706f6da3e6ad6c64874c23fbd4c/lint/rules/changelog.js#L51-L71 | |
# TODO: adhere to, or overwrite above rule and uncomment rules | |
# rules: "/lint/rules/changelog.js" |
So, nothing is lost by switching away from this GH Action.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4713 +/- ##
==========================================
+ Coverage 90.77% 93.57% +2.79%
==========================================
Files 90 298 +208
Lines 1930 8466 +6536
Branches 417 1753 +1336
==========================================
+ Hits 1752 7922 +6170
- Misses 178 544 +366 |
For the contrib repo, open-telemetry/opentelemetry-js-contrib#2205 was a recent change adding "dash" ul-style. If this PR is amenable I can make a PR to switch the contrib repo over to markdownlint-cli2 as well. |
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.
Thanks @trentm great research and digging, happy to see up-to-date tolling and better developer experience.
left few minor questions / thoughts
That sounds great, would love to see this change in contrib as well 🥇 |
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
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. - remove errant Dependencies sections from the top of some changelog files found by rule MD001 (see #2207) Refs: open-telemetry/opentelemetry-js#4713 Closes: #2207
…-telemetry#4713) * chore(lint): refactor Markdown linting to use markdownlint-cli2 - first commit is just config changes; lint updates will follow * lint fixes * fix markdownlint for rule MD045/no-alt-text * lint config changes for prefering 'dash' style for rule MD004/ul-style * lint:markdown:fix changes for MD004/ul-style * manually apply this h3->h2 fix that Amir had in his open-telemetry#4703 PR * mention markdown linting in the Linting section of the contributor guide * add link to rules docs --------- Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
This switches from
markdownlint-cli
tomarkdownlint-cli2
and dropsusage of the https://github.com/avto-dev/markdown-lint GitHub action in CI.
avto-dev/markdown-lint
action was using a 4y old version ofmarkdownlint
.AFAICT that action is not being maintained.
lint.yml
workflow now usesnpm run lint:markdown
so that linting in CIis the same as doing so in dev.
markdownlint-cli
tomarkdownlint-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.
dash
for ul-style (MD004), except in CHANGELOG.md files.Refs: #4703
This is an alternative to #4703
/cc @blumamir
on
ul-style
#4698 discusses whether to prefer a particular bullet character for unordered lists in Markdown. This corresponds to the MD004 rule. The default value is "consistent" ... meaning that the first bullet style in a file dictates the preference for the remainder of that file.
Currently this PR includes two commits to change to prefer the
dash
style... with the exception of the 3 CHANGELOG.md files which ignore this rule (via a<!-- markdownlint-disable MD004 -->
directive).(The CHANGELOG.md files are skipped because they consistently use
*
, including new content automatically added by tools such asrelease-please
.)separate commits
This PR is separated into a number of commits to try to separate the config changes from the lint-update changes, in case that helps with reviewing.