diff --git a/crates/ruff/src/rules/flake8_simplify/rules/ast_if.rs b/crates/ruff/src/rules/flake8_simplify/rules/ast_if.rs index 9f682c3c65..e1a9d2b6b1 100644 --- a/crates/ruff/src/rules/flake8_simplify/rules/ast_if.rs +++ b/crates/ruff/src/rules/flake8_simplify/rules/ast_if.rs @@ -126,7 +126,7 @@ define_violation!( /// /// Use instead: /// ```python - /// if x = 1 or x = 2 + /// if x = 1 or x = 2: /// print("Hello") /// ``` pub struct IfWithSameArms; diff --git a/docs/rules/combine-if-conditions.md b/docs/rules/combine-if-conditions.md deleted file mode 100644 index f3805a7f0b..0000000000 --- a/docs/rules/combine-if-conditions.md +++ /dev/null @@ -1,23 +0,0 @@ -# combine-if-conditions (SIM114) - -Derived from the **flake8-simplify** linter. - -### What it does -Checks if consecutive `if` branches have the same body. - -### Why is this bad? -These branches can be combine using the python `or` statement - -### Example -```python -if x = 1: - print("Hello") -elif x = 2: - print("Hello") -``` - -Use instead: -```python -if x = 1 or x = 2 - print("Hello") -``` \ No newline at end of file diff --git a/docs/rules/if-with-same-arms.md b/docs/rules/if-with-same-arms.md index 10a62afdc4..dc8ad20380 100644 --- a/docs/rules/if-with-same-arms.md +++ b/docs/rules/if-with-same-arms.md @@ -19,6 +19,6 @@ elif x = 2: Use instead: ```python -if x = 1 or x = 2 +if x = 1 or x = 2: print("Hello") -``` \ No newline at end of file +```