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

Consider always using --force-exclude #19

Closed
henryiii opened this issue Jan 20, 2023 · 3 comments · Fixed by #20
Closed

Consider always using --force-exclude #19

henryiii opened this issue Jan 20, 2023 · 3 comments · Fixed by #20
Labels
enhancement New feature or request

Comments

@henryiii
Copy link
Contributor

If it's true that running in pre-commit always needs --force-exclude to work properly, then you can set it as part of the entry, such as:

entry: ruff --force-exclude

This will then always include this option when running, regardless of what args is set to. Assume ruff is fine if this is passed twice (for backward compatibly with existing user's args:), then this is the recommended way to do this (for an example, see https://github.com/pre-commit/mirrors-clang-format/blob/ea59a72ffc9a1ce6b79b02a8076d031aa7ea7805/.pre-commit-hooks.yaml#L4 ).

If it's not the case that this (or any other flag) is always required for pre-commit, then nevermind. :)

@charliermarsh
Copy link
Member

I think this would be a good change. (Ruff should be fine with receiving that argument twice, and I think users could override it by passing --no-force-exclude, but I'd have to double-check.)

@charliermarsh charliermarsh added the enhancement New feature or request label Jan 20, 2023
@henryiii
Copy link
Contributor Author

Users can also override it by adding entry: ruff, technically. :)

charliermarsh pushed a commit that referenced this issue Jan 20, 2023
Closes #19.

Signed-off-by: Henry Schreiner <[email protected]>
charliermarsh pushed a commit that referenced this issue Jan 20, 2023
Re: #19 / #20

If I understand this is now always set, no need to include it in the README example.
charliermarsh pushed a commit to astral-sh/ruff that referenced this issue Jan 20, 2023
Re: astral-sh/ruff-pre-commit#19 / astral-sh/ruff-pre-commit#20

This is now always set, no need to include it in the README example.
@auscompgeek
Copy link

Ruff should be fine with receiving that argument twice

FWIW Ruff is definitely not fine with receiving that option twice. I just received a pre-commit.ci autoupdate PR where it fails: https://results.pre-commit.ci/run/github/584046811/1674533685.HvDYs3ClQkqwyoDsCuLJvQ

auscompgeek added a commit to thedropbears/pychargedup that referenced this issue Jan 24, 2023
This is now always passed in the pre-commit hook.

See astral-sh/ruff-pre-commit#19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants