pre-commit-ci / issues

public issues for https://pre-commit.ci
17 stars 3 forks source link

Inconsistency with ci and local with skipping inexistant hooks #123

Closed lorenzwalthert closed 2 years ago

lorenzwalthert commented 2 years ago

A hook that is skipped on pre-commit.ci due to a config entry like this

ci:
    skip: [hook-name-that-does-not-exist]

that is not listed in the config errors on pre-commit.ci, but not on local commit. Example: https://results.pre-commit.ci/run/github/233107318/1650301987.rrehOSvfS-Oq8NHiA2kmGw

I suggest to either:

asottile commented 2 years ago

pre-commit ci has an entirely separate parser and it's not parsed by pre-commit (intentionally so the tool is not coupled) -- the validator lives at https://github.com/pre-commit-ci/pre-commit-ci-config and is installable as a pre-commit hook

lorenzwalthert commented 2 years ago

So basically everyone who uses pre-commit.ci has to have this hook... I see where you are coming from but does not look ideal to me. Thanks for the answer anyways, I followed your advice.

asottile commented 2 years ago

they don't have to, but it is available

lorenzwalthert commented 2 years ago

Yes they don't have too, but then it's possible that pre-commit passes locally and not on CI due to an invalid config, which is undesirable. To avoid that, you need the hook. Like the pre-commit parts are validated locally, but the CI parts that are specified in the same file are not.