Consider not using --force-exclude by default
Contrary to #19, making --force-exclude an implicit default can cause confusing behaviors. As some CI environments might run under paths that are excluded by default or excluded by custom configuration.
For example, the Bitbucket pipeline runs under /opt/atlassian/pipelines/agent/build, which is excluded by default (build), so running pre-commit run --all-files takes no effect at all, but it totally works as expected under local repo, really confusing!
Take me quite some time to figure out why our CI is not working, apparently, others have the same problem.
I suggest making the --force-exclude an opt-in, or at least add a reminder in README for setting --no-force-exclude.
Agreed, this has recently caught me out too, i think the best option is to just add it to the readme for now. Its trivial to remove if we do make the decision to drop it as a default argument. I have submitted a PR for this here: #72
Alternatively, I'm going to remove build from the default exclusion list in v0.3.0. It causes all sorts of problems (like this), and it's the only default for which we get issues like this.
See: https://github.com/astral-sh/ruff/pull/10093.
Yeah that makes sense :) Do we still think it's worth mentioning its the default? I spent quite a bit of time digging into this and really would have appreciated it being pointed out in the README 😆
I don't want to run with --force-exclude. This should be an option. Also I went crazy for an hour trying to figure out why it was ignoring files I had in a .github/scripts folder (hidden, thus excluded). Please move this to args and document it.
Actually, sorry. I'm still going crazy. --force-exclude doesn't seem to change whether or not my .github/scripts folder is evaluated. It works in cli but not in pre-commit.