-
Notifications
You must be signed in to change notification settings - Fork 382
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
Workflow for linting markdown files #129
Conversation
5e26162
to
5c95ab3
Compare
Hmm, the lint action is not detecting the |
I'm not familiar with I think though there's no harm in trying to run both because (really, the big thing I'm a fan with |
Hi @G-Rath |
@wolf99 how smart is markdownlint in applying that and does it support autofixing? most tools I've seen typically do line length checks by literally counting the number of chars, whereas prettier uses AST parsing meaning it understands situations where you can't actually split the content across multiple lines (i.e. such as with links and codeblocks). Also does markdownlint support formatting codeblocks that have contents like JSON? |
Re auto-fixing: yes this is supported. Although I am not sure if that is advisable in a PR context as peoples work can get mutated without them realizing what's happened. A failure in a workflow forces them to check the flow output. Re the line lengths: In short, yes 🙂 I haven't looked into how it does it, but it basically ignores certain cases such as tables, code blocks, etc. Re formatting code within code blocks - no, this action formats markdown only. AFAIK it treat the contents of code blocks as code and ignores them (unless configured to fix things like line lengths specifically within them) |
Agreed, but we want to make it easy for people to resolve the problems being flagged (especially ones that are tedious and trivial!) - otherwise it can make it harder for people to try and contribute🙂 |
FYI, markdownlint and related tools do NOT try to fix line length issues. If that is important, you may want to look elsewhere. |
7191d53
to
8791c0e
Compare
Becuase they've *alread* got lint issues since PR google#100
Ok - so this is now working as expected, except for fixing inline. If you prefer Prettier given the above input from David (Thanks David!), then I can open another PR for that? |
Following from #100 this PR adds a workflow to lint any markdown files within the repository.
On #100 it was suggested to use Prettier for this. Instead I have used David Anson's markdownlint-cli2 action. There are a couple reasons not to use Prettier.
Developers still have the ability to run this check from a development environment using markdownlint-cli2 itself or any intergration in their IDE, such as this one for vscode.
That said, if there is a strong preference for Prettier I would be happy to look into using that instead 🙂 .