New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always run the spell and shell checkers if possible, print warning when not possible #54847
Conversation
Background story: #54827 (comment) |
Silly me, I tried to sneak in a funny joke, didn't think bots were also lacking irony. ^-^ SC2034 (warning): us appears unused. Verify use (or export if used externally). |
shell cheker is another one that isn't runnig for me as pre-commit hook |
Now, as I really WANT a single-iteration loop, I could put the previous construct back but I'd be fighting against the shellcheck bot: |
I've filed the issue upstream to koalaman/shellcheck#2839 |
scripts/prepare_commit.sh
Outdated
done | ||
fi | ||
|
||
if [[ -x "${TOPLEVEL}"/tests/code_layout/test_shellcheck.sh ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not worth checking this, if it's ever dropped, it's a good idea to update this script too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually agree, but I don't know why the original author added that check (same can be said on line 60, where check_spelling is chekced)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to not check anymore
Print warnings if requirements are not met
@strk it looks like it runs on every shell files existing in the QGIS repository. So, on my side, it runs on all files from different worktrees and slow down considerably the commit process and would eventually fail on files that I have no intention to push. Could we apply it only on modified files, like it's done for spell check ? |
same here, even git ignored files. |
also, running the spell check everytime makes the prepare_commit quite slow (painful when using it for sip modifications). |
As a very casual contributor of small things I would plead for keeping this as "the default that will make commits much more likely to not put the contributor into another slow feedback loop of failing tests". Maybe disabling it could be the option? |
See GH-54893 for speed improvements |
This should be fixed by GH-54893 but out of curiosity: is this happening because you have all worktrees under the parent directory ? |
I was annoyed by the CI bot failing due to spellchecker (US vs. UK english) and wondered why the pre-commit hook was not running this locally, then found out I had to set an environment variable to enable that. This commit is to always run the spell checker when requirements are met and print a WARNING when they aren't, so that developers have more probabilities to not disappoint the bot lords