Replies: 0 comments 24 replies
-
One thing to add here, from a discussion Florian and I had about this: PRs that fix these rules probably ought to be one rule at a time. Such PRs are going to be easier to review and it'll be more apparent if a rule can't be satisfied by our content or otherwise breaks our process. |
Beta Was this translation helpful? Give feedback.
-
FYI, can we consider using the linter to catch use of non-US-English spellings. We fixed these everywhere relevant in mdn/content#373 , but I do catch myself using "real" English from time to time :-) |
Beta Was this translation helpful? Give feedback.
-
@hamishwillee I think markdownlint only checks the source style for Markdown files and doesn't have a rule for spelling. I'd suggest opening an issue to track US spelling enforcement separately from Markdown source style. |
Beta Was this translation helpful? Give feedback.
-
This is the currently passing config {
"default": true,
"MD001": false,
"MD004": false,
"MD007": false,
"MD013": false,
"MD014": false,
"MD023": false,
"MD024": false,
"MD025": {
"front_matter_title": "^\\s*title\\s*[:=]"
},
"MD026": false,
"MD028": false,
"MD029": false,
"MD030": false,
"MD033": {
"allowed_elements": [
"a",
"abbr",
"annotation",
"base",
"br",
"caption",
"cite",
"code",
"col",
"colgroup",
"dd",
"details",
"dfn",
"div",
"dl",
"dt",
"em",
"h4",
"h5",
"img",
"kbd",
"li",
"math",
"menclose",
"mfenced",
"mfrac",
"mfrac",
"mi",
"mmultiscripts",
"mn",
"mo",
"mover",
"mphantom",
"mprescripts",
"mroot",
"mrow",
"ms",
"mspace",
"mspace",
"msqrt",
"mstyle",
"msub",
"msubsup",
"msup",
"mtable",
"mtd",
"mtext",
"mtr",
"munder",
"munderover",
"none",
"ol",
"p",
"pre",
"section",
"semantics",
"span",
"strong",
"sub",
"summary",
"sup",
"table",
"tbody",
"td",
"tfoot",
"th",
"thead",
"tr",
"ul",
"var"
]
},
"MD034": false,
"MD036": false,
"MD037": false,
"MD040": false,
"MD042": false,
"MD045": false,
"MD046": {
"style": "fenced"
}
} Does it make sense to add it now without integrating the full CI. That way it will work for those editing in IDEs with the markdownlint plugin? |
Beta Was this translation helpful? Give feedback.
-
For spelling I usually use https://github.com/streetsidesoftware/cspell. My local dictionary is pretty big right now though |
Beta Was this translation helpful? Give feedback.
-
@nschonni IMO better to embed a standard solution: mdn/content#12522. If we leave it up to individuals they won't bother. Case in point, me - US English makes me vomit. Or is that vomitz? |
Beta Was this translation helpful? Give feedback.
-
There are 2 new rules around strong (MD050) and emphasis (MD049) markers. Does it make sense to keep the default of "consistent" or actually choose a style? I took a look at the rules
MD050:
|
Beta Was this translation helpful? Give feedback.
-
Updated config {
"default": true,
"MD001": false,
"MD004": {
"style": "dash"
},
"MD007": {
"indent": 2
},
"MD013": false,
"MD014": false,
"MD023": false,
"MD024": false,
"MD025": {
"front_matter_title": "^\\s*title\\s*[:=]"
},
"MD026": false,
"MD028": false,
"MD033": {
"allowed_elements": [
"a",
"abbr",
"annotation",
"base",
"br",
"caption",
"cite",
"code",
"col",
"colgroup",
"dd",
"details",
"dfn",
"div",
"dl",
"dt",
"em",
"h4",
"h5",
"img",
"kbd",
"li",
"math",
"menclose",
"mfenced",
"mfrac",
"mfrac",
"mi",
"mmultiscripts",
"mn",
"mo",
"mover",
"mphantom",
"mprescripts",
"mroot",
"mrow",
"ms",
"mspace",
"mspace",
"msqrt",
"mstyle",
"msub",
"msubsup",
"msup",
"mtable",
"mtd",
"mtext",
"mtr",
"munder",
"munderover",
"none",
"ol",
"p",
"pre",
"section",
"semantics",
"span",
"strong",
"sub",
"summary",
"sup",
"table",
"tbody",
"td",
"tfoot",
"th",
"thead",
"tr",
"ul",
"var"
]
},
"MD034": false,
"MD036": false,
"MD040": false,
"MD042": false,
"MD045": false,
"MD046": {
"style": "fenced"
},
"MD049": false,
"MD050": false
} MD037 seems unfixable for the same reason as the new rules. Underscores in the macros trip up the parsing, and that isn't something that upstream would address since it's outside of the CommonMark spec. |
Beta Was this translation helpful? Give feedback.
-
FWIW No strong opinion, but if we do fix on a style I prefer using |
Beta Was this translation helpful? Give feedback.
-
I left those ones off for now and submitted a PR to at least get the current config in the root, without wiring it to the CI. Figure you folks may want to somehow integrate it into yari so you get some sort of integration with the "flaws" |
Beta Was this translation helpful? Give feedback.
-
mdn/content#12316 is ready now for the next incremental step of having Markdownlint running a fixed version, with a GitHub Action problem matcher to highlight issues. It still only lints the root docs, and not the files content |
Beta Was this translation helpful? Give feedback.
-
Hey @Elchi3, @hamishwillee, and @nschonni! There is this action used on FYI, this is also being added to the |
Beta Was this translation helpful? Give feedback.
-
The same job is in this repo https://github.com/mdn/content/blob/main/.github/workflows/markdown-lint.yml but both are "wrong" in that the globs only look at the root files. mdn/content#12316 is the PR to expand the glob so it hits the subfolders as well |
Beta Was this translation helpful? Give feedback.
-
I'm not really sure what I'm being asked here. Isn't this being run on a daily basis somehow already? @nschonni let me know if you need anything from me. |
Beta Was this translation helpful? Give feedback.
-
How many files would be changed if we ran this today? I would like to have a daily script, but I think we should be conservative with the number of rules, and when we want to add a rule, we, first, clean MDN for it and then add it. I want to be sure we don't have 50+ pages in such PR when we start. |
Beta Was this translation helpful? Give feedback.
-
I didn't get any hits running it now as it's been cleaned regularly, even though the CI job doesn't test much of the files right now
That is what mdn/content#16036 is supposed to do, but has like-wise stalled
I did that over a year ago when the first attempt to expand out the CI job stalled out. I've stopped trying to keep mdn/content#12316 in sync as it has also stalled |
Beta Was this translation helpful? Give feedback.
-
So this is what I believe we should do:
I think 1. is mostly done and we should start with 2. for some time to see how it goes: The action @schalkneethling linked above would perform 2. (I have not looked at the linter config file, though). If I understand well this very PR is for 3. and #16036 is for 2, too. Overall let's be conservative with the rules we check for or enforce, it will be easy to add more later, in separate PRs: no need to argue forever before landing the action/linting to have the perfect set of rules. Let's go for minimum sets and extend them afterward. I would add that @OnkarRuikar is manually running such a linter daily for a week, leading to fixing 5-10 pages per day, mostly for empty spaces, which is easy and quick to review. @wbamberg wdyt? |
Beta Was this translation helpful? Give feedback.
-
The only thing I'd add to ^^^ is perhaps (if possible) we auto-limit the max size of a PR that the linter will throw out. We certainly shouldn't be stalled - either we move on or we cease. |
Beta Was this translation helpful? Give feedback.
-
The issues which the linter can't fix(e.g. broken header hierarchy) needs to be done manually. So, whichever mechanism we use needs to report such issues as a comment or logs somewhere. @schalkneethling if we decide to enforce 64/80 line length for the the PR, there will be a huge number of files flagged by the linter. And the linter won't fix them. FYI I use the following command:
It uses the config file, available at the root of the repo. |
Beta Was this translation helpful? Give feedback.
-
We do not want to enforce a line length on markdown. I abhor them. |
Beta Was this translation helpful? Give feedback.
-
Yes, we had this conversation already and the consensus was pretty clear! mdn/content#6936. |
Beta Was this translation helpful? Give feedback.
-
Yes, so it is clear we do not want line wrapping and we would prefer a custom Prettier config that sets @wbamberg What would be the action items to get us to a place where we can close this issue? (BTW, not meant as a push to make a decision, more a way for me to understand what still needs doing.) Thanks! |
Beta Was this translation helpful? Give feedback.
-
It would be good to get a review on mdn/content#16036. The listing of files across actions runs wasn't possible (for me), but it will indicate to maintainers to look at any failed run for the unfixable things on a daily run |
Beta Was this translation helpful? Give feedback.
-
Converting to a discussion 👍 |
Beta Was this translation helpful? Give feedback.
-
In addition to Prettier (see mdn/content#10402) it would be great to enable a linter that checks if the markdown makes sense.
There already is a markdown linter in CI, but it is currently enabled for meta docs only. mdn/content#7146 is a stalled PR that tried to enable it for all .md files.
Not all files currently comply with all md-lint rules. The following configuration would currently pass CI, but we should enable many of these rules (and potentially others not listed below).
To test, run
npx markdownlint-cli . -i node_modules -i LICENSE.md
and add.markdownlint.json
to the content folder. Remove some of the lines below to see how they would fail.Tasks (roughly):
yarn content mdlint
command?)--fix
option easily (and document it, too)Beta Was this translation helpful? Give feedback.
All reactions