Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ForVariableUsedAfterBlock (based on wemake_python_styleguide ControlVarUsedAfterBlockViolation WPS441) #11769

Open
wants to merge 38 commits into
base: main
Choose a base branch
from

Commits on May 28, 2024

  1. Rough start

    MadLittleMods committed May 28, 2024
    Configuration menu
    Copy the full SHA
    c1091a1 View commit details
    Browse the repository at this point in the history
  2. Rough run-able

    ```
    cargo run -p ruff -- check crates/ruff_linter/resources/test/fixtures/pylint/control_var_used_after_block.py --no-cache --select WPS441
    ```
    MadLittleMods committed May 28, 2024
    Configuration menu
    Copy the full SHA
    261fbc3 View commit details
    Browse the repository at this point in the history
  3. Lookup by reference

    MadLittleMods committed May 28, 2024
    Configuration menu
    Copy the full SHA
    8bed302 View commit details
    Browse the repository at this point in the history
  4. Add todo

    MadLittleMods committed May 28, 2024
    Configuration menu
    Copy the full SHA
    e85fe87 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2024

  1. Configuration menu
    Copy the full SHA
    eecc2af View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2024

  1. Work in all scopes

    MadLittleMods committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    3661066 View commit details
    Browse the repository at this point in the history
  2. Clean up code

    MadLittleMods committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    59a2e3b View commit details
    Browse the repository at this point in the history
  3. Adjust some wording

    MadLittleMods committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    0e491b3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9ca72a6 View commit details
    Browse the repository at this point in the history
  5. Commit test snapshot

    MadLittleMods committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    0ad0df0 View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2024

  1. Fix shadowed cases

    MadLittleMods committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    eaf2a35 View commit details
    Browse the repository at this point in the history
  2. Clean up debug

    MadLittleMods committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    710d68c View commit details
    Browse the repository at this point in the history
  3. Fix references before

    MadLittleMods committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    a7de1cb View commit details
    Browse the repository at this point in the history
  4. Adjust wording

    Also we can rely on undefined detection rules for the case
    where people use a variable before a loop that is also defined
    as a loop var below.
    MadLittleMods committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    f2a62bb View commit details
    Browse the repository at this point in the history
  5. Update snapshot

    MadLittleMods committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    97b165c View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. Configuration menu
    Copy the full SHA
    7ceb306 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    acc5b2a View commit details
    Browse the repository at this point in the history
  3. Merge branch 'main' into madlittlemods/control-var-used-after-block

    Conflicts:
    	crates/ruff_linter/src/codes.rs
    	crates/ruff_python_semantic/src/model.rs
    MadLittleMods committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    f5aa633 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2024

  1. Configuration menu
    Copy the full SHA
    026a48f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    544bbf5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2d13a62 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1d18c66 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7edd539 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5351952 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    19a0ab9 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    9e2ece4 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    d675a03 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    71ca5e1 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    8a11073 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2024

  1. Remove known_good_reference_node_ids and iterating bindings in reverse

    The [`known_good_reference_node_ids`](astral-sh@eaf2a35)
    evolved first to solve the shadowed cases but my
    [fix later on to allow previous references](astral-sh@a7de1cb)
    also ended up covering the shadowed cases without
    me realizing (much more elegant too).
    
    See:
    
     - astral-sh#11769 (comment)
     - astral-sh#11769 (comment)
    MadLittleMods committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    e59efa2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5a76166 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    106e78a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8b3e4de View commit details
    Browse the repository at this point in the history
  5. Reword

    MadLittleMods committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    59427f1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    63ecbfc View commit details
    Browse the repository at this point in the history
  7. Update snapshot

    MadLittleMods committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    27dad4f View commit details
    Browse the repository at this point in the history
  8. Merge branch 'main' into madlittlemods/control-var-used-after-block

    Conflicts:
    	crates/ruff_linter/src/codes.rs
    MadLittleMods committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    e7653df View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    9bcc4fe View commit details
    Browse the repository at this point in the history