-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add stickler shellcheck #189
Add stickler shellcheck #189
Conversation
For a better user and contributors and codeowners experience you could/should add a new Branch protection rule like this: |
Thanks for this PR. However, it should be made against I like the idea of having some kind of style check in this repo. I'm undecided if we should use stickler (as we do in the core repo) or |
With changing the base branch you changed two more files. I guess this is not intended. I think you need to rebase your local on master as well and do a force push. |
…sh in all branches
👁️ ❤️ force-pushing… 😵💫 |
@DL6ER , do you agree to use the docker image "koalaman/shellcheck" (or "koalaman/shellcheck-alpine") instead which has only a very, very small size (less than 10 Megabyte)? What I personally really like about ✏️ Update: There are only Ubuntu images available - no Alpine Linux at all. And if I understand it right, even Docker runs on-top of these images. See: https://github.com/actions/virtual-environments#available-environments |
@DL6ER , I tried stickler because I was indeed very interested in it and I wanted to know how it works and get the "user friendliness" you mentioned. (which really sounds "cool" to have the check results directly in the code, even if I normally edit with But I didn't find it user friendly yet, because Can you please explain where the user/committer can find these infos or what I've done wrong? 🤔 Maybe I'm too much got used with https://github.com/thomasmerz/PADD/pull/2/checks?check_run_id=5082565314 |
The much smaller base image is already a good start, however, as you found, this may not work. I do understand what you mean by better suggestions (wiki, etc.), but the opposite is that you need to click a few times to really find out why the job failed, once you reached the point, I do agree, the comments are more helpful: It should look like this (where I tool the screenshot above from), when configured correctly: another example: pi-hole/pi-hole@469b715 Maybe you didn't grant Stickler sufficient rights to actually add the comments it wanted to add. It's interesting it didn't fail but it may be that Stickler has to be configured in the target branch (currently, it isn't configured in You should see the comments listed on the stickler action like this when it works: https://github.com/pi-hole/pi-hole/runs/2976380981 The Ideally, we can get the best of both worlds, the quoted output above put next to the offending line. So maybe using indeed out own action is necessary to provide the needed flexibility. Then, a good starting point might be https://github.com/marketplace/actions/shellcheck-action Whatever we'd need to customize in the output format could then be done here. |
Ok, let's concentrate on
My .stickler.yml in my 'master' looks pretty much the same as yours ans stickler-ci-bot has all permissions that it reuested 🤷🏻♂️ And my PR is into my 'master'. "The repository you were looking for could not be found." 😞
But we have one in my repo what
SC2046 is a warning and not an info anymore…
This is pretty much the same (runs-on: ubuntu-latest) as this PR 🤔
I would only check and fail for severity=warning and error - not for info or even style - to improve code-quality. |
Yes, but it does add the comments to the lines, hence, making it user-friendly. The extra resources seem justified if we can get everything.
For other parts of the code, e.g., then central daemon FTL, we fail hard for warnings/infos of any severity. This enforces code-quality ;-) For the
And I wouldn't change this default. Otherwise, the output locally and the one from the CI may not be the same. |
Offtopic now? What's really cool with
Currently I'm still a bit confused: Please have a look at my test-run: thomasmerz#3
Can you please help and give my an advice?
You are more in coding than me - I believe you that even severity=info makes code better.
"Whose" local output? Yours or mine or from any other committer/contributor? 😉 |
We encourage users to run The best solution seems to be: Install stickler for this repo, ultimately enforcing a certain quality of new contributions. Even when the output of stickler is less than what you get on the terminal you can use the latter to fix your issue (this is what I meant with "local") before pushing (again). |
Okay, please give me some time to rewrite my PR for stickler and checking my follow-up-PR #190 again. |
Here we go - good things take some time to reduce them to the max 😁 🎉 |
If you agree with adding stickler here please merge and add the repo in the stickler-ci.com configuration (I can't do it.) |
By submitting this pull request, I confirm the following:
See https://github.com/thomasmerz/PADD/runs/5036319623?check_suite_focus=true
git rebase
)Please make sure you Sign Off all commits. Pi-hole enforces the DCO.
What does this PR aim to accomplish?:
This PR will introduce a GitHub Action which will run
shellcheck
on every commit in every branch and also on every PR. The result will show in detail what is not "ok" and advices how to fix it:How does this PR accomplish the above?:
This PR will use latest
shellcheck
on every run from the author's repo and let it run in a GitHub Action.What documentation changes (if any) are needed to support this PR?:
There are no necessary changes.