astral-sh / astral-sh/ruff-pre-commit

Consider not using --force-exclude by default

Open
#69 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
2k
Forks
105
Avg merge
8h 36m
Merged PRs (30d)
1

Description

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](https://docs.astral.sh/ruff/settings/#exclude) 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](https://github.com/astral-sh/ruff/discussions/6191).

I suggest making the `--force-exclude` an opt-in, or at least add a reminder in README for setting `--no-force-exclude`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.