Conversation
212f93c to
6c08a5c
Compare
|
I'm confused why this is needed, can't you make the call to pre-commit |
|
I don't think The goal is to let a project choose not to install any hooks into .git by default, unless the devShell user has opted in. |
…nstead of $GIT_WC
pre-commit did not pick up on the .sh extension because of types_or. This should be fixed properly somehow, but that's out of scope for this commit and branch.
6c08a5c to
af4ad11
Compare
|
I've re-done it. This time it just (cleanly) refactors the existing logic, so that it can be called without installing the hooks into |
| # `types_or = [ ... something ... ]` doesn't pick up our .sh file | ||
| shellcheck.types_or = nixpkgs.lib.mkForce [ ]; |
There was a problem hiding this comment.
This shouldn't have been necessary, but that's a different problem; not for this PR.
|
@roberth I'd love to have this. Are you willing to refresh your PR? |
|
Sorry for the mess, we revamed module structure in #397, could you port these changes over? |
|
Closing as outdated |
|
Is the functionality request outdated or just the state of the PR? Is there a replacement? |
|
I think having |
A highly opinionated workflow doesn't work for all projects, especially ones that already have a long history, notably NixOS/nix. Some people hate pre-commit with a passion.
These things should not be showstoppers.
To quote the docs:
Opting out, opting in
Users can enforce their own preference by setting
NIX_PRE_COMMIT_HOOKS_INSTALLto0or1in their environment, e.g. in.profileor inhome.sessionVariablesfor home-manager users.Furthermore, project maintainers can set a default preference via the
installByDefaultoption.Finally, regardless of these settings, you may install the hooks manually by running
nix-pre-commit-hooks-installin your shell. This does what it says, and the shell hook will detect that the hooks exist and keep them up to date.