Closed GuySartorelli closed 10 months ago
Ping @silverstripe/core-team
That sounds imminently sensible. If no one raises concern over the next week or so, I would just say go ahead and do it.
Found this issue which points out some issues that might be detectable with this (and some which probably aren't as I assume we don't want to pay for grammarly): https://github.com/silverstripe/developer-docs/issues/37
Also relevant: https://github.com/silverstripe/developer-docs/issues/13
Don't think we need an RFC for maintenance tasks
Was this only for markdown files in the developer-docs repo, or would it also apply to the userhelp docs, and maybe even module readmes (probably not required?)
I was only thinking about developer docs specifically, but I guess it could apply to userhelp too - that's hosted by the same app so the linting rules should all be the same. I don't think it would apply to readmes in repos.
I'm gonna go ahead and mark this accepted
Note that while we could use something like https://github.com/greyscaled/markdownlint-rule-title-case-style to lint the heading style to ensure it's always using sentence style, we'd have to either:
## My `ModelAdmin` heading
)That first option is feasible but out of scope for this first card. The other options are non-starters IMO. So for now we won't lint heading style.
EDIT: The maintainer of that package has kindly implemented that for us.
I've made a wrapper around php code sniffer which lets you lint code blocks inside markdown files https://github.com/GuySartorelli/md-php-cs
Assigned back to @GuySartorelli for the other TODO items
Merged up to 5. I looked at the line length changes and it was just waaaaaay too much to do in one go. If we really care about that rule we can do it in chunks, but that's basically an epic in itself.
We don't currently have any automated checks to validate the quality of our documentation. This means we might potentially have now - or could easily introduce in the future - markdown formatting issues, incorrectly formatted links, etc. This is especially likely to happen with some of the custom markdown syntax such as API links.
Proposed automated checks:
text
for plain text blocks)api:Namespace\Class::someMethod()
syntax instead of a hardcoded links, links to other docs sections are relative)[info]
and similar are formatted correctly and are never left unclosed{#some-anchor}
in headings)yaml
oryml
but not both)namespace
declarations in php code examplesThis should be run on all PRs automatically via github actions.
NOTE: Linting should respect Silverstripe's writing style guide (only accessible to Silverstripe employees currently)
potentially useful tools
Related issues
Notes
Acceptance criteria
TODO
These will be done after the first lot of PRs are merged.
MD013
line-length rule, to limit lines to 120 characters.PRs
DO NOT CLOSE UNTIL ALL TODO ITEMS ARE COMPLETE