[pbs-devel] [RFC v2 proxmox-backup] git-hooks: pre-commit runs cargo fmt --check

Stefan Lendl s.lendl at proxmox.com
Mon Jan 15 10:28:26 CET 2024


Thomas Lamprecht <t.lamprecht at proxmox.com> writes:

> Am 12/01/2024 um 15:43 schrieb Stefan Lendl:
>> * add a pre-commit hook that declines commiting if cargo fmt would make
>
> as said off-list I do not want anything that blocks committing,
> that is a PITA in development especially as this doesn't gains us
> much... so NAK!

It's easy to overwrite the checks when committing with `git commit --no-verify`

>
> Let's rather add a fmt --check test to the buildbot, then we get
> pinged on issues and a maintainer can just commit and push a cargo
> fmt run without that much fuzz.. 
>

I agree adding a fmt check to a CI make absolute sense. As of now the
buildbot is not triggered when sending a patch series. So the user will
not get feedback.
Guarding locally against not-formatted commits, prevents user from
sending these patches in the first place.
The intent was to ensure style compliance BEFORE sending a patch series
and not relying on a manual feedback process to identify this.

Once a CI is ready, this could and should be done in the CI.




More information about the pbs-devel mailing list