Replies: 7 comments 26 replies
-
Hi Jean-Yves, I think the linting and formatting efforts going on right now are great, this is a really good initiative 🙌🏻 Your suggestions for activating Markdownlint as a test on each PR (1->5) and the daily Markdownlint script (1->3) also makes sense. I've previously exclusively used Prettier for taking care of project formatting. I have a general question; what does Markdownlint do that Prettier cannot do and how do the two tools interact? There is a doc on MDLs repo that says both work together well, but I'm sure you can give more context! |
Beta Was this translation helpful? Give feedback.
-
From the daily lint runs so far, the average number of files fixed by the linter per day is less than 4. So I think just the We can also drop the lint check and directly have auto fix that will trigger on each commit to the PR:
There is a possibility that this can be achieved:
With this we can drop a command in the PR comments like We can re-purpose other suitable pull request related events too. But comments will be the least complicated approach. Method B This won't happen on the PR page. You will have to do it from repo's actions page.
Need to do some experiments around this. |
Beta Was this translation helpful? Give feedback.
-
Sorry in advance this is going to be a bit of a ramble. I want to think about when and how often and in which circumstances linter changes should just always be applied, and when they need manual intervention and checking, and how this should affect contributor and reviewer workflows. IIUC I think we're looking at a combination of:
Problems with (2) are:
One of the things that makes this hard to reason about is that it's almost fully automatable, but there are these rare cases when manual override is wanted. And also that manual checking for things like spacing and indentation is hard for humans (well it is hard for this human anyway). So we don't really want to pay the full cost of manually reviewing every formatting change, but we do need to catch the rare exceptions. I think that's also why I quite like (3): it means we can concentrate on these questions in a dedicated PR, instead of it being another checkist item for every other PR review. So as a reviewer I'd be interested to know whether running (2) is an expectation or not. I also think we can experiment: how does it feel to run (2)? If we don't run (2), how unwieldy does reviewing (3) get? (based on our experiences with @OnkarRuikar 's auto-fix PRs, it doesn't seem at all bad). I think ESLint is a different matter and is much more likely to need intervention at (2). |
Beta Was this translation helpful? Give feedback.
-
Related #211 |
Beta Was this translation helpful? Give feedback.
-
Configuring lint-staged and husky would prevent everyone not editing via GitHub UI from committing any non-fixable errors, while automatically fixing fixable errors. See: |
Beta Was this translation helpful? Give feedback.
-
Minor data point since this has landed: I am using Prettier as my formatter in VSCode in a number of cases (on file save etc.). Since mdn/content#20397, I am commenting out the |
Beta Was this translation helpful? Give feedback.
-
I was thinking in a smilar vein of "Markdown linting" rather than "Markdownlint" ideal setup, would be to have the yari flaws fixed by Husky on commit. I know some of them probably can't, and others might be too expensive to run on a large number of files in a commit. |
Beta Was this translation helpful? Give feedback.
-
Hi all!
For a long time, we have wanted to have Markdownlint taking care of our documents, easing us from the cumbersome formatting.
Lately, we have activated the automatic test of your PRs. Markdownlint flags errors it detects. This is 🎉! I'm really happy about this.
Nevertheless, I'm not sure we have the same view on what the final state should be. I want to open this discussion so we can agree on what is left to call the Markdownlint project done.
This is what we want (in my understanding):
Activate Markdownlint as a test on each PR (PR: mdn/content#12316)
@mdn-bot fixmd
that the author or the reviewer can call.- MD045: an alt is missing on an image (As soon as the add missing alt project is over)
- MD023: the position of a heading is not at the start of the line (this is problematic for React and Yari)
Run a daily Markdownlint script automatically to create a PR to fix MD errors (PR: mdn/content#16036)
I would like us to synchronize our views and agree on the work needed (where we are going with MDLint). I'll update the points above as the discussion progress.
cc/ @wbamberg @caugner @nschonni @OnkarRuikar @Josh-Cena (and everybody else, of course)
Beta Was this translation helpful? Give feedback.
All reactions