[CI] Refactor/rework custom trim-code-block-and-unindent
markdownlint rule
#3183
Labels
CI/infra
CI & infrastructure
cleanup/refactoring
e1-hours
Effort: < 8 hrs
enhancement
New feature or request
p2-medium
p3-low
The
trim-code-block-and-unindent
custom markdownlint (mdl) rule was introduced byAs was mentioned in the opening comment of #3177, the custom rule reports errors over a line range. I've since learned that mdl (especially it's issuing-fixing approach) is strictly line based. So,
trim-code-block-and-unindent
would need to be reworked so that it is line based -- that is, it should report an issue for each problematic line, along with the fix for that line only. With this mode of processing, it might be beneficial to split the rule into three:Consider refactoring this rule so that it could, in principle, be used with mdl invoked from the command line. This is to ensure that it is properly packaged, and would be reusable in the context of other projects.
Reminder that our custom Gulp task actually strips out Hugo/Go-template directives (
{{...}}
) so it might not make sense to try to implement use of mld's--fix
(from the CLI) or generally for all rules in our Gulp task (currently--fix
only fixes code-block issues). It might be that mdl's helpers have generic functions that implement fixing.The text was updated successfully, but these errors were encountered: