-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Comparing changes
Open a pull request
base repository: astral-sh/ruff
base: v0.4.0
head repository: astral-sh/ruff
compare: v0.4.1
- 11 commits
- 49 files changed
- 6 contributors
Commits on Apr 18, 2024
-
Allow
NoReturn
-like functions for__str__
,__len__
, etc. (#11017)## Summary If the method always raises, we shouldn't raise a diagnostic for "returning a value of the wrong type". Closes #11016.
Configuration menu - View commit details
-
Copy full SHA for 33529c0 - Browse repository at this point
Copy the full SHA 33529c0View commit details
Commits on Apr 19, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 5d3c9f2 - Browse repository at this point
Copy the full SHA 5d3c9f2View commit details -
[
pylint
] Implementinvalid-hash-returned
(PLE0309
) (#10961)Add pylint rule invalid-hash-returned (PLE0309) See #970 for rules Test Plan: `cargo test` TBD: from the description: "Strictly speaking `bool` is a subclass of `int`, thus returning `True`/`False` is valid. To be consistent with other rules (e.g. [PLE0305](#10962) invalid-index-returned), ruff will raise, compared to pylint which will not raise."
Configuration menu - View commit details
-
Copy full SHA for adf63d9 - Browse repository at this point
Copy the full SHA adf63d9View commit details -
ENH: Bump
ruff
dependency versions to support the latest release of…… `v0.4.0` and Python 3.12 (#11025) ## Summary With the release of [`v0.4.0`](https://github.com/astral-sh/ruff/releases/tag/v0.4.0) of `ruff`, I noticed that some of `ruff`'s dependencies were not updated to their latest versions. The [`ruff-pre-commit`](https://github.com/astral-sh/ruff-pre-commit) package released [`v0.4.0`](https://github.com/astral-sh/ruff-pre-commit/releases/tag/v0.4.0) at the same time `ruff` was updated, but `ruff` still referenced `v0.3.7` of the package, not the newly updated version. I updated the `ruff-pre-commit` reference to be `v0.4.0`. In a similar light, I noticed that the version of the [`dill`](https://github.com/uqfoundation/dill) package being used was not the latest version. I bumped `dill` from version `0.3.7` to `0.3.8`, which now [fully supports Python 3.12](https://github.com/uqfoundation/dill/releases/tag/0.3.8). ## Related Issues Resolves #11024
Configuration menu - View commit details
-
Copy full SHA for 97acf1d - Browse repository at this point
Copy the full SHA 97acf1dView commit details -
[
pylint
] Implementinvalid-index-returned
(PLE0305
) (#10962)Add pylint rule invalid-index-returned (PLE0305) See #970 for rules Test Plan: `cargo test`
Configuration menu - View commit details
-
Copy full SHA for 27902b7 - Browse repository at this point
Copy the full SHA 27902b7View commit details -
[
ruff]
Ignore stub functions inunused-async
(RUF029
) (#11026)## Summary We should ignore methods that appear to be stubs, e.g.: ```python async def foo() -> int: ... ``` Closes #11018.
Configuration menu - View commit details
-
Copy full SHA for 06c248a - Browse repository at this point
Copy the full SHA 06c248aView commit details -
Expect indented case block instead of match stmt (#11033)
## Summary This PR adds a new `Clause::Case` and uses it to parse the body of a `case` block. Earlier, it was using `Match` which would give an incorrect error message like: ``` | 1 | match subject: 2 | case 1: 3 | case 2: ... | ^^^^ Syntax Error: Expected an indented block after `match` statement | ``` ## Test Plan Add test case and update the snapshot.
Configuration menu - View commit details
-
Copy full SHA for 9bb23b0 - Browse repository at this point
Copy the full SHA 9bb23b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9b80cc0 - Browse repository at this point
Copy the full SHA 9b80cc0View commit details -
Use empty range when there's "gap" in token source (#11032)
## Summary This fixes a bug where the parser would panic when there is a "gap" in the token source. What's a gap? The reason it's `<=` instead of just `==` is because there could be whitespaces between the two tokens. For example: ```python # last token end # | current token (newline) start # v v def foo \n # ^ # assume there's trailing whitespace here ``` Or, there could tokens that are considered "trivia" and thus aren't emitted by the token source. These are comments and non-logical newlines. For example: ```python # last token end # v def foo # comment\n # ^ current token (newline) start ``` In either of the above cases, there's a "gap" between the end of the last token and start of the current token. ## Test Plan Add test cases and update the snapshots.
Configuration menu - View commit details
-
Copy full SHA for d3cd61f - Browse repository at this point
Copy the full SHA d3cd61fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 34873ec - Browse repository at this point
Copy the full SHA 34873ecView commit details -
Bump version to 0.4.1 (#11035)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 0ff25a5 - Browse repository at this point
Copy the full SHA 0ff25a5View 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.4.0...v0.4.1