8000 Comparing v0.3.6...v0.3.7 · astral-sh/ruff · GitHub
[go: up one dir, main page]

Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: astral-sh/ruff
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.6
Choose a base ref
...
head repository: astral-sh/ruff
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.3.7
Choose a head ref
  • 10 commits
  • 40 files changed
  • 7 contributors

Commits on Apr 11, 2024

  1. Avoid TOCTOU errors in cache initialization (#10884)

    ## Summary
    
    I believe this should close
    #10880? The `.gitignore`
    creation seems ok, since it truncates, but using `cachedir::is_tagged`
    followed by `cachedir::add_tag` is not safe, as `cachedir::add_tag`
    _fails_ if the file already exists.
    
    This also matches the structure of the code in `uv`.
    
    Closes #10880.
    charliermarsh authored Apr 11, 2024
    Configuration menu
    Copy the full SHA
    0cc154c View commit details
    Browse the repository at this point in the history
  2. Downgrade ESLint to v8 (#10888)

    ## Summary
    
    Some of our plugins aren't compatible with v9.
    
    Originally shipped in #10827.
    
    ## Test Plan
    
    - `npm install`
    - `npm ci`
    charliermarsh authored Apr 11, 2024
    Configuration menu
    Copy the full SHA
    9b9098c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e7d1d43 View commit det 8000 ails
    Browse the repository at this point in the history
  4. Struct not tuple for compiled per-file ignores (#10864)

    ## Summary
    
    Code cleanup for per-file ignores; use a struct instead of a tuple.
    
    Named the structs for individual ignores and the list of ignores
    `CompiledPerFileIgnore` and `CompiledPerFileIgnoreList`. Name choice is
    because we already have a `PerFileIgnore` struct for a
    pre-compiled-matchers form of the config. Name bikeshedding welcome.
    
    ## Test Plan
    
    Refactor, should not change behavior; existing tests pass.
    
    ---------
    
    Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
    carljm and AlexWaygood authored Apr 11, 2024
    Configuration menu
    Copy the full SHA
    25f5a8b View commit details
    Browse the repository at this point in the history
  5. [flake8-bugbear] Implement loop-iterator-mutation (B909) (#9578)

    ## Summary
    This PR adds the implementation for the current
    [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear)'s B038 rule.
    The B038 rule checks for mutation of loop iterators in the body of a for
    loop and alerts when found.
    
    Rational: 
    Editing the loop iterator can lead to undesired behavior and is probably
    a bug in most cases.
    
    Closes #9511.
    
    Note there will be a second iteration of B038 implemented in
    `flake8-bugbear` soon, and this PR currently only implements the weakest
    form of the rule.
    I'd be happy to also implement the further improvements to B038 here in
    ruff 🙂
    See PyCQA/flake8-bugbear#454 for more
    information on the planned improvements.
    
    ## Test Plan
    Re-using the same test file that I've used for `flake8-bugbear`, which
    is included in this PR (look for the `B038.py` file).
    
    
    Note: this is my first time using `rust` (beside `rustlings`) - I'd be
    very happy about thorough feedback on what I could've done better
    :slightly_smiling_face: - Bring it on :grinning:
    mimre25 authored Apr 11, 2024
    Configuration menu
    Copy the full SHA
    03899dc View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2024

  1. Fix comment copy/paste typo in newtype_index (#10892)

    ## Summary
    
    This comment looks wrongly copy-pasted from the comment above, and
    mentions the wrong type.
    
    ## Test Plan
    
    Comment-only change.
    carljm authored Apr 12, 2024
    Configuration menu
    Copy the full SHA
    7ae15c6 View commit details
    Browse the repository at this point in the history
  2. Fix docs and add overlap test for negated per-file-ignores (#10863)

    Refs #3172 
    
    ## Summary
    
    Fix a typo in the docs example, and add a test for the case where a
    negative pattern and a positive pattern overlap.
    
    The behavior here is simple: patterns (positive or negative) are always
    additive if they hit (i.e. match for a positive pattern, don't match for
    a negated pattern). We never "un-ignore" previously-ignored rules based
    on a pattern (positive or negative) failing to hit.
    
    It's simple enough that I don't really see other cases we need to add
    tests for (the tests we have cover all branches in the ignores_from_path
    function that implements the core logic), but open to reviewer feedback.
    
    I also didn't end up changing the docs to explain this more, because I
    think they are accurate as written and don't wrongly imply any more
    complex behavior. Open to reviewer feedback on this as well!
    
    After some discussion, I think allowing negative patterns to un-ignore
    rules is too confusing and easy to get wrong; if we need that, we should
    add `per-file-selects` instead.
    
    ## Test Plan
    
    Test/docs only change; tests pass, docs render and look right.
    
    ---------
    
    Co-authored-by: Alex Waygood <Alex.Waygood@gmail.com>
    carljm and AlexWaygood authored Apr 12, 2024
    Configuration menu
    Copy the full SHA
    563daa8 View commit details
    Browse the repository at this point in the history
  3. [pylint] Recode nan-comparison rule to W0177 (#10894)

    ## Summary
    
    This was accidentally committed under `W0117`, but the actual Pylint
    code is `W0177`:
    https://pylint.readthedocs.io/en/latest/user_guide/checkers/features.html.
    
    Closes #10791.
    charliermarsh authored Apr 12, 2024
    Configuration menu
    Copy the full SHA
    312f434 View commit details
    Browse the repository at this point in the history
  4. [pylint] Implement rule to prefer augmented assignment (PLR6104) (#…

    …9932)
    
    ## Summary
    
    Implement new rule: Prefer augmented assignment (#8877). It checks for
    the assignment statement with the form of `<expr> = <expr>
    <binary-operator> …` with a unsafe fix to use augmented assignment
    instead.
    
    ## Test Plan
    
    1. Snapshot test is included in the PR.
    2. Manually test with playground.
    lshi18 authored Apr 12, 2024
    Configuration menu
    Copy the full SHA
    a9e4393 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2e37cf6 View commit details
    Browse the repository at this point in the history
Loading
0