-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Formatting check in CI is broken #834
Comments
A fix for the issue is here: #835 |
However, there's another issue in the check of all files never happens. It is supposed to be run for each commit on I can certainly do that. Just let me know. There will be a few hundred files that need reformatting. |
Please go forward, this is very good for the code base. |
Alright, I can do that. However, that should come after the check is in place. So could you have a look at #835 please? That fixes the script and will make sure that future PRs are properly formatted. Fixing the check that runs for each commit on
I haven't done this yet, but clang-format-docs looks promising. I have just run it on a random Instead of extending the existing script or adding another custom script to do this, would you be open to use pre-commit for this? I have had quite positive experiences with this in other projects. Although it was meant to be run as a Git hook originally, you don't have to use it like that. The current workflow can stay in place, but instead of a custom script, you would run |
Pre commits only work, if all people who make a PR actually use them, right? I am not against this, but I would argue that we have to have correct files even if the PR is from someone who does not check with a pre-commit hook before they send it in. |
No, you don't have to use it as a Git hook. That's how it started out and hence the name. But I personally don't use it like that in any project. Instead, I trigger it manually by running You know what, let me put together a PR today or tomorrow to show you how it would look like. |
Alright, so I put it up for my fork and it seems to be working fine. The commit messages would need some cleanup, but everything is there to get the idea. The PR is here. pre-commit is configured via .pre-commit-config.yaml. In addition to the clang-format check, there are a few standard checks. Those are not mandatory, but don't hurt either, so I kept them in. So this config plus the For the CI setup I created an extra workflow. That just uses the pre-commit action. I noticed in the meantime that it always runs with |
The
bin/check-formatting.sh
currently expects a path relative tobin
(or absolute), but it's called in CI with paths relative to the repo root. So no checks are run. Since currently not finding a file doesn't cause a non-zero exit code, the checks still pass.The text was updated successfully, but these errors were encountered: