[flake8-pytest-style
] Fix defaults when lint.flake8-pytest-style
config section is empty (PT001
, PT023
)
#13292
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.