ruff
86b1ae93 - Add rule to enforce parentheses in `a or b and c` (#9440)

Commit
1 year ago
Add rule to enforce parentheses in `a or b and c` (#9440) Fixes #8721 ## Summary This implements the rule proposed in #8721, as RUF021. `and` always binds more tightly than `or` when chaining the two together. (This should definitely be autofixable, but I'm leaving that to a followup PR for now.) ## Test Plan `cargo test` / `cargo insta review`
Author
Parents
  • crates/ruff_linter
    • resources/test/fixtures/ruff
      • File
        RUF021.py
    • src
      • checkers/ast/analyze
        • File
          expression.rs
      • File
        codes.rs
      • rules/ruff
        • File
          mod.rs
        • rules
          • File
            mod.rs
          • File
            parenthesize_logical_operators.rs
        • snapshots
          • ruff_linter__rules__ruff__tests__RUF021_RUF021.py.snap
  • File
    ruff.schema.json