Closed flagarde closed 1 year ago
Happy that you find these few hooks useful 😁
I am not particularly a fan of installing a local conda environment and then installing cppcheck
or iwyu
within it... I could see this potentially creating issues with different conda environment clashing if the users are already using conda somewhere else or in the same project (though I am not a conda user myself, so I might be wrong here).
But if you manage to convince me that such issues (like PATH modifications, adding local conda environment etc.)` are ok, then I wouldn't mind helping you implement this.
Note that some distros do not have iwyu
, e.g. Fedora.
In those cases, you can skip the hooks when running pre-commit
by specifying the SKIP
environment variable.
For example:
SKIP=include-what-you-use pre-commit run --all-files
I was giving a situation where it would be helpful to bundle iwyu. Ideally though, these should be handled in the upstream distros.
@Takishima It seems you can use different environments without clashing. My first idea was to be able to run those on github action so it would be less crashy than on personal computer.
As a workaround, the action could be run on ubuntu or debian (seems only those package iwyu according to pkgs.org) and install it manually. But I agree with @flagarde, that would be a cleaner approach.
@LecrisUT is what I will do but this make running twice pre-commit. One on precommit.ci (with iwyu and cppcheck desactivated) and then one in a dedicated github action
Very nice hooks, It save a lot of work and configuration.
It seems the hooks cppcheck and iwyu cannot be run in pre-commit.ci because the corresponding programs are missing.
I seems possible to install micromamba,conda https://pypi.org/project/ensureconda/ using pip and then use micromamba to download this programs.
I tried to work on this but my knowledge and pre-commit hooks and even python is quite limited :(