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

refactor: Introduce crates folder #2088

Merged

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Jan 22, 2023

This PR introduces a new crates directory and moves all "product" crates into that folder.

Part of #2059

TODO

  • Test Playground

@MichaReiser
Copy link
Member Author

MichaReiser commented Jan 22, 2023

@chammika-become what 's the best way to verify that my PR doesn't introduce any regressions?

It seems that the resources folder is only used by tests in the ruff_analyze crate. Should I move it to crates/rust_analyze/tests/resources

@MichaReiser MichaReiser force-pushed the refactor/create-crates-folder branch 2 times, most recently from 51b0f0c to 89202e5 Compare January 22, 2023 16:20
@charliermarsh
Copy link
Member

charliermarsh commented Jan 22, 2023

Maybe you meant to tag me? 😂

I think there are a few things we can do here from a testing perspective:

  1. Get CI passing (fmt, clippy, test --all).
  2. Ensure that the built wheel is unchanged (modulo incidental file-size changes due to README or whatever else). This would involve installing maturin, running maturin build, and then looking at the built wheel (which is just a zip archive containing the Ruff binary plus metadata):
❯ maturin build
🍹 Building a mixed python/rust project
🔗 Found bin bindings
📡 Using build options bindings from pyproject.toml
💻 Using `MACOSX_DEPLOYMENT_TARGET=11.0` for aarch64-apple-darwin by default
   Compiling ruff v0.0.229 (/Users/crmarsh/workspace/ruff)
   Compiling ruff_cli v0.0.229 (/Users/crmarsh/workspace/ruff/ruff_cli)
    Finished dev [unoptimized + debuginfo] target(s) in 18.11s
📦 Built wheel to /Users/crmarsh/workspace/ruff/target/wheels/ruff-0.0.229-py3-none-macosx_11_0_arm64.whl

❯ unzip -l /Users/crmarsh/workspace/ruff/target/wheels/ruff-0.0.229-py3-none-macosx_11_0_arm64.whl
Archive:  /Users/crmarsh/workspace/ruff/target/wheels/ruff-0.0.229-py3-none-macosx_11_0_arm64.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
   127520  01-22-2023 16:38   ruff-0.0.229.dist-info/METADATA
      103  01-22-2023 16:38   ruff-0.0.229.dist-info/WHEEL
     1070  01-22-2023 16:38   ruff-0.0.229.dist-info/license_files/LICENSE
        0  01-22-2023 16:38   ruff/__init__.py
      193  01-22-2023 16:38   ruff/__main__.py
 40091538  01-22-2023 16:38   ruff-0.0.229.data/scripts/ruff
      540  01-22-2023 16:38   ruff-0.0.229.dist-info/RECORD
---------                     -------
 40220964                     7 files

This artifact should be effectively identical before and after this change. (It's the thing that gets uploaded to PyPI and installed via pip install ruff.) It should also be possible to pip install /Users/crmarsh/workspace/ruff/target/wheels/ruff-0.0.229-py3-none-macosx_11_0_arm64.whl in a new virtual environment, then run ruff /path/to/file.py. I can help with that if your Python env isn't fully setup.

  1. Ensure that the playground works as expected? I guess we can just validate that locally for the most part via running the documented wasm-pack commands, then npm run dev from playground.

@charliermarsh
Copy link
Member

charliermarsh commented Jan 22, 2023

It seems that the resources folder is only used by tests in the ruff_analyze crate. Should I move it to crates/rust_analyze/tests/resources

I think this would be a reasonable thing to do. That folder mostly contains Python text fixtures, some of which are used by the unit tests (for snapshot testing with insta), and some of which just exist for manual testing right now (e.g., the stuff in resources/test/project, which lets you test some of the config-resolution logic manually).

There may well be a better convention for this altogether. It's one of the things I ran with at the start of the project, and hasn't changed much since. (I do like having the fixtures as Python files and not embedded as strings in Rust code, so I wouldn't want to change that aspect of it, but e.g., I'd guess that resources is not the conventional name for a folder like this.)

@MichaReiser MichaReiser force-pushed the refactor/create-crates-folder branch 2 times, most recently from de222f4 to 68260e2 Compare January 22, 2023 17:13
@not-my-profile
Copy link
Contributor

This PR further renames the ruff package to ruff_analyze, mainly to avoid the CLI and the previous ruff crate having the same name. I don't know if that's desired but I found it confusing that the ruff binary comes from the CLI and not the ruff crate.

I intentionally named the CLI crate this way when I split it from the library. I think it only makes sense that the ruff library is called ruff and not something random like ruff_analyze1. Also there is precedence for this naming convention from very popular projects e.g. diesel & diesel_cli and wasm-bindgen & wasm-bindgen-cli. I think naming the library crate something other than ruff very much implies that the library is a second-class citizen, which might be true right now but I very much expect that to change as ruff stabilizes.

Footnotes

  1. Also sounds weird given the very popular rust-analyzer ... we don't analyze ruff, we analyze python code.

@charliermarsh
Copy link
Member

I remain happy to update the crate structure, though I agree that we should retain the ruff name for now rather than renaming to ruff-analyzer. There's some precedent for this pattern amongst other projects, and it feels like a reasonable structure from my perspective.

(Also: we can always make that change in the future -- it's harder to undo than to do -- and in a separate PR, rather than bundling with the crate reorganization.)

README.md Outdated Show resolved Hide resolved
@MichaReiser MichaReiser force-pushed the refactor/create-crates-folder branch 2 times, most recently from 1b0a458 to a4b65b0 Compare January 26, 2023 15:05
@MichaReiser MichaReiser marked this pull request as ready for review January 26, 2023 15:21
@charliermarsh charliermarsh self-requested a review January 26, 2023 17:34
@@ -9,8 +9,8 @@ clap = { version = "4.0.1", features = ["derive"] }
itertools = { version = "0.10.5" }
libcst = { git = "https://github.com/charliermarsh/LibCST", rev = "f2f0b7a487a8725d161fe8b3ed73a6758b21e177" }
once_cell = { version = "1.16.0" }
ruff = { path = ".." }
ruff_cli = { path = "../ruff_cli" }
ruff = { path = "../crates/ruff" }
Copy link
Member

Choose a reason for hiding this comment

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

I believe ruff_dev needs to be moved to ./crates/ruff_dev.

@charliermarsh
Copy link
Member

I think we need to move ruff_dev as well. Apart from that, and a rebase, this looks good to me. I went ahead and tested both the playground, and maturin build + the installed wheel too.

@MichaReiser
Copy link
Member Author

I think we need to move ruff_dev as well. Apart from that, and a rebase, this looks good to me. I went ahead and tested both the playground, and maturin build + the installed wheel too.

Awesome, and thanks for testing!

I haven't moved ruff_dev because we haven't yet reached a consensus in #2059 on crates that are build scripts. I proposed to move code-gen/rust-scripts into the xtask folder to separate them from the product code and also to avoid accidentally publishing such crates in the future (consider code in the crates folder as the "public" crates and crates in the xtask folder as private). However, I learned more about ruff's code structure when doing this refactor and realized that there are also many scripts written in Python, and it makes sense for ruff not to write all scripts in rust to dogfood ruff.

I would prefer not to move ruff_dev for now and first get a shared understanding of where we want to place build scripts (use a single folder, keep the python and rust scripts separate, ...).

I've also decided not to move the resources folder yet because I first want to figure out a way to reuse the test-setup code between tests (avoid the repetition of the ../../resources path in every test.

@MichaReiser
Copy link
Member Author

I'll be out for the next few days. Feel free to land this anytime or take over. I've given Maintainers push access in case some merge conflicts need to be solved (or other changes)

@charliermarsh
Copy link
Member

👍 Will do!

@charliermarsh charliermarsh force-pushed the refactor/create-crates-folder branch 5 times, most recently from 43d23d9 to c01fe8c Compare January 28, 2023 16:46
@charliermarsh
Copy link
Member

@not-my-profile - I'm hoping to rebase and merge this in the next release (not today's release, the following). Did you have any further comments on changing the structure? I know you'd mentioned somewhere (though I can't find it in this PR) creating a symlink or similar to src.

@not-my-profile
Copy link
Contributor

I think the creation of that symlink can wait till we improve the structure of the ruff library.

Regarding this PR .. I think it would be nice to perform the change in 2 commits:

  1. The first commit only moves the files and changes nothing else.
  2. The second commit updates all path references that need to be updated.

@not-my-profile
Copy link
Contributor

not-my-profile commented Feb 1, 2023

And to be honest I'd like to avoid changes such as:

-           Path::new("./resources/test/fixtures/flake8_simplify")
+           Path::new("../../resources/test/fixtures/flake8_simplify")

I think it would be better to firstly refactor our code to have the test_path function automatically prefix ./resources/test/fixtures/ ... then we wouldn't have to update all of these paths for performing the move.

(Seeing that ./resources/test/fixtures is also referenced in Settings structs in the tests ... this should really be a constant).

@MichaReiser
Copy link
Member Author

My only point of disagreement is that I'd still like to move ruff_dev into crates for now.

Sound's good to me.

Another change that was made in that PR vis-a-vis this version is that resources was moved into crates/ruff, which I think is also a fine thing to do too.)

I can do that in t his PR too.

@@ -153,50 +154,50 @@ First, clone [CPython](https://github.com/python/cpython). It's a large and dive
which makes it a good target for benchmarking.

```shell
git clone --branch 3.10 https://github.com/python/cpython.git resources/test/cpython
git clone --branch 3.10 https://github.com/python/cpython.git crates/ruff/resources/test/cpython
Copy link
Member Author

Choose a reason for hiding this comment

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

I hope I got all these references correctly

@MichaReiser
Copy link
Member Author

MichaReiser commented Feb 5, 2023

@charliermarsh I moved ruff_dev and the resources folders. But it's not clear to me why the ubuntu tests are failing now (they pass fine on my linux machine)

@charliermarsh
Copy link
Member

Hmm, I wonder if it has to do with the docs/ in the .gitignore. The failing test (packaging::tests::package_detection) is relying on "./resources/test/project/examples/docs/docs", which was introduced prior to that addition to the .gitignore -- but if that directory is being moved, Git might think it's being deleted.

(Will check locally -- this is just first instinct.)

CONTRIBUTING.md Outdated Show resolved Hide resolved
@@ -45,9 +45,7 @@ def main(*, plugin: str, url: str, prefix_code: str) -> None:
fn rules(rule_code: Rule, path: &Path) -> Result<()> {
let snapshot = format!("{}_{}", rule_code.as_ref(), path.to_string_lossy());
let diagnostics =test_path(
Path::new("./resources/test/fixtures/%s")
Copy link
Member

Choose a reason for hiding this comment

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

Was the inclusion of ./resources/test/fixtures/ here wrong before? (I think so?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Uh, I didn't notice that I removed the test/fixtures too. I just searched for the committed code and inferred the pattern from there.

https://github.com/charliermarsh/ruff/blob/c6887fa4d35d67971930b7d681f70bb561423ef5/crates/ruff/src/rules/tryceratops/mod.rs#L26-L29

Copy link
Member

Choose a reason for hiding this comment

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

Yeah since test_path was introduced, I think the pattern we have now is correct. (IIRC, we do test these scripts on CI, but only that the code still compiles after running them, which wouldn't catch this issue.)

@MichaReiser
Copy link
Member Author

Hmm, I wonder if it has to do with the docs/ in the .gitignore. The failing test (packaging::tests::package_detection) is relying on "./resources/test/project/examples/docs/docs", which was introduced prior to that addition to the .gitignore -- but if that directory is being moved, Git might think it's being deleted.

(Will check locally -- this is just first instinct.)

Yeah, that was it. Took me a while to figure out that the failure indicated a test failure and not that some command failed to run...

@charliermarsh
Copy link
Member

I think the CI output used to be clearer, and should be improved once #344 is released (we use cargo insta test to help us detect unreferenced snapshots).

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

This looks good to me! Thanks for rebasing, and for putting this together in the first place. It puts us in a much better position to start introducing some new crates.

Once again I checked out locally and ran pip install . to verify that the Python package is building + installing as expected.

I'll look to merge this later today.

@charliermarsh
Copy link
Member

(Rebasing...)

@charliermarsh charliermarsh merged commit cd8be8c into astral-sh:main Feb 5, 2023
renovate bot added a commit to ixm-one/pytest-cmake-presets that referenced this pull request Feb 7, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [ruff](https://togithub.com/charliermarsh/ruff) | `^0.0.241` ->
`^0.0.242` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.242/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.242/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.242/compatibility-slim/0.0.241)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.242/confidence-slim/0.0.241)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>charliermarsh/ruff</summary>

###
[`v0.0.242`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.242)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.241...v0.0.242)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### Rules

- Implement pylint's `too-many-branches` rule (`PLR0912`) by
[@&#8203;chanman3388](https://togithub.com/chanman3388) in
[astral-sh/ruff#2550
- Implement pylint's `too-many-return-statements` rule (`PLR0911`) by
[@&#8203;chanman3388](https://togithub.com/chanman3388) in
[astral-sh/ruff#2564
- \[`pyupgrade`]: Removes quotes from annotations by
[@&#8203;colin99d](https://togithub.com/colin99d) in
[astral-sh/ruff#2431
- \[`pylint`]: bad-str-strip-call by
[@&#8203;colin99d](https://togithub.com/colin99d) in
[astral-sh/ruff#2570
- Implement pycodestyle's logical line detection by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#1130
- Enable autofix for unnecessary-paren-on-raise-exception by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2596
- Automatically remove empty type-checking blocks by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2598

##### Bug Fixes

- Avoid infinite renames for unused-loop-control-variable by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2581
- Ignore direct root-children in implicit-namespace-package by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2565
- Allow blank line before sticky-comment functions in docstrings by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2597
- Visit deferred assignments after deferred type annotations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2607
- Fix python module invocation by
[@&#8203;trottomv](https://togithub.com/trottomv) in
[astral-sh/ruff#2563
- Portably find ruff binary path from Python by
[@&#8203;andersk](https://togithub.com/andersk) in
[astral-sh/ruff#2574
- fix(commented-out-code): `mypy` and `SPDX-License-Identifier` false
positives by [@&#8203;scop](https://togithub.com/scop) in
[astral-sh/ruff#2587

#### New Contributors

- [@&#8203;trottomv](https://togithub.com/trottomv) made their first
contribution in
[astral-sh/ruff#2563
- [@&#8203;MichaReiser](https://togithub.com/MichaReiser) made their
first contribution in
[astral-sh/ruff#2088

**Full Changelog**:
astral-sh/ruff@v0.0.241...v0.0.242

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/ixm-one/pytest-cmake-presets).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMjQuMiIsInVwZGF0ZWRJblZlciI6IjM0LjEyNC4yIn0=-->

Signed-off-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
emmeowzing added a commit to premiscale/premiscale that referenced this pull request Feb 20, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [ruff](https://togithub.com/charliermarsh/ruff) | `^0.0.237` ->
`^0.0.247` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.247/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.247/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.247/compatibility-slim/0.0.237)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.247/confidence-slim/0.0.237)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>charliermarsh/ruff</summary>

###
[`v0.0.247`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.247)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.246...v0.0.247)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### Rules

- \[`NPY001`] deprecated type aliases by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[astral-sh/ruff#2810
- \[`RUF006`] Implement `asyncio-dangling-task` to track
`asyncio.create_task` calls by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2935

##### CLI

- Implement shell autocompletion for rule codes by
[@&#8203;not-my-profile](https://togithub.com/not-my-profile) in
[astral-sh/ruff#2906

##### Bug Fixes

- Handle multiple receiver decorators in receiver-decorator by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2858
- Avoid false-positives with multi-byte characters in B005 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2862
- Avoid false-positives for runtime-types in type checking blocks by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2863
- Avoid noqa removal upon unhandled syntax errors by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2864
- Ignore non-imperative-mood in Google docstring convention by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2900
- \[`flake8-tidy-imports`] autofix relative imports by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[astral-sh/ruff#2891
- Respect self as positional-only argument in annotation rules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2927
- Apply nullable-model-string-field to all classes by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2928
- Deduplicate files provided on the command-line by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2931
- Re-show --target-version on CLI interface by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2859
- Remove autofix for prefer-type-error by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2880
- Avoid unnecessary-else violations in `elif` branches by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2881
- Extend B904 to else branches by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2886
- Allow private accesses on current class by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2929

#### New Contributors

- [@&#8203;Jeremiah-England](https://togithub.com/Jeremiah-England) made
their first contribution in
[astral-sh/ruff#2884
- [@&#8203;Chris-May](https://togithub.com/Chris-May) made their first
contribution in
[astral-sh/ruff#2896
- [@&#8203;simon04](https://togithub.com/simon04) made their first
contribution in
[astral-sh/ruff#2904

**Full Changelog**:
astral-sh/ruff@v0.0.246...v0.0.247

###
[`v0.0.246`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.246)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.245...v0.0.246)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### Breaking Changes

- Remove multiple-statements-on-one-line-def (E704) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2773

##### Rules

- \[`flake8-pyi`]: add rules for unrecognized platform check (PYI007,
PYI008) by [@&#8203;SigureMo](https://togithub.com/SigureMo) in
[astral-sh/ruff#2805
- \[`flake8-simplify`]: combine-if-conditions by
[@&#8203;colin99d](https://togithub.com/colin99d) in
[astral-sh/ruff#2823
- \[`flake8-django`] Implemented flake8-django plugin rules by
[@&#8203;konysko](https://togithub.com/konysko) in
[astral-sh/ruff#2586

##### CLI

- Implement `config` subcommand by
[@&#8203;not-my-profile](https://togithub.com/not-my-profile) in
[astral-sh/ruff#2775
- Add rendering of rule markdown for terminal output by
[@&#8203;ngnpope](https://togithub.com/ngnpope) in
[astral-sh/ruff#2747
- Add `--show-fixes` flag to show applied fixes by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2707

##### Settings

- implemented option lines-between-types for isort by
[@&#8203;PushUpek](https://togithub.com/PushUpek) in
[astral-sh/ruff#2762

##### Autofix

- \[`pyflakes`] Support unused variable removal in multi-assignment
statements by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2786
- \[`flake8-comprehensions`] autofix C414 and C417 + bugfix by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[astral-sh/ruff#2693
- \[`flake8-comprehensions`] bugfix for C413 autofix by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[astral-sh/ruff#2804
- \[`flake8-simplify`] Use smarter inversion for comparison checks by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2831
- \[`flake8-comprehensions`] improve autofix for C401, C402 and C417 by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[astral-sh/ruff#2806

##### Bug Fixes

- Ignore colon-after-lambda in compound statement rules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2771
- Don't treat all future import accesses as non-runtime by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2774
- Avoid treating deferred string annotations as required-at-runtime by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2779
- Respect continuations in `noqa` enforcement by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2783
- Improve unused-variable autofixes for with statements by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2785
- Refactor generator to use Astor-derived precedence levels by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2798
- Allow private accesses on super calls by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2815
- Allow non-verbose raise when cause is present by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2816
- Avoid duplicates in if-with-same-arms by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2827
- Include package inference during --add-noqa command by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2832
- Allow compound statements of single ellipsis by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2837

#### New Contributors

- [@&#8203;trag1c](https://togithub.com/trag1c) made their first
contribution in
[astral-sh/ruff#2757
- [@&#8203;PushUpek](https://togithub.com/PushUpek) made their first
contribution in
[astral-sh/ruff#2762
- [@&#8203;konysko](https://togithub.com/konysko) made their first
contribution in
[astral-sh/ruff#2586
- [@&#8203;SigureMo](https://togithub.com/SigureMo) made their first
contribution in
[astral-sh/ruff#2805

**Full Changelog**:
astral-sh/ruff@v0.0.245...v0.0.246

###
[`v0.0.245`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.245)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.244...v0.0.245)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### Breaking Changes

- Remove public Rust API by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2709

##### Rules

- \[`flake8-pyi`]Add flake8-pyi with one rule by
[@&#8203;sbdchd](https://togithub.com/sbdchd) in
[astral-sh/ruff#2682
- \[`pylint`]: bad-string-format-type by
[@&#8203;colin99d](https://togithub.com/colin99d) in
[astral-sh/ruff#2572
- \[`pylint`]: yield-in-init by
[@&#8203;tomecki](https://togithub.com/tomecki) in
[astral-sh/ruff#2716
- \[`flake8-tidy-imports`] Implement autofix for relative imports
(TID252) by [@&#8203;sbrugman](https://togithub.com/sbrugman) in
[astral-sh/ruff#2739
- \[`flake8-bandit`]: try-except-continue by
[@&#8203;colin99d](https://togithub.com/colin99d) in
[astral-sh/ruff#2674
- \[`flake8-bandit`] Implement bandit's 'hardcoded-sql-expressions' S608
by [@&#8203;mattoberle](https://togithub.com/mattoberle) in
[astral-sh/ruff#2698
- \[`pycodestyle`] Implement compound-statements (E701, E702, E703,
E704) by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2680

##### Settings

- feat(isort): Implement known-local-folder by
[@&#8203;spaceone](https://togithub.com/spaceone) in
[astral-sh/ruff#2657
- Suppress parse errors with explicit `# noqa: E999` directives by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2697

##### Bug Fixes

- Support callable decorators in classmethod_decorators et al by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2675
- Avoid flagging typed exceptions in tuples by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2728
- Mark flake8-simplify rules as unfixable in non-fixable cases by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2676
- Treat re-exported annotations as used-at-runtime by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2689
- Gate `Path.readlink()` behind Python 3.9+ guard by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2708
- Handle functions that never return in RET503
([#&#8203;2602](https://togithub.com/charliermarsh/ruff/issues/2602)) by
[@&#8203;ppentchev](https://togithub.com/ppentchev) in
[astral-sh/ruff#2701
- Handle more functions that never return in RET503 by
[@&#8203;ngnpope](https://togithub.com/ngnpope) in
[astral-sh/ruff#2719
- Expand S110 and S112 ranges to include entire exception handler by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2729
- Relax conditions in bad-string-format-type by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2731
- Mark `__all__` members as used at end-of-scope by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2733
- Only validate `__all__` bindings for global scope by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2738
- Only trigger compound statements after select keywords by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2737
- Use `function_type::classify` for `yield-in-init` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2742
- Allow named unicodes in bidirectional escape check by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2710
- Respect NO_COLOR flags in --show-source by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2750
- Flag private member accesses on calls et al by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2753

#### New Contributors

- [@&#8203;ngnpope](https://togithub.com/ngnpope) made their first
contribution in
[astral-sh/ruff#2692
- [@&#8203;ppentchev](https://togithub.com/ppentchev) made their first
contribution in
[astral-sh/ruff#2701
- [@&#8203;tomecki](https://togithub.com/tomecki) made their first
contribution in
[astral-sh/ruff#2716

**Full Changelog**:
astral-sh/ruff@v0.0.244...v0.0.245

###
[`v0.0.244`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.244)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.243...v0.0.244)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### Rules

- \[`pylint`]: bidirectional-unicode by
[@&#8203;colin99d](https://togithub.com/colin99d) in
[astral-sh/ruff#2589
- Implement whitespace-around-keywords (E271, E272, E273, E274) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2653
- Implement whitespace-before-comment (E261, E262, E265, E266) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2654

##### Settings

- flake8-annotations: add ignore-fully-untyped by
[@&#8203;akx](https://togithub.com/akx) in
[astral-sh/ruff#2128
- Add `--exit-non-zero-on-fix` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2668

##### Documentation

- Derive `explanation` method on Rule struct via rustdoc by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2642
- Create per-rule pages and link from README by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2644
- Add documentation for flake8-quotes rules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2650
- Disable autofix for flake8-print rules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2651
- Add documentation for eradicate, flake8-import-conventions, and
flake8-no-pep420 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2652
- doc: add documentation for TRY002 by
[@&#8203;nm-remarkable](https://togithub.com/nm-remarkable) in
[astral-sh/ruff#2655

##### Bug Fixes

- Accommodate pos-only arguments when checking self name by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2626
- Avoid non-recursion in nested typing function calls by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2627
- Avoid no-unnecessary-dict-kwargs errors with reserved keywords by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2628
- Treat [@&#8203;staticmethod](https://togithub.com/staticmethod) as
higher-precedence than ABC by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2635
- Avoid boolean-trap errors in `__setitem__` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2636
- Skip ternary fixes for yields and awaits by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2637
- Ignore all non-`.py` wrt. implicit namespace package by
[@&#8203;scop](https://togithub.com/scop) in
[astral-sh/ruff#2640
- Avoid false-positive in chained type calls by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2663
- Treat annotated assignments in class and module scopes as runtime by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2667
- Accommodate multiple `@pytest.mark.parametrize` decorators by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2662
- Use separate exit codes for fatal errors vs. lint errors by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2670

#### New Contributors

- [@&#8203;nm-remarkable](https://togithub.com/nm-remarkable) made their
first contribution in
[astral-sh/ruff#2655

**Full Changelog**:
astral-sh/ruff@v0.0.243...v0.0.244

###
[`v0.0.243`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.243)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.242...v0.0.243)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### Rules

- Add flake8-pie single_starts_ends_with by
[@&#8203;sbdchd](https://togithub.com/sbdchd) in
[astral-sh/ruff#2616

##### Bug Fixes

- fix(pep8-naming): `typing.NamedTuple` and `typing.TypedDict` treatment
by [@&#8203;scop](https://togithub.com/scop) in
[astral-sh/ruff#2611
- Support `ignore-names` for all relevant pep8-naming rules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2617
- Avoid removing quotes from runtime annotations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2614
- Support relative paths for typing-modules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2615

**Full Changelog**:
astral-sh/ruff@v0.0.242...v0.0.243

###
[`v0.0.242`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.242)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.241...v0.0.242)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### Rules

- Implement pylint's `too-many-branches` rule (`PLR0912`) by
[@&#8203;chanman3388](https://togithub.com/chanman3388) in
[astral-sh/ruff#2550
- Implement pylint's `too-many-return-statements` rule (`PLR0911`) by
[@&#8203;chanman3388](https://togithub.com/chanman3388) in
[astral-sh/ruff#2564
- \[`pyupgrade`]: Removes quotes from annotations by
[@&#8203;colin99d](https://togithub.com/colin99d) in
[astral-sh/ruff#2431
- \[`pylint`]: bad-str-strip-call by
[@&#8203;colin99d](https://togithub.com/colin99d) in
[astral-sh/ruff#2570
- Implement pycodestyle's logical line detection by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#1130
- Enable autofix for unnecessary-paren-on-raise-exception by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2596
- Automatically remove empty type-checking blocks by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2598

##### Bug Fixes

- Avoid infinite renames for unused-loop-control-variable by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2581
- Ignore direct root-children in implicit-namespace-package by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2565
- Allow blank line before sticky-comment functions in docstrings by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2597
- Visit deferred assignments after deferred type annotations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2607
- Fix python module invocation by
[@&#8203;trottomv](https://togithub.com/trottomv) in
[astral-sh/ruff#2563
- Portably find ruff binary path from Python by
[@&#8203;andersk](https://togithub.com/andersk) in
[astral-sh/ruff#2574
- fix(commented-out-code): `mypy` and `SPDX-License-Identifier` false
positives by [@&#8203;scop](https://togithub.com/scop) in
[astral-sh/ruff#2587

#### New Contributors

- [@&#8203;trottomv](https://togithub.com/trottomv) made their first
contribution in
[astral-sh/ruff#2563
- [@&#8203;MichaReiser](https://togithub.com/MichaReiser) made their
first contribution in
[astral-sh/ruff#2088

**Full Changelog**:
astral-sh/ruff@v0.0.241...v0.0.242

###
[`v0.0.241`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.241)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.240...v0.0.241)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### Deprecates

- Soft-deprecate `update-check` by
[@&#8203;akx](https://togithub.com/akx) in
[astral-sh/ruff#2530

##### Rules

- feat: add autofix for PLR0402 by
[@&#8203;spaceone](https://togithub.com/spaceone) in
[astral-sh/ruff#2504
- Allow F811 noqa declarations on containing import lines by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2553

##### Features

- Mark fixable issues in printer output by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2500
- Always report parse errors back to the user by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2505
- Notify user if autofix introduces syntax error by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2507
- Add `known-standard-library` for each Python version by
[@&#8203;JonathanPlasse](https://togithub.com/JonathanPlasse) in
[astral-sh/ruff#2491

##### Bug Fixes

- Avoid renaming unused loop variables with deferred usages by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2509
- \[`flake8-self`] Fix False Negative Issue on Rule `SLF001` by
[@&#8203;saadmk11](https://togithub.com/saadmk11) in
[astral-sh/ruff#2527
- Minor fixes to PLR0915 logic by
[@&#8203;chanman3388](https://togithub.com/chanman3388) in
[astral-sh/ruff#2518
- Exit upon showing files with `--show-files` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2543
- Ignore direct source-children in `implicit-namespace-package` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2560
- Allow `list()` and `tuple()` calls in `__all__` assignments by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2499
- Don't walk past project root when figuring out exclusion by
[@&#8203;akx](https://togithub.com/akx) in
[astral-sh/ruff#2471
- Avoid hang when detecting trailing comments by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2549

#### New Contributors

- [@&#8203;JacobCoffee](https://togithub.com/JacobCoffee) made their
first contribution in
[astral-sh/ruff#2516
- [@&#8203;Pierre-Sassoulas](https://togithub.com/Pierre-Sassoulas) made
their first contribution in
[astral-sh/ruff#2559

**Full Changelog**:
astral-sh/ruff@v0.0.240...v0.0.241

###
[`v0.0.240`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.240)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.239...v0.0.240)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### Rules

- \[`pyupgrade`]: Remove outdated `sys.version_info` blocks by
[@&#8203;colin99d](https://togithub.com/colin99d) in
[astral-sh/ruff#2099
- \[`flake8-self`] Add Plugin and Rule `SLF001` by
[@&#8203;saadmk11](https://togithub.com/saadmk11) in
[astral-sh/ruff#2470
- \[`pylint`] Implement pylint's `too-many-statements` rule (`PLR0915`)
by [@&#8203;chanman3388](https://togithub.com/chanman3388) in
[astral-sh/ruff#2445

##### Settings

- \[`isort`] Support forced_separate by
[@&#8203;akx](https://togithub.com/akx) in
[astral-sh/ruff#2268
- \[`isort`] Add isort option lines-after-imports by
[@&#8203;reidswan](https://togithub.com/reidswan) in
[astral-sh/ruff#2440
- Allow non-ruff.toml-named files for --config by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2463

##### Bug Fixes

- Trigger, but don't fix, SIM rules if comments are present by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2450
- Only avoid PEP604 rewrites for pre-Python 3.10 code by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2449
- Use LibCST to reverse Yoda conditions by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2468
- fix: assertTrue()/assertFalse() fixer should not test for identity by
[@&#8203;spaceone](https://togithub.com/spaceone) in
[astral-sh/ruff#2476
- Treat `if 0:` and `if False:` as type-checking blocks by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2485
- Avoid iterating over body twice by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2439
- more builtin name checks when autofixing by
[@&#8203;spaceone](https://togithub.com/spaceone) in
[astral-sh/ruff#2430
- Respect parent noqa in --add-noqa by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2464
- Avoid removing un-selected codes when applying `--add-noqa` edits by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2465
- Carry-over `ignore` to next config layer if `select = []` by
[@&#8203;not-my-profile](https://togithub.com/not-my-profile) in
[astral-sh/ruff#2467
- Visit NamedExpr values before targets by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2484

#### New Contributors

- [@&#8203;reidswan](https://togithub.com/reidswan) made their first
contribution in
[astral-sh/ruff#2440
- [@&#8203;chanman3388](https://togithub.com/chanman3388) made their
first contribution in
[astral-sh/ruff#2445

**Full Changelog**:
astral-sh/ruff@v0.0.239...v0.0.240

###
[`v0.0.239`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.239)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.238...v0.0.239)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### Rules

- \[`pyupgrade`] Implement import-replacement rule (`UP035`) by
[@&#8203;colin99d](https://togithub.com/colin99d) in
[astral-sh/ruff#2049
- \[`flake8-raise`] Add Plugin and `RSE102` Rule by
[@&#8203;saadmk11](https://togithub.com/saadmk11) in
[astral-sh/ruff#2354
- \[`flake8-quotes`] Allow implicit multiline strings with internal
quotes to use non-preferred quote by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2416

##### Documentation

- Add a link to MkDocs by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2370
- Use human-readable types for documentation values by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2375

##### Bug Fixes

- \[`I001`] fix isort check for files with tabs and no indented blocks
by [@&#8203;sciyoshi](https://togithub.com/sciyoshi) in
[astral-sh/ruff#2374
- Don't panic for --statistics with no errors by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2391
- Handle multi-byte lines in RUF100 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2392
- Avoid implicit-namespace-package checks for .pyi files by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2420
- Include per-file ignore matches in debug logging by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2376
- Include method name in B027 message by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2403
- Avoid flagging same-condition cases in SIM103 by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2404
- feat: let SIM103 return expressions without bool() wrapping by
[@&#8203;spaceone](https://togithub.com/spaceone) in
[astral-sh/ruff#2410
- feat: let SIM210 return expressions without bool() wrapping
([#&#8203;2410](https://togithub.com/charliermarsh/ruff/issues/2410)) by
[@&#8203;spaceone](https://togithub.com/spaceone) in
[astral-sh/ruff#2426
- fix: ignore fix if "bool" is not builtin by
[@&#8203;spaceone](https://togithub.com/spaceone) in
[astral-sh/ruff#2429
- Avoid Bandit false-positives for empty-string-as-password by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2421

#### New Contributors

- [@&#8203;eriknw](https://togithub.com/eriknw) made their first
contribution in
[astral-sh/ruff#2380
- [@&#8203;has2k1](https://togithub.com/has2k1) made their first
contribution in
[astral-sh/ruff#2386

**Full Changelog**:
astral-sh/ruff@v0.0.238...v0.0.239

###
[`v0.0.238`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.238)

[Compare
Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.237...v0.0.238)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### ⚠️ Breaking Changes ⚠️

##### `select`, `extend-select`, `ignore`, and `extend-ignore` have new
semantics
([#&#8203;2312](https://togithub.com/charliermarsh/ruff/pull/2312))

Previously, the interplay between `select` and its related options could
lead to unexpected behavior. For example, `ruff --select E501 --ignore
ALL` and `ruff --select E501 --extend-ignore ALL` behaved differently.
(See [#&#8203;2312](https://togithub.com/charliermarsh/ruff/pull/2312)
for more examples.)

The new semantics are such that Ruff uses the "highest-priority"
`select` as the basis for the rule set, and then applies any
`extend-select`, `ignore`, and `extend-ignore` adjustments. CLI options
are given higher priority than `pyproject.toml` options, and the current
`pyproject.toml` file is given higher priority than any inherited
`pyproject.toml` files.

As an example: `ruff --select F401` will select rule `F401`, and ignore
any of the modifiers from the `pyproject.toml`, as the "highest-priorty"
select kicks off the resolution chain.

This change is largely backwards compatible -- most users should
experience no change in behavior. For more, see
[BREAKING_CHANGES.md](https://togithub.com/charliermarsh/ruff/blob/main/BREAKING_CHANGES.md#select-extend-select-ignore-and-extend-ignore-have-new-semantics-2312).

##### `remove-six-compat` (`UP016`) has been removed
([#&#8203;2332](https://togithub.com/charliermarsh/ruff/pull/2332))

The `remove-six-compat` rule has been removed. This rule was only useful
for one-time Python 2-to-3 upgrades.

##### Rules

- Implement Pylint's `too-many-arguments` rule (`PLR0913`) by
[@&#8203;akhildevelops](https://togithub.com/akhildevelops) in
[astral-sh/ruff#2308
- Extend conventional imports defaults to include TensorFlow et al by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[astral-sh/ruff#2353

##### Settings

- feat: add ruff --statistics by
[@&#8203;spaceone](https://togithub.com/spaceone) in
[astral-sh/ruff#2284
- Ignore magic comparisons to bytes by default by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2365
- Implement `ruff linter` subcommand by
[@&#8203;not-my-profile](https://togithub.com/not-my-profile) in
[astral-sh/ruff#2294
- Improve rule config resolution by
[@&#8203;not-my-profile](https://togithub.com/not-my-profile) in
[astral-sh/ruff#2312

##### Bug Fixes

- Refine criteria for `exc_info` logger rules by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2364
- Respect per-file-ignores when checking noqa by
[@&#8203;sciyoshi](https://togithub.com/sciyoshi) in
[astral-sh/ruff#2309
- Place star before other member imports by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2320
- Allow list comprehensions for **all** assignment by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2326
- \[`TRY201`] don't check raise statements in nested exception handlers
by [@&#8203;sciyoshi](https://togithub.com/sciyoshi) in
[astral-sh/ruff#2337
- include tomllib in standard lib by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[astral-sh/ruff#2345
- Avoid removing trailing comments when autofixing by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2352
- \[`I001`] fix isort for files with tab-based indentation by
[@&#8203;sciyoshi](https://togithub.com/sciyoshi) in
[astral-sh/ruff#2361
- Disable incompatible rules rather than merely warning by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#2369

#### New Contributors

- [@&#8203;chirag127](https://togithub.com/chirag127) made their first
contribution in
[astral-sh/ruff#2307
- [@&#8203;akhildevelops](https://togithub.com/akhildevelops) made their
first contribution in
[astral-sh/ruff#2308

**Full Changelog**:
astral-sh/ruff@v0.0.237...v0.0.238

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/premiscale/premiscale).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNDMuMSIsInVwZGF0ZWRJblZlciI6IjM0LjE0My4xIn0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants