-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Comparing changes
Open a pull request
base repository: astral-sh/ruff
base: v0.3.6
head repository: astral-sh/ruff
compare: v0.3.7
- 10 commits
- 40 files changed
- 7 contributors
Commits on Apr 11, 2024
-
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.
Configuration menu - View commit details
-
Copy full SHA for 0cc154c - Browse repository at this point
Copy the full SHA 0cc154cView commit details -
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`
Configuration menu - View commit details
-
Copy full SHA for 9b9098c - Browse repository at this point
Copy the full SHA 9b9098cView commit details -
Configuration menu - View commit details
-
Copy full SHA for e7d1d43 - Browse repository at this point
Copy the full SHA e7d1d43View commit det 8000 ails -
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>
Configuration menu - View commit details
-
Copy full SHA for 25f5a8b - Browse repository at this point
Copy the full SHA 25f5a8bView commit details -
[
flake8-bugbear
] Implementloop-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:
Configuration menu - View commit details
-
Copy full SHA for 03899dc - Browse repository at this point
Copy the full SHA 03899dcView commit details
Commits on Apr 12, 2024
-
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.
Configuration menu - View commit details
-
Copy full SHA for 7ae15c6 - Browse repository at this point
Copy the full SHA 7ae15c6View commit details -
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>
Configuration menu - View commit details
-
Copy full SHA for 563daa8 - Browse repository at this point
Copy the full SHA 563daa8View commit details -
[
pylint
] Recodenan-comparison
rule toW0177
(#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.
Configuration menu - View commit details
-
Copy full SHA for 312f434 - Browse repository at this point
Copy the full SHA 312f434View commit details -
[
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.
Configuration menu - View commit details
-
Copy full SHA for a9e4393 - Browse repository at this point
Copy the full SHA a9e4393View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e37cf6 - Browse repository at this point
Copy the full SHA 2e37cf6View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v0.3.6...v0.3.7