-
Notifications
You must be signed in to change notification settings - Fork 45
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
Create workflow to lint Markdown files #265
base: master
Are you sure you want to change the base?
Conversation
@MGaetan89 Can we run lint with https://github.com/DavidAnson/markdownlint manually? We can create our custom lint configuration file and manage it with git. It's easy to setup the environment for npm in GitHub Action, and we also can use it locally to apply potential fixes automatically. |
Good point, I forgot to include that. I'll work more on this PR, to explain how to run the check locally. |
bb8ed06
to
1eaf588
Compare
1eaf588
to
79d625c
Compare
I've finally added a note to explain how to check the format locally with the command line tool. |
@MGaetan89 Can we fix lints automatically with some commands? |
Yes, it's the command I added to the Readme in this PR: markdownlint-cli2 "docs/**/*.md" "#docs/javadoc/**/*.md" --config .markdownlint.jsonc --fix I can open a new PR which fixes all the warnings (or maybe multiple smaller PRs) |
@MGaetan89 You can add a new commit in this PR to fix warnings. |
I see that a lot of warnings are about long line length. Often it's because of inlined urls. I'll submit a PR to extract URLs at the bottom of the files first (like in 2021-10-06-sharedTest.md). This will make reading the Markdown files easier, and hopefully this PR a bit smaller too. |
79d625c
to
e7e1f8d
Compare
This PR creates a new workflow to lint Markdown files. This was suggested here: #255 (comment).
The new workflow uses the
DavidAnson/markdownlint-cli2-action
action. It uses the rules defined inDavidAnson/markdownlint
.For the moment, I've kept the default configuration (ie. all the rules are enabled), and modified the maximum line length to be 120 characters, instead of 80.
A sample output is available here: https://github.com/robolectric/robolectric.github.io/actions/runs/9766776527/job/26960490077?pr=265.
I didn't modify any Markdown file yet, because I think that it's better to agree on the rules first. Once that's done, I'll fix all the Markdown files.
The original suggestion was to only enforce max line length. That's possible with the action I'm using. We just need to agree on the value to use.