-
-
Notifications
You must be signed in to change notification settings - Fork 710
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
forbid-new-submodules marked not applicable on repo w/o submodules #707
Comments
indeed this is a bit of a tricky case -- admittedly the original #619 changed how the hook matches files which causes it to no longer match on a repo without submodules |
I admit, the chances of someone accidentally adding a submodule are very slim. I simply added it to all my configs as a nice to have. If this is a "won't fix", feel free to close the issue. I can simply remove the hook where no longer applicable. |
you can maybe restore the old behaviour by overriding |
remove forbid-new-submodules pre-commit/pre-commit-hooks#707
updates: - [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](pre-commit/pre-commit-hooks@v4.0.1...v4.1.0) - [github.com/pre-commit/mirrors-mypy: v0.920 → v0.930](pre-commit/mirrors-mypy@v0.920...v0.930) remove forbid-new-submodules pre-commit/pre-commit-hooks#707
updates: - [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](pre-commit/pre-commit-hooks@v4.0.1...v4.1.0) - [github.com/pre-commit/mirrors-mypy: v0.920 → v0.930](pre-commit/mirrors-mypy@v0.920...v0.930) - [github.com/shellcheck-py/shellcheck-py: v0.8.0.2 → v0.8.0.3](shellcheck-py/shellcheck-py@v0.8.0.2...v0.8.0.3) remove forbid-new-submodules pre-commit/pre-commit-hooks#707
updates: - [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](pre-commit/pre-commit-hooks@v4.0.1...v4.1.0) - [github.com/pre-commit/mirrors-mypy: v0.920 → v0.930](pre-commit/mirrors-mypy@v0.920...v0.930) - [github.com/shellcheck-py/shellcheck-py: v0.8.0.2 → v0.8.0.3](shellcheck-py/shellcheck-py@v0.8.0.2...v0.8.0.3) remove forbid-new-submodules pre-commit/pre-commit-hooks#707
updates: - [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](pre-commit/pre-commit-hooks@v4.0.1...v4.1.0) remove forbid-new-submodules pre-commit/pre-commit-hooks#707
updates: - [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](pre-commit/pre-commit-hooks@v4.0.1...v4.1.0) remove forbid-new-submodules pre-commit/pre-commit-hooks#707
updates: - [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](pre-commit/pre-commit-hooks@v4.0.1...v4.1.0) - [github.com/pre-commit/mirrors-mypy: v0.920 → v0.930](pre-commit/mirrors-mypy@v0.920...v0.930) remove forbid-new-submodules pre-commit/pre-commit-hooks#707
updates: - [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](pre-commit/pre-commit-hooks@v4.0.1...v4.1.0) - [github.com/pre-commit/mirrors-mypy: v0.920 → v0.930](pre-commit/mirrors-mypy@v0.920...v0.930) remove forbid-new-submodules pre-commit/pre-commit-hooks#707
I think the resolution of this is "use this while migrating away from submodules" and once you're done you can replace it with a simple - repo: local
hooks:
- id: no-submodules
name: no submodules
language: fail
entry: submodules are not allowed in this repository
types: [directory] |
This might be intended behavior, but I'd like to get confirmation.
Since
4.1.0
, meta-hookcheck-hooks-apply
marksforbid-new-submodules
as "does not apply", if the repo does not contain any submodules.The hook
forbid-new-submodules
itself correctly warns when adding submodules to a previously empty repo, so it technically does apply.This might have to do with the changes introduced in #619.
Steps to reproduce:
$ git init issue-707 && cd issue-707
.pre-commit-config.yaml
with following content:.pre-commit-config.yaml
$ git add .pre-commit-config.yaml && git commit -m "Add pre-commit config"
The text was updated successfully, but these errors were encountered: