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

Release v0.5.0 #12068

Merged
merged 17 commits into from
Jun 27, 2024
Merged
145 changes: 142 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,144 @@
# Changelog

## 0.5.0

Check out the [blog post](https://astral.sh/blog/ruff-v0.5.0) for a migration guide and overview of the changes!

### Breaking changes

See also, the "Remapped rules" section which may result in disabled rules.

* Follow the XDG specification to discover user-level configurations on macOS (same as on other Unix platforms)
* Selecting `ALL` excludes deprecated rules


### Deprecations

The following rules are now deprecated:
* [`syntax-error`](https://docs.astral.sh/ruff/rules/syntax-error/) (`E999`)

### Remapped rules

The following rules have been remapped to new rule codes:

* [`blocking-http-call-in-async-function`](https://docs.astral.sh/ruff/rules/blocking-http-call-in-async-function/): `ASYNC100` to `ASYNC210`
* [`open-sleep-or-subprocess-in-async-function`](https://docs.astral.sh/ruff/rules/open-sleep-or-subprocess-in-async-function/): `ASYNC101` split into `ASYNC220`, `ASYNC221`, `ASYNC230`, and `ASYNC251`
* [`blocking-os-call-in-async-function`](`https://docs.astral.sh/ruff/rules/blocking-os-call-in-async-function/`): `ASYNC102` been merged into `ASYNC220` and `ASYNC221`
* [`trio-timeout-without-await`](https://docs.astral.sh/ruff/rules/trio-timeout-without-await/): `TRIO100` to `ASYNC100`
* [`trio-sync-call`](https://docs.astral.sh/ruff/rules/trio-sync-call/): `TRIO105` to `ASYNC105`
* [`trio-async-function-with-timeout`](https://docs.astral.sh/ruff/rules/trio-async-function-with-timeout/): `TRIO109` to `ASYNC109`
* [`trio-unneeded-sleep`](https://docs.astral.sh/ruff/rules/trio-unneeded-sleep/): `TRIO110` to `ASYNC110`
* [`trio-zero-sleep-call`](https://docs.astral.sh/ruff/rules/trio-zero-sleep-call/): `TRIO115` to `ASYNC115`
* [`repeated-isinstance-calls`](https://docs.astral.sh/ruff/rules/repeated-isinstance-calls/): `PLR1701` to `SIM101`

### Stabilization

The following rules have been stabilized and are no longer in preview:

- [`mutable-fromkeys-value`](https://docs.astral.sh/ruff/rules/mutable-fromkeys-value/)
- [`default-factory-kwarg`](https://docs.astral.sh/ruff/rules/default-factory-kwarg/)
- [`django-extra`](https://docs.astral.sh/ruff/rules/django-extra/)
- [`manual-dict-comprehension`](https://docs.astral.sh/ruff/rules/manual-dict-comprehension/)
- [`print-empty-string`](https://docs.astral.sh/ruff/rules/print-empty-string/)
- [`readlines-in-for`](https://docs.astral.sh/ruff/rules/readlines-in-for/)
- [`if-expr-min-max`](https://docs.astral.sh/ruff/rules/if-expr-min-max/)
- [`bit-count`](https://docs.astral.sh/ruff/rules/bit-count/)
- [`redundant-log-base`](https://docs.astral.sh/ruff/rules/redundant-log-base/)
- [`regex-flag-alias`](https://docs.astral.sh/ruff/rules/regex-flag-alias/)
- [`isinstance-type-none`](https://docs.astral.sh/ruff/rules/isinstance-type-none/)
- [`type-none-comparison`](https://docs.astral.sh/ruff/rules/type-none-comparison/)
- [`implicit-cwd`](https://docs.astral.sh/ruff/rules/implicit-cwd/)
- [`hashlib-digest-hex`](https://docs.astral.sh/ruff/rules/hashlib-digest-hex/)
- [`list-reverse-copy`](https://docs.astral.sh/ruff/rules/list-reverse-copy/)
- [`bad-open-mode`](https://docs.astral.sh/ruff/rules/bad-open-mode/)
- [`empty-comment`](https://docs.astral.sh/ruff/rules/empty-comment/)
- [`global-at-module-level`](https://docs.astral.sh/ruff/rules/global-at-module-level/)
- [`misplaced-bare-raise`](https://docs.astral.sh/ruff/rules/misplaced-bare-raise`/)
- [`non-ascii-import-name`](https://docs.astral.sh/ruff/rules/non-ascii-import-name/)
- [`non-ascii-name`](https://docs.astral.sh/ruff/rules/non-ascii-name/)
- [`nonlocal-and-global`](https://docs.astral.sh/ruff/rules/nonlocal-and-global/)
- [`potential-index-error`](https://docs.astral.sh/ruff/rules/potential-index-error/)
- [`redeclared-assigned-name`](https://docs.astral.sh/ruff/rules/redeclared-assigned-name/)
- [`redefined-argument-from-locals`](https://docs.astral.sh/ruff/redefined-argument-from-locals/)
- [`repeated-keyword-argument`](https://docs.astral.sh/ruff/rules/repeated-keyword-argument/)
- [`super-without-brackets`](https://docs.astral.sh/ruff/rules/super-without-brackets/)
- [`unnecessary-list-index-lookup`](https://docs.astral.sh/ruff/rules/unnecessary-list-index-lookup/)
- [`useless-exception-statement`](https://docs.astral.sh/ruff/rules/useless-exception-statement/)
- [`useless-with-lock`](https://docs.astral.sh/ruff/rules/useless-with-lock/)
MichaReiser marked this conversation as resolved.
Show resolved Hide resolved

The following behaviors have been stabilized:

TODO
MichaReiser marked this conversation as resolved.
Show resolved Hide resolved

### Removals

The following deprecated settings have been removed:

* `output-format=text`; use `output-format=text` or `output-format=full`
* `tab-size`; use `indent-width`

The following deprecated CLI options have been removed:

* `show-source`; use `--output-format=full`
* `no-show-source`; use `--output-format=concise`

The following deprecated CLI commands have been removed:

* `ruff <path>`; use `ruff check <path>`
* `ruff --clean`; use `ruff clean`
* `ruff --generate-shell-completion`; use `ruff generate-shell-completion`

### Preview features
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, looks like it didn't add the features from the rebase-merge


- [`ruff`] Add `assert-with-print-message` rule (#11974) ([#11981](https://github.com/astral-sh/ruff/pull/11981))

### CLI

- Use rule name rather than message in --statistics ([#11697](https://github.com/astral-sh/ruff/pull/11697))
- Use the output format `full` by default ([#12010](https://github.com/astral-sh/ruff/pull/12010))
- Don't log syntax errors to the console ([#11902](https://github.com/astral-sh/ruff/pull/11902))

### Rule changes

- Fix RUF027 false positives if `gettext` is imported using an alias ([#12025](https://github.com/astral-sh/ruff/pull/12025))
- Update `trapz` and `in1d` deprecation for NPY201 ([#11948](https://github.com/astral-sh/ruff/pull/11948))
- Modify diagnostic ranges for shell-related bandit rules ([#10667](https://github.com/astral-sh/ruff/pull/10667))

### Server
- Closing an untitled, unsaved notebook document no longer throws an error ([#11942](https://github.com/astral-sh/ruff/pull/11942))
- Support the usage of tildes and environment variables in `logFile` ([#11945](https://github.com/astral-sh/ruff/pull/11945))
- Add option to configure whether to show syntax errors ([#12059](https://github.com/astral-sh/ruff/pull/12059))

### Bug fixes

- Avoid `E203` for f-string debug expression ([#12024](https://github.com/astral-sh/ruff/pull/12024))
- Consider 2-character EOL before line continuation ([#12035](https://github.com/astral-sh/ruff/pull/12035))
- Consider line continuation character for re-lexing ([#12008](https://github.com/astral-sh/ruff/pull/12008))
- Match import name ignores against both name and alias ([#12033](https://github.com/astral-sh/ruff/pull/12033))
- Use `TokenSource` to find new location for re-lexing ([#12060](https://github.com/astral-sh/ruff/pull/12060))
- [`pyflakes`] Detect assignments that shadow definitions (`F811`) ([#11961](https://github.com/astral-sh/ruff/pull/11961))
- Add syntax error for empty type parameter list ([#12030](https://github.com/astral-sh/ruff/pull/12030))
- Avoid consuming newline for unterminated string ([#12067](https://github.com/astral-sh/ruff/pull/12067))
- Do not include newline for unterminated string range ([#12017](https://github.com/astral-sh/ruff/pull/12017))
- Use correct range to highlight line continuation error ([#12016](https://github.com/astral-sh/ruff/pull/12016))


### Other changes
- Upgrade Unicode table ([#11194](https://github.com/astral-sh/ruff/pull/11194))
- Removed the deprecation error message for the nursery selector ([10172])(https://github.com/astral-sh/ruff/pull/10172)


## Release
- Migrate release workflow to cargo-dist ([#9559](https://github.com/astral-sh/ruff/pull/9559))

### Documentation
- Clarify special control flow parameters for `PLR0917`: `too-many-positional` ([#11978](https://github.com/astral-sh/ruff/pull/11978))
- Fix missing related settings header ([#12013](https://github.com/astral-sh/ruff/pull/12013))
- Update PEP reference in future_rewritable_type_annotation.rs ([#11985](https://github.com/astral-sh/ruff/pull/11985))
- `ruff-check`: update docs for fix_only ([#11959](https://github.com/astral-sh/ruff/pull/11959))
- Fix link to `python-lsp-server` ([#11980](https://github.com/astral-sh/ruff/pull/11980))
- Add `and formatter` to CLI startup message ([#12042](https://github.com/astral-sh/ruff/pull/12042))
MichaReiser marked this conversation as resolved.
Show resolved Hide resolved

## 0.4.10

### Parser
Expand Down Expand Up @@ -1772,9 +1911,9 @@ Read Ruff's new [versioning policy](https://docs.astral.sh/ruff/versioning/).
- Unsafe fixes are no longer displayed or applied without opt-in ([#7769](https://github.com/astral-sh/ruff/pull/7769))
- Drop formatting specific rules from the default set ([#7900](https://github.com/astral-sh/ruff/pull/7900))
- The deprecated `format` setting has been removed ([#7984](https://github.com/astral-sh/ruff/pull/7984))
- The `format` setting cannot be used to configure the output format, use `output-format` instead
- The `RUFF_FORMAT` environment variable is ignored, use `RUFF_OUTPUT_FORMAT` instead
- The `--format` option has been removed from `ruff check`, use `--output-format` instead
- The `format` setting cannot be used to configure the output format, use `output-format` instead
- The `RUFF_FORMAT` environment variable is ignored, use `RUFF_OUTPUT_FORMAT` instead
- The `--format` option has been removed from `ruff check`, use `--output-format` instead

### Rule changes

Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Ruff can also be used as a [pre-commit](https://pre-commit.com/) hook via [`ruff
```yaml
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.10
rev: v0.5.0
hooks:
# Run the linter.
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ruff"
version = "0.4.10"
version = "0.5.0"
publish = true
authors = { workspace = true }
edition = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_linter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ruff_linter"
version = "0.4.10"
version = "0.5.0"
publish = false
authors = { workspace = true }
edition = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions docs/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Ruff can be used as a [pre-commit](https://pre-commit.com) hook via [`ruff-pre-c
```yaml
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.10
rev: v0.5.0
hooks:
# Run the linter.
- id: ruff
Expand All @@ -27,7 +27,7 @@ To enable lint fixes, add the `--fix` argument to the lint hook:
```yaml
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.10
rev: v0.5.0
hooks:
# Run the linter.
- id: ruff
Expand All @@ -41,7 +41,7 @@ To run the hooks over Jupyter Notebooks too, add `jupyter` to the list of allowe
```yaml
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.10
rev: v0.5.0
hooks:
# Run the linter.
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "ruff"
version = "0.4.10"
version = "0.5.0"
description = "An extremely fast Python linter and code formatter, written in Rust."
authors = [{ name = "Astral Software Inc.", email = "[email protected]" }]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion scripts/benchmarks/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "scripts"
version = "0.4.10"
version = "0.5.0"
description = ""
authors = ["Charles Marsh <[email protected]>"]

Expand Down
Loading