-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[flake8-pytest-style
] Fix defaults when lint.flake8-pytest-style
config section is empty (PT001
, PT023
)
#13292
base: main
Are you sure you want to change the base?
[flake8-pytest-style
] Fix defaults when lint.flake8-pytest-style
config section is empty (PT001
, PT023
)
#13292
Conversation
…yle.*-parentheses` config (`PT001`, `PT023`)
flake8-pytest-style
] Fix defaults for missing lint.flake8-pytest-style.*-parentheses
configs (PT001
, PT023
)flake8-pytest-style
] Fix defaults when lint.flake8-pytest-style
config section is empty (PT001
, PT023
)
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
E501 | 17 | 0 | 17 | 0 | 0 |
NPY002 | 8 | 0 | 8 | 0 | 0 |
C408 | 4 | 0 | 4 | 0 | 0 |
E741 | 1 | 0 | 1 | 0 | 0 |
PLW0127 | 1 | 0 | 1 | 0 | 0 |
PLW0128 | 1 | 0 | 1 | 0 | 0 |
F811 | 1 | 0 | 1 | 0 | 0 |
Linter (preview)
✅ ecosystem check detected no linter changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Sorry we didn't catch this, that's on us :-(
Unfortunately, however, this is will be a breaking change for some users, so we'll have to merge this as part of the 0.7 release. That should come at some point in the next few weeks, though; shouldn't be too long to wait :)
Summary
The documentation states that
lint.flake8-pytest-style.*-parentheses
options default tofalse
, but if the user provides an empty[lint.flake8-pytest-style]
config section, those options are suddenly set totrue
.This is a bug. After #12838 changed the defaults,
Flake8PytestStyleOptions::try_into_settings
wasn't updated and still relies on the preview mode to set the defaults.Reproduction
Test Plan
Manual testing, see reproduction section.
Given the fact that this was the only reference to
ruff_linter::settings::types::PreviewMode
incrates/ruff_workspace/src/options.rs
, looks like no other settings depend on the preview mode, and it doesn't make much sense to me to write any additional tests that verify there's no interaction between preview mode and other default values.