Skip to content

Commit daecb46

Browse files
committed
[testing] Revert "[pylint] Implement swap-with-temporary-variable (PLR1712) (#22205)"
This is an alternative to #23588, checking the ecosystem results in comparison.
1 parent a62ba8c commit daecb46

7 files changed

Lines changed: 0 additions & 143 deletions

File tree

crates/ruff_linter/resources/test/fixtures/pylint/swap_with_temporary_variable.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

crates/ruff_linter/src/checkers/ast/analyze/deferred_scopes.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ pub(crate) fn deferred_scopes(checker: &Checker) {
2828
Rule::RuntimeImportInTypeCheckingBlock,
2929
Rule::SingledispatchMethod,
3030
Rule::SingledispatchmethodFunction,
31-
Rule::SwapWithTemporaryVariable,
3231
Rule::TooManyLocals,
3332
Rule::TypingOnlyFirstPartyImport,
3433
Rule::TypingOnlyStandardLibraryImport,
@@ -95,10 +94,6 @@ pub(crate) fn deferred_scopes(checker: &Checker) {
9594
pylint::rules::global_variable_not_assigned(checker, scope);
9695
}
9796

98-
if checker.is_rule_enabled(Rule::SwapWithTemporaryVariable) {
99-
pylint::rules::swap_with_temporary_variable(checker, scope_id, scope);
100-
}
101-
10297
if checker.is_rule_enabled(Rule::RedefinedArgumentFromLocal) {
10398
pylint::rules::redefined_argument_from_local(checker, scope_id, scope);
10499
}

crates/ruff_linter/src/codes.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
288288
(Pylint, "R1706") => rules::pylint::rules::AndOrTernary,
289289
(Pylint, "R1708") => rules::pylint::rules::StopIterationReturn,
290290
(Pylint, "R1711") => rules::pylint::rules::UselessReturn,
291-
(Pylint, "R1712") => rules::pylint::rules::SwapWithTemporaryVariable,
292291
(Pylint, "R1714") => rules::pylint::rules::RepeatedEqualityComparison,
293292
(Pylint, "R1722") => rules::pylint::rules::SysExitAlias,
294293
(Pylint, "R1730") => rules::pylint::rules::IfStmtMinMax,

crates/ruff_linter/src/rules/pylint/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ mod tests {
4646
#[test_case(Rule::CompareToEmptyString, Path::new("compare_to_empty_string.py"))]
4747
#[test_case(Rule::ComparisonOfConstant, Path::new("comparison_of_constant.py"))]
4848
#[test_case(Rule::ComparisonWithItself, Path::new("comparison_with_itself.py"))]
49-
#[test_case(
50-
Rule::SwapWithTemporaryVariable,
51-
Path::new("swap_with_temporary_variable.py")
52-
)]
5349
#[test_case(Rule::EqWithoutHash, Path::new("eq_without_hash.py"))]
5450
#[test_case(Rule::EmptyComment, Path::new("empty_comment.py"))]
5551
#[test_case(Rule::EmptyComment, Path::new("empty_comment_line_continuation.py"))]

crates/ruff_linter/src/rules/pylint/rules/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ pub(crate) use stop_iteration_return::*;
7979
pub(crate) use subprocess_popen_preexec_fn::*;
8080
pub(crate) use subprocess_run_without_check::*;
8181
pub(crate) use super_without_brackets::*;
82-
pub(crate) use swap_with_temporary_variable::*;
8382
pub(crate) use sys_exit_alias::*;
8483
pub(crate) use too_many_arguments::*;
8584
pub(crate) use too_many_boolean_expressions::*;
@@ -191,7 +190,6 @@ mod stop_iteration_return;
191190
mod subprocess_popen_preexec_fn;
192191
mod subprocess_run_without_check;
193192
mod super_without_brackets;
194-
mod swap_with_temporary_variable;
195193
mod sys_exit_alias;
196194
mod too_many_arguments;
197195
mod too_many_boolean_expressions;

crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1712_swap_with_temporary_variable.py.snap

Lines changed: 0 additions & 68 deletions
This file was deleted.

ruff.schema.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)