Change default for PT001 and PT023 (#12838)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Micha Reiser 2024-08-13 17:54:36 +02:00
parent 9fd8aaaf29
commit 2e211c5c22
15 changed files with 351 additions and 390 deletions

View file

@ -23,7 +23,7 @@ use ruff_linter::line_width::{IndentWidth, LineLength};
use ruff_linter::registry::RuleNamespace;
use ruff_linter::registry::{Rule, RuleSet, INCOMPATIBLE_CODES};
use ruff_linter::rule_selector::{PreviewOptions, Specificity};
use ruff_linter::rules::{flake8_pytest_style, pycodestyle};
use ruff_linter::rules::pycodestyle;
use ruff_linter::settings::fix_safety_table::FixSafetyTable;
use ruff_linter::settings::rule_table::RuleTable;
use ruff_linter::settings::types::{
@ -337,9 +337,7 @@ impl Configuration {
Flake8PytestStyleOptions::try_into_settings(options, lint_preview)
})
.transpose()?
.unwrap_or_else(|| {
flake8_pytest_style::settings::Settings::resolve_default(lint_preview)
}),
.unwrap_or_default(),
flake8_quotes: lint
.flake8_quotes
.map(Flake8QuotesOptions::into_settings)

View file

@ -1390,11 +1390,8 @@ pub struct Flake8PytestStyleOptions {
/// default), `@pytest.fixture()` is valid and `@pytest.fixture` is
/// invalid. If set to `false`, `@pytest.fixture` is valid and
/// `@pytest.fixture()` is invalid.
///
/// If [preview](https://docs.astral.sh/ruff/preview/) is enabled, defaults to
/// `false`.
#[option(
default = "true",
default = "false",
value_type = "bool",
example = "fixture-parentheses = true"
)]
@ -1476,11 +1473,8 @@ pub struct Flake8PytestStyleOptions {
/// default), `@pytest.mark.foo()` is valid and `@pytest.mark.foo` is
/// invalid. If set to `false`, `@pytest.mark.foo` is valid and
/// `@pytest.mark.foo()` is invalid.
///
/// If [preview](https://docs.astral.sh/ruff/preview/) is enabled, defaults to
/// `false`.
#[option(
default = "true",
default = "false",
value_type = "bool",
example = "mark-parentheses = true"
)]