Skip to content

Respect --force-exclude for lint.exclude and format.exclude#8393

Merged
charliermarsh merged 1 commit intomainfrom
charlie/force-exclude
Oct 31, 2023
Merged

Respect --force-exclude for lint.exclude and format.exclude#8393
charliermarsh merged 1 commit intomainfrom
charlie/force-exclude

Conversation

@charliermarsh
Copy link
Member

Summary

We typically avoid enforcing exclusions if a file was passed to Ruff directly on the CLI. However, we also allow --force-exclude, which ignores excluded files even if they're passed to Ruff directly. This is really important for pre-commit, which always passes changed files -- we need to exclude files passed by pre-commit if they're in the exclude lists.

Turns out the new lint.exclude and format.exclude settings weren't respecting --force-exclude.

Closes #8391.

@charliermarsh charliermarsh added bug Something isn't working cli Related to the command-line interface labels Oct 31, 2023
@github-actions
Copy link
Contributor

PR Check Results

Ecosystem

✅ ecosystem check detected no linter changes.

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@charliermarsh charliermarsh merged commit 1642f4d into main Oct 31, 2023
@charliermarsh charliermarsh deleted the charlie/force-exclude branch October 31, 2023 21:45
@charliermarsh
Copy link
Member Author

No prob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cli Related to the command-line interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lint.exclude and format.exclude don't respect --force-exclude

2 participants