Skip to content
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

Remove all hooks from .pre-commit-config.yaml if disabled #1748

Open
jashandeep-sohi opened this issue Feb 24, 2025 · 1 comment
Open

Remove all hooks from .pre-commit-config.yaml if disabled #1748

jashandeep-sohi opened this issue Feb 24, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@jashandeep-sohi
Copy link
Contributor

While in the shell, I occasionally like to use the pre-commit CLI directly.
This works well, expect when you disable git-hooks.
In that case, .pre-commit-config.yaml goes out of sync, because currently it is only updated if at least one pre-commit hook is enabled

config = lib.mkIf ((lib.filterAttrs (id: value: value.enable) cfg.hooks) != { }) {

Would it be possible to always run

"devenv:git-hooks:install" = {
to make sure all disabled hooks are removed?

@jashandeep-sohi jashandeep-sohi added the enhancement New feature or request label Feb 24, 2025
@domenkozar
Copy link
Member

Would love to get this fixed, happy to accept a PR!

@domenkozar domenkozar added bug Something isn't working and removed enhancement New feature or request labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants