Closed ns-rse closed 1 year ago
Hmm, not sure why the *.svg
files were linted given the glob rule for includes and the explicit exclusions. :thinking:
I'll investigate and resolve.
@ns-rse, just wanted to acknowledge this PR. Thanks for creating and will review in the next couple of days. I was bogged down last week.
Thanks @davehorsfall and not a problem at all (I love pre-commit
and think its a great tool to use). I've similarly been busy but will see if I can work out why the glob/ignores aren't being respected correctly by markdownlint-cli2
soon.
@ns-rse I also wanted to ask about the pre-commit ci plugin that has been activated on the repo. If a contributor commits code that fails the linting checks, what happens? Will it be rejected, or will it just notify and attempt to fix, etc? I just wanted to understand if this presents a technical barrier to people who don't adopt pre-commit
, but want to contribute. Thanks.
I'll take a look at the .svg
issue after work and try and suss it out.
With regards to pre-commit.ci
and contributions it depends on how the repository is set up and what the errors are.
If markdownlint-cli2
can correct the errors it will do so and pre-commit.ci
will automatically make add a commit to the PR so these are incorporated in the pull request.
If they can't be corrected then it depends on how the branch protection rules are configured for main
and whether the Require status checks to pass before merging option is selected.
Broadly I'd encourage adoption of pre-commit
since it helps push capturing problems further "left"(/earlier) in the development pipeline/cycle. I realise however not everyone may be willing to do so, in which case there are two options that I can think of...
Thanks for clarifying. It's OK for the pre-commit
setup to mandate that errors are fixed before a PR is merged. This can be managed during the review stage, and allows us to maintain good code quality.
I was just concerned that contributions from people might be completely rejected if they didn't pass checks, which would significantly decrease the accessibility of the project.
Ok, I'm a fool and wasn't reading the output carefully enough as has been kindly pointed out to me. Its not markdownlint-cli2
that is doing the linting here, rather its the end-of-file-fixer
from the earlier pre-commit-hooks
. Looking at the affected files the change doesn't appear to have had any impact on their rendering so I guess there is no harm.
This is perhaps ready for merging.
Its always obvious with hindsight! :smile:
You're right, the final new line in the svg doesn't impact rendering.
Closes #54
Lints existing code base with basic pre-commit rules and markdownlint-cli2 pre-commit hook.
Aside from
about.md
andLICENSE.md
most changes are courtesy of theend-of-file-fixer
.In addition...
.markdownlint-cli2.yaml
configuration..git-blame-ignore-revs
file to ignore commits associated with linting (including this one viagit commit -a
). For more on this file see Who's to Blame?..gitignore
.