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

Ignore directories when collecting files to lint #5775

Merged
merged 3 commits into from
Jul 18, 2023

Conversation

harupy
Copy link
Contributor

@harupy harupy commented Jul 15, 2023

Summary

Fixes #5739

Test Plan

Manually tested:

$ tree dir
dir
├── dir.py
│   └── file.py
└── file.py

1 directory, 2 files

$ cargo run -p ruff_cli -- check dir --no-cache
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `target/debug/ruff check dir --no-cache`
dir/dir.py/file.py:1:7: F821 Undefined name `a`
dir/file.py:1:7: F821 Undefined name `a`
Found 2 errors.

Is a unit test needed?

crates/ruff/src/resolver.rs Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Jul 15, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00      9.9±0.03ms     4.1 MB/sec    1.00      9.9±0.04ms     4.1 MB/sec
formatter/numpy/ctypeslib.py               1.01   1899.3±3.32µs     8.8 MB/sec    1.00   1881.3±2.85µs     8.9 MB/sec
formatter/numpy/globals.py                 1.00    206.3±0.70µs    14.3 MB/sec    1.01   208.9±29.13µs    14.1 MB/sec
formatter/pydantic/types.py                1.02      4.2±0.01ms     6.0 MB/sec    1.00      4.1±0.00ms     6.1 MB/sec
linter/all-rules/large/dataset.py          1.00     14.2±0.06ms     2.9 MB/sec    1.00     14.1±0.04ms     2.9 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      3.6±0.02ms     4.7 MB/sec    1.00      3.6±0.01ms     4.7 MB/sec
linter/all-rules/numpy/globals.py          1.01    381.7±2.96µs     7.7 MB/sec    1.00    378.7±1.24µs     7.8 MB/sec
linter/all-rules/pydantic/types.py         1.00      6.3±0.05ms     4.0 MB/sec    1.01      6.4±0.07ms     4.0 MB/sec
linter/default-rules/large/dataset.py      1.01      7.1±0.17ms     5.7 MB/sec    1.00      7.1±0.02ms     5.7 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00   1460.4±3.41µs    11.4 MB/sec    1.00   1455.6±2.31µs    11.4 MB/sec
linter/default-rules/numpy/globals.py      1.01    157.0±1.11µs    18.8 MB/sec    1.00    155.5±0.17µs    19.0 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.2±0.01ms     8.1 MB/sec    1.00      3.2±0.01ms     8.1 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00     11.2±0.06ms     3.6 MB/sec    1.00     11.2±0.42ms     3.6 MB/sec
formatter/numpy/ctypeslib.py               1.00      2.1±0.04ms     7.8 MB/sec    1.00      2.1±0.02ms     7.8 MB/sec
formatter/numpy/globals.py                 1.00    231.8±2.62µs    12.7 MB/sec    1.00    231.3±5.17µs    12.8 MB/sec
formatter/pydantic/types.py                1.01      4.8±0.05ms     5.4 MB/sec    1.00      4.7±0.03ms     5.4 MB/sec
linter/all-rules/large/dataset.py          1.00     15.7±0.08ms     2.6 MB/sec    1.00     15.7±0.08ms     2.6 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      4.1±0.03ms     4.0 MB/sec    1.00      4.1±0.06ms     4.0 MB/sec
linter/all-rules/numpy/globals.py          1.00    425.1±5.07µs     6.9 MB/sec    1.00    426.5±6.32µs     6.9 MB/sec
linter/all-rules/pydantic/types.py         1.00      7.1±0.03ms     3.6 MB/sec    1.00      7.1±0.09ms     3.6 MB/sec
linter/default-rules/large/dataset.py      1.00      8.0±0.01ms     5.1 MB/sec    1.01      8.1±0.05ms     5.0 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00   1643.3±9.74µs    10.1 MB/sec    1.01  1657.5±34.87µs    10.0 MB/sec
linter/default-rules/numpy/globals.py      1.01    180.4±1.67µs    16.4 MB/sec    1.00    179.2±2.03µs    16.5 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.6±0.05ms     7.0 MB/sec    1.00      3.6±0.01ms     7.1 MB/sec

@zanieb
Copy link
Member

zanieb commented Jul 15, 2023

Thanks for contributing @harupy!

Do you think you could write a unit test for this?

@charliermarsh
Copy link
Member

Unfortunately we don’t have any unit tests for the file discovery behavior right now, so we’d need to establish some new patterns.

We have some “manual” tests that are document expected behavior here: https://github.com/astral-sh/ruff/blob/main/crates/ruff/resources/test/project/README.md.

Alternatively we could add an integration test? Those can rely on the binary which would make the test itself easier to write (but the output harder to introspect).

I’m comfortable with any outcome including just doing some manual testing since it’s “no worse than before”.

@charliermarsh
Copy link
Member

(The logic looks correct to me.)

@harupy
Copy link
Contributor Author

harupy commented Jul 15, 2023

@charliermarsh Thanks for the comment! I'm trying to write a unit test. My local diff looks like this:

diff --git a/Cargo.lock b/Cargo.lock
index f3ce5f85e..428d00996 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1893,6 +1893,7 @@ dependencies = [
  "smallvec",
  "strum",
  "strum_macros",
+ "tempfile",
  "test-case",
  "thiserror",
  "toml",
diff --git a/crates/ruff/Cargo.toml b/crates/ruff/Cargo.toml
index b659730d8..8d22661c1 100644
--- a/crates/ruff/Cargo.toml
+++ b/crates/ruff/Cargo.toml
@@ -83,6 +83,7 @@ wsl = { version = "0.1.0" }
 [dev-dependencies]
 insta = { workspace = true }
 pretty_assertions = "1.3.0"
+tempfile = "3.6.0"
 test-case = { workspace = true }
 # Disable colored output in tests
 colored = { workspace = true, features = ["no-color"] }
diff --git a/crates/ruff/src/resolver.rs b/crates/ruff/src/resolver.rs
index ccbd7ecc3..3f3cc39c5 100644
--- a/crates/ruff/src/resolver.rs
+++ b/crates/ruff/src/resolver.rs
@@ -435,10 +435,12 @@ mod tests {
     use anyhow::Result;
     use globset::GlobSet;
     use path_absolutize::Absolutize;
+    use tempfile::TempDir;
+    use test_case::test_case;
 
     use crate::resolver::{
-        is_file_excluded, match_exclusion, resolve_settings_with_processor, NoOpProcessor,
-        PyprojectConfig, PyprojectDiscoveryStrategy, Relativity, Resolver,
+        is_file_excluded, match_exclusion, python_files_in_path, resolve_settings_with_processor,
+        NoOpProcessor, PyprojectConfig, PyprojectDiscoveryStrategy, Relativity, Resolver,
     };
     use crate::settings::pyproject::find_settings_toml;
     use crate::settings::types::FilePattern;
@@ -605,4 +607,37 @@ mod tests {
         ));
         Ok(())
     }
+
+    #[test_case("py")]
+    #[test_case("pyi")]
+    #[test_case("ipynb")]
+    fn python_files_in_path_excludes_directories_that_look_like_python_files(
+        ext: &str,
+    ) -> Result<()> {
+        let tmp_dir = TempDir::new().unwrap();
+        let tmp_dir = tmp_dir.path();
+        let file = tmp_dir.join(format!("file.{}", ext));
+        let dir = tmp_dir.join(format!("dir.{}", ext));
+        let another_dir = tmp_dir.join(format!("another_dir.{}", ext));
+        let another_file = dir.join(format!("another_file.{}", ext));
+        std::fs::create_dir(&dir).unwrap();
+        std::fs::create_dir(&another_dir).unwrap();
+        std::fs::File::create(&file).unwrap();
+        std::fs::File::create(&another_file).unwrap();
+        let files = python_files_in_path(
+            &[tmp_dir.to_path_buf()],
+            &PyprojectConfig::new(
+                PyprojectDiscoveryStrategy::Hierarchical,
+                Default::default(),
+                None,
+            ),
+            &NoOpProcessor,
+        )
+        .unwrap()
+        .0;
+        assert_eq!(files.len(), 2);
+        assert_eq!(files[0].as_ref().unwrap().path(), another_file);
+        assert_eq!(files[1].as_ref().unwrap().path(), file);
+        Ok(())
+    }
 }

@harupy
Copy link
Contributor Author

harupy commented Jul 15, 2023

@charliermarsh I manually ran the commands in https://github.com/astral-sh/ruff/blob/main/crates/ruff/resources/test/project/README.md. Here are the results.

> cargo run -p ruff_cli -- check crates/ruff/resources/test/project/
   Compiling ruff_python_semantic v0.0.0 (/home/haru/Desktop/repositories/ruff/crates/ruff_python_semantic)
   Compiling ruff_python_formatter v0.0.0 (/home/haru/Desktop/repositories/ruff/crates/ruff_python_formatter)
   Compiling ruff v0.0.278 (/home/haru/Desktop/repositories/ruff/crates/ruff)
   Compiling ruff_cli v0.0.278 (/home/haru/Desktop/repositories/ruff/crates/ruff_cli)
    Finished dev [unoptimized + debuginfo] target(s) in 11.34s
     Running `target/debug/ruff check crates/ruff/resources/test/project/`
warning: Detected debug build without --no-cache.
crates/ruff/resources/test/project/examples/.dotfiles/script.py:1:1: I001 [*] Import block is un-sorted or un-formatted
crates/ruff/resources/test/project/examples/.dotfiles/script.py:1:17: F401 [*] `numpy` imported but unused
crates/ruff/resources/test/project/examples/.dotfiles/script.py:2:17: F401 [*] `app.app_file` imported but unused
crates/ruff/resources/test/project/examples/docs/docs/file.py:1:1: I001 [*] Import block is un-sorted or un-formatted
crates/ruff/resources/test/project/examples/docs/docs/file.py:8:5: F841 [*] Local variable `x` is assigned to but never used
crates/ruff/resources/test/project/project/file.py:1:8: F401 [*] `os` imported but unused
crates/ruff/resources/test/project/project/import_file.py:1:1: I001 [*] Import block is un-sorted or un-formatted
Found 7 errors.
[*] 7 potentially fixable with the --fix option.
> (cd crates/ruff/resources/test/project/ && cargo run -p ruff_cli -- check .)
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `/home/haru/Desktop/repositories/ruff/target/debug/ruff check .`
warning: Detected debug build without --no-cache.
examples/.dotfiles/script.py:1:1: I001 [*] Import block is un-sorted or un-formatted
examples/.dotfiles/script.py:1:17: F401 [*] `numpy` imported but unused
examples/.dotfiles/script.py:2:17: F401 [*] `app.app_file` imported but unused
examples/docs/docs/file.py:1:1: I001 [*] Import block is un-sorted or un-formatted
examples/docs/docs/file.py:8:5: F841 [*] Local variable `x` is assigned to but never used
project/file.py:1:8: F401 [*] `os` imported but unused
project/import_file.py:1:1: I001 [*] Import block is un-sorted or un-formatted
Found 7 errors.
[*] 7 potentially fixable with the --fix option.
> (cd crates/ruff/resources/test/project/examples/docs && cargo run -p ruff_cli -- check .)
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `/home/haru/Desktop/repositories/ruff/target/debug/ruff check .`
warning: Detected debug build without --no-cache.
docs/file.py:1:1: I001 [*] Import block is un-sorted or un-formatted
docs/file.py:8:5: F841 [*] Local variable `x` is assigned to but never used
Found 2 errors.
[*] 2 potentially fixable with the --fix option.
> (cargo run -p ruff_cli -- check --config=crates/ruff/resources/test/project/pyproject.toml crates/ruff/resources/test/project/)
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `target/debug/ruff check --config=crates/ruff/resources/test/project/pyproject.toml crates/ruff/resources/test/project/`
warning: Detected debug build without --no-cache.
crates/ruff/resources/test/project/examples/.dotfiles/script.py:1:17: F401 [*] `numpy` imported but unused
crates/ruff/resources/test/project/examples/.dotfiles/script.py:2:17: F401 [*] `app.app_file` imported but unused
crates/ruff/resources/test/project/examples/docs/docs/concepts/file.py:1:8: F401 [*] `os` imported but unused
crates/ruff/resources/test/project/examples/docs/docs/file.py:1:1: I001 [*] Import block is un-sorted or un-formatted
crates/ruff/resources/test/project/examples/docs/docs/file.py:1:8: F401 [*] `os` imported but unused
crates/ruff/resources/test/project/examples/docs/docs/file.py:3:17: F401 [*] `numpy` imported but unused
crates/ruff/resources/test/project/examples/docs/docs/file.py:4:27: F401 [*] `docs.concepts.file` imported but unused
crates/ruff/resources/test/project/examples/excluded/script.py:1:8: F401 [*] `os` imported but unused
crates/ruff/resources/test/project/project/file.py:1:8: F401 [*] `os` imported but unused
Found 9 errors.
[*] 9 potentially fixable with the --fix option.
> (cd crates/ruff/resources/test/project/examples && cargo run -p ruff_cli -- check --config=docs/ruff.toml .)
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `/home/haru/Desktop/repositories/ruff/target/debug/ruff check --config=docs/ruff.toml .`
warning: Detected debug build without --no-cache.
docs/docs/concepts/file.py:5:5: F841 [*] Local variable `x` is assigned to but never used
docs/docs/file.py:1:1: I001 [*] Import block is un-sorted or un-formatted
docs/docs/file.py:8:5: F841 [*] Local variable `x` is assigned to but never used
excluded/script.py:5:5: F841 [*] Local variable `x` is assigned to but never used
Found 4 errors.
[*] 4 potentially fixable with the --fix option.
> cargo run -p ruff_cli -- check crates/ruff/resources/test/project/examples/excluded/
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `target/debug/ruff check crates/ruff/resources/test/project/examples/excluded/`
warning: Detected debug build without --no-cache.
crates/ruff/resources/test/project/examples/excluded/script.py:1:8: F401 [*] `os` imported but unused
Found 1 error.
[*] 1 potentially fixable with the --fix option.
> cargo run -p ruff_cli -- check crates/ruff/resources/test/project/examples/excluded/ --force-exclude
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `target/debug/ruff check crates/ruff/resources/test/project/examples/excluded/ --force-exclude`
warning: Detected debug build without --no-cache.
warning: No Python files found under the given path(s)
> cargo run -p ruff_cli -- check crates/ruff/resources/test/project/examples/excluded/ --force-exclude
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `target/debug/ruff check crates/ruff/resources/test/project/examples/excluded/ --force-exclude`
warning: Detected debug build without --no-cache.
warning: No Python files found under the given path(s)

@harupy harupy requested a review from zanieb July 16, 2023 00:58
@charliermarsh
Copy link
Member

I like where you're headed with that test, but I'd also be fine to add tests in a future PR for all of this behavior holistically rather than trying to figure out the right pattern for this bug fix. I defer to @zanieb as first reviewer :)

@harupy
Copy link
Contributor Author

harupy commented Jul 16, 2023

I'd also be fine to add tests in a future PR for all of this behavior holistically rather than trying to figure out the right pattern for this bug fix.

+1

@harupy
Copy link
Contributor Author

harupy commented Jul 18, 2023

@zanieb Can you take another look?

@zanieb zanieb mentioned this pull request Jul 18, 2023
1 task
Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

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

Thank you!

I confirmed this worked locally as well.
#5850 will track unit test patterns for file discovery. Feel free to add more functionality there that we should add test coverage for.

@zanieb zanieb merged commit a4e5e32 into astral-sh:main Jul 18, 2023
@harupy harupy deleted the exclude-folder-ending-with-py branch July 18, 2023 01:37
evanrittenhouse pushed a commit to evanrittenhouse/ruff that referenced this pull request Jul 19, 2023
<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

Fixes astral-sh#5739

## Test Plan

<!-- How was it tested? -->

Manually tested:

```sh
$ tree dir
dir
├── dir.py
│   └── file.py
└── file.py

1 directory, 2 files

$ cargo run -p ruff_cli -- check dir --no-cache
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `target/debug/ruff check dir --no-cache`
dir/dir.py/file.py:1:7: F821 Undefined name `a`
dir/file.py:1:7: F821 Undefined name `a`
Found 2 errors.
```

Is a unit test needed?
konstin pushed a commit that referenced this pull request Jul 19, 2023
<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

Fixes #5739

## Test Plan

<!-- How was it tested? -->

Manually tested:

```sh
$ tree dir
dir
├── dir.py
│   └── file.py
└── file.py

1 directory, 2 files

$ cargo run -p ruff_cli -- check dir --no-cache
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `target/debug/ruff check dir --no-cache`
dir/dir.py/file.py:1:7: F821 Undefined name `a`
dir/file.py:1:7: F821 Undefined name `a`
Found 2 errors.
```

Is a unit test needed?
jankatins referenced this pull request in jankatins/pr-workflow-example Jul 22, 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://beta.ruff.rs/docs)
([source](https://togithub.com/astral-sh/ruff),
[changelog](https://togithub.com/astral-sh/ruff/releases)) | `0.0.278`
-> `0.0.280` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/ruff/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/ruff/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/ruff/0.0.278/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/ruff/0.0.278/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>astral-sh/ruff (ruff)</summary>

###
[`v0.0.280`](https://togithub.com/astral-sh/ruff/compare/v0.0.279...v0.0.280)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.279...v0.0.280)

###
[`v0.0.279`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.279)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.278...v0.0.279)

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

#### What's Changed

##### Rules

- \[`flake8-pyi`] Implement flake8-pyi's PYI026 by
[@&#8203;LaBatata101](https://togithub.com/LaBatata101) in
[https://github.com/astral-sh/ruff/pull/5844](https://togithub.com/astral-sh/ruff/pull/5844)
- \[`flake8-pyi`] Implement flake8-pyi's `PYI017` by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[https://github.com/astral-sh/ruff/pull/5895](https://togithub.com/astral-sh/ruff/pull/5895)
- \[`flake8-pyi`] Implement flake8-pyi's `PYI036` by
[@&#8203;density](https://togithub.com/density) in
[https://github.com/astral-sh/ruff/pull/5668](https://togithub.com/astral-sh/ruff/pull/5668)
- \[`flake8-pyi`] Implement flake8-pyi's `PYI041` by
[@&#8203;density](https://togithub.com/density) in
[https://github.com/astral-sh/ruff/pull/5722](https://togithub.com/astral-sh/ruff/pull/5722)
- \[`flake8-use-pathlib`] Implement `os-path-getsize` and
`os-path-get(a|m|c)-time` (`PTH202-205`) by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5835](https://togithub.com/astral-sh/ruff/pull/5835)
- \[`flake8-use-pathlib`] Implement `path-constructor-default-argument`
(`PTH201`) by [@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5833](https://togithub.com/astral-sh/ruff/pull/5833)
- \[`pandas-vet`] Implement constant series rule (`PD101`) by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5802](https://togithub.com/astral-sh/ruff/pull/5802)
- \[`pylint`] Implement Pylint's `consider-using-in` (`PLR1714`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[https://github.com/astral-sh/ruff/pull/5193](https://togithub.com/astral-sh/ruff/pull/5193)

##### Rule changes

- \[`flake8-annotations`] Check for `Any` in other types for `ANN401` by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5601](https://togithub.com/astral-sh/ruff/pull/5601)
- \[`flake8-bugbear`] Add autofix for B004 by
[@&#8203;density](https://togithub.com/density) in
[https://github.com/astral-sh/ruff/pull/5788](https://togithub.com/astral-sh/ruff/pull/5788)
- \[`flake8-bugbear`] Remove `B904`'s lowercase exemption by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5751](https://togithub.com/astral-sh/ruff/pull/5751)
- \[`flake8-use-pathlib`] extend PTH118 with `os.sep` by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5935](https://togithub.com/astral-sh/ruff/pull/5935)
- \[`pyupgrade`] Expand scope of `quoted-annotation` rule (`UP037`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5766](https://togithub.com/astral-sh/ruff/pull/5766)
- \[`pyupgrade`] Extend PEP 604 rewrites to support some quoted
annotations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5725](https://togithub.com/astral-sh/ruff/pull/5725)
- \[`ruff`] Expand `RUF015` to include all expression types by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5767](https://togithub.com/astral-sh/ruff/pull/5767)

##### Bug Fixes

- Consider single element subscript expr for implicit optional by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5717](https://togithub.com/astral-sh/ruff/pull/5717)
- Ignore `Enum`-and-`str` subclasses for slots enforcement by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5749](https://togithub.com/astral-sh/ruff/pull/5749)
- Avoid removing raw strings in comparison fixes by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5755](https://togithub.com/astral-sh/ruff/pull/5755)
- Fix nested calls to `sorted` with differing arguments by
[@&#8203;density](https://togithub.com/density) in
[https://github.com/astral-sh/ruff/pull/5761](https://togithub.com/astral-sh/ruff/pull/5761)
- Use unused variable detection to power `incorrect-dict-iterator` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5763](https://togithub.com/astral-sh/ruff/pull/5763)
- Include alias when formatting import-from structs by
[@&#8203;guillaumeLepape](https://togithub.com/guillaumeLepape) in
[https://github.com/astral-sh/ruff/pull/5786](https://togithub.com/astral-sh/ruff/pull/5786)
- Make `lint_only` aware of the source kind by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5876](https://togithub.com/astral-sh/ruff/pull/5876)
- Restore `redefined-while-unused` violations in classes by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5926](https://togithub.com/astral-sh/ruff/pull/5926)
- Flatten nested tuples when fixing UP007 violations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5724](https://togithub.com/astral-sh/ruff/pull/5724)
- Ignore Jupyter Notebooks for `--add-noqa` by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5727](https://togithub.com/astral-sh/ruff/pull/5727)
- Avoid checking `EXE001` and `EXE002` on WSL by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[https://github.com/astral-sh/ruff/pull/5735](https://togithub.com/astral-sh/ruff/pull/5735)
- Properly group assignment targets by
[@&#8203;MichaReiser](https://togithub.com/MichaReiser) in
[https://github.com/astral-sh/ruff/pull/5728](https://togithub.com/astral-sh/ruff/pull/5728)
- Avoid stack overflow for non-BitOr binary types by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5743](https://togithub.com/astral-sh/ruff/pull/5743)
- Move function visit out of `Expr::Call` branches by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5772](https://togithub.com/astral-sh/ruff/pull/5772)
- \[B006] Add bytes to immutable types by
[@&#8203;harupy](https://togithub.com/harupy) in
[https://github.com/astral-sh/ruff/pull/5776](https://togithub.com/astral-sh/ruff/pull/5776)
- Format `SetComp` by [@&#8203;lkh42t](https://togithub.com/lkh42t) in
[https://github.com/astral-sh/ruff/pull/5774](https://togithub.com/astral-sh/ruff/pull/5774)
- Gate `runtime-import-in-type-checking-block` (`TCH004`) behind enabled
flag by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5789](https://togithub.com/astral-sh/ruff/pull/5789)
- perf: only compute start offset for overlong lines by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5811](https://togithub.com/astral-sh/ruff/pull/5811)
- Change `pandas-use-of-dot-read-table` rule to emit only when
`read_table` is used on CSV data by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[https://github.com/astral-sh/ruff/pull/5807](https://togithub.com/astral-sh/ruff/pull/5807)
- Do not fix `NamedTuple` calls containing both a list of fields and
keywords by [@&#8203;harupy](https://togithub.com/harupy) in
[https://github.com/astral-sh/ruff/pull/5799](https://togithub.com/astral-sh/ruff/pull/5799)
- Ignore directories when collecting files to lint by
[@&#8203;harupy](https://togithub.com/harupy) in
[https://github.com/astral-sh/ruff/pull/5775](https://togithub.com/astral-sh/ruff/pull/5775)
- Add filename to `noqa` warnings by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[https://github.com/astral-sh/ruff/pull/5856](https://togithub.com/astral-sh/ruff/pull/5856)
- Handle io errors gracefully by
[@&#8203;konstin](https://togithub.com/konstin) in
[https://github.com/astral-sh/ruff/pull/5611](https://togithub.com/astral-sh/ruff/pull/5611)
- Allow `respect_gitignore` when not in a git repo by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5937](https://togithub.com/astral-sh/ruff/pull/5937)

#### New Contributors

- [@&#8203;eggplants](https://togithub.com/eggplants) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5741](https://togithub.com/astral-sh/ruff/pull/5741)
- [@&#8203;guillaumeLepape](https://togithub.com/guillaumeLepape) made
their first contribution in
[https://github.com/astral-sh/ruff/pull/5786](https://togithub.com/astral-sh/ruff/pull/5786)
- [@&#8203;odiseo0](https://togithub.com/odiseo0) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5888](https://togithub.com/astral-sh/ruff/pull/5888)
- [@&#8203;DavidCain](https://togithub.com/DavidCain) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5889](https://togithub.com/astral-sh/ruff/pull/5889)
- [@&#8203;LaBatata101](https://togithub.com/LaBatata101) made their
first contribution in
[https://github.com/astral-sh/ruff/pull/5844](https://togithub.com/astral-sh/ruff/pull/5844)

**Full Changelog**:
astral-sh/ruff@v0.0.278...v0.0.279

</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://developer.mend.io/github/jankatins/pr-workflow-example).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMTEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
renovate bot referenced this pull request in allenporter/pyrainbird Jul 23, 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://beta.ruff.rs/docs)
([source](https://togithub.com/astral-sh/ruff),
[changelog](https://togithub.com/astral-sh/ruff/releases)) | `==0.0.278`
-> `==0.0.280` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/ruff/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/ruff/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/ruff/0.0.278/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/ruff/0.0.278/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>astral-sh/ruff (ruff)</summary>

###
[`v0.0.280`](https://togithub.com/astral-sh/ruff/compare/v0.0.279...v0.0.280)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.279...v0.0.280)

###
[`v0.0.279`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.279)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.278...v0.0.279)

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

#### What's Changed

##### Rules

- \[`flake8-pyi`] Implement flake8-pyi's PYI026 by
[@&#8203;LaBatata101](https://togithub.com/LaBatata101) in
[https://github.com/astral-sh/ruff/pull/5844](https://togithub.com/astral-sh/ruff/pull/5844)
- \[`flake8-pyi`] Implement flake8-pyi's `PYI017` by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[https://github.com/astral-sh/ruff/pull/5895](https://togithub.com/astral-sh/ruff/pull/5895)
- \[`flake8-pyi`] Implement flake8-pyi's `PYI036` by
[@&#8203;density](https://togithub.com/density) in
[https://github.com/astral-sh/ruff/pull/5668](https://togithub.com/astral-sh/ruff/pull/5668)
- \[`flake8-pyi`] Implement flake8-pyi's `PYI041` by
[@&#8203;density](https://togithub.com/density) in
[https://github.com/astral-sh/ruff/pull/5722](https://togithub.com/astral-sh/ruff/pull/5722)
- \[`flake8-use-pathlib`] Implement `os-path-getsize` and
`os-path-get(a|m|c)-time` (`PTH202-205`) by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5835](https://togithub.com/astral-sh/ruff/pull/5835)
- \[`flake8-use-pathlib`] Implement `path-constructor-default-argument`
(`PTH201`) by [@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5833](https://togithub.com/astral-sh/ruff/pull/5833)
- \[`pandas-vet`] Implement constant series rule (`PD101`) by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5802](https://togithub.com/astral-sh/ruff/pull/5802)
- \[`pylint`] Implement Pylint's `consider-using-in` (`PLR1714`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[https://github.com/astral-sh/ruff/pull/5193](https://togithub.com/astral-sh/ruff/pull/5193)

##### Rule changes

- \[`flake8-annotations`] Check for `Any` in other types for `ANN401` by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5601](https://togithub.com/astral-sh/ruff/pull/5601)
- \[`flake8-bugbear`] Add autofix for B004 by
[@&#8203;density](https://togithub.com/density) in
[https://github.com/astral-sh/ruff/pull/5788](https://togithub.com/astral-sh/ruff/pull/5788)
- \[`flake8-bugbear`] Remove `B904`'s lowercase exemption by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5751](https://togithub.com/astral-sh/ruff/pull/5751)
- \[`flake8-use-pathlib`] extend PTH118 with `os.sep` by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5935](https://togithub.com/astral-sh/ruff/pull/5935)
- \[`pyupgrade`] Expand scope of `quoted-annotation` rule (`UP037`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5766](https://togithub.com/astral-sh/ruff/pull/5766)
- \[`pyupgrade`] Extend PEP 604 rewrites to support some quoted
annotations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5725](https://togithub.com/astral-sh/ruff/pull/5725)
- \[`ruff`] Expand `RUF015` to include all expression types by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5767](https://togithub.com/astral-sh/ruff/pull/5767)

##### Bug Fixes

- Consider single element subscript expr for implicit optional by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5717](https://togithub.com/astral-sh/ruff/pull/5717)
- Ignore `Enum`-and-`str` subclasses for slots enforcement by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5749](https://togithub.com/astral-sh/ruff/pull/5749)
- Avoid removing raw strings in comparison fixes by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5755](https://togithub.com/astral-sh/ruff/pull/5755)
- Fix nested calls to `sorted` with differing arguments by
[@&#8203;density](https://togithub.com/density) in
[https://github.com/astral-sh/ruff/pull/5761](https://togithub.com/astral-sh/ruff/pull/5761)
- Use unused variable detection to power `incorrect-dict-iterator` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5763](https://togithub.com/astral-sh/ruff/pull/5763)
- Include alias when formatting import-from structs by
[@&#8203;guillaumeLepape](https://togithub.com/guillaumeLepape) in
[https://github.com/astral-sh/ruff/pull/5786](https://togithub.com/astral-sh/ruff/pull/5786)
- Make `lint_only` aware of the source kind by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5876](https://togithub.com/astral-sh/ruff/pull/5876)
- Restore `redefined-while-unused` violations in classes by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5926](https://togithub.com/astral-sh/ruff/pull/5926)
- Flatten nested tuples when fixing UP007 violations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5724](https://togithub.com/astral-sh/ruff/pull/5724)
- Ignore Jupyter Notebooks for `--add-noqa` by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5727](https://togithub.com/astral-sh/ruff/pull/5727)
- Avoid checking `EXE001` and `EXE002` on WSL by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[https://github.com/astral-sh/ruff/pull/5735](https://togithub.com/astral-sh/ruff/pull/5735)
- Properly group assignment targets by
[@&#8203;MichaReiser](https://togithub.com/MichaReiser) in
[https://github.com/astral-sh/ruff/pull/5728](https://togithub.com/astral-sh/ruff/pull/5728)
- Avoid stack overflow for non-BitOr binary types by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5743](https://togithub.com/astral-sh/ruff/pull/5743)
- Move function visit out of `Expr::Call` branches by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5772](https://togithub.com/astral-sh/ruff/pull/5772)
- \[B006] Add bytes to immutable types by
[@&#8203;harupy](https://togithub.com/harupy) in
[https://github.com/astral-sh/ruff/pull/5776](https://togithub.com/astral-sh/ruff/pull/5776)
- Format `SetComp` by [@&#8203;lkh42t](https://togithub.com/lkh42t) in
[https://github.com/astral-sh/ruff/pull/5774](https://togithub.com/astral-sh/ruff/pull/5774)
- Gate `runtime-import-in-type-checking-block` (`TCH004`) behind enabled
flag by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5789](https://togithub.com/astral-sh/ruff/pull/5789)
- perf: only compute start offset for overlong lines by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5811](https://togithub.com/astral-sh/ruff/pull/5811)
- Change `pandas-use-of-dot-read-table` rule to emit only when
`read_table` is used on CSV data by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[https://github.com/astral-sh/ruff/pull/5807](https://togithub.com/astral-sh/ruff/pull/5807)
- Do not fix `NamedTuple` calls containing both a list of fields and
keywords by [@&#8203;harupy](https://togithub.com/harupy) in
[https://github.com/astral-sh/ruff/pull/5799](https://togithub.com/astral-sh/ruff/pull/5799)
- Ignore directories when collecting files to lint by
[@&#8203;harupy](https://togithub.com/harupy) in
[https://github.com/astral-sh/ruff/pull/5775](https://togithub.com/astral-sh/ruff/pull/5775)
- Add filename to `noqa` warnings by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[https://github.com/astral-sh/ruff/pull/5856](https://togithub.com/astral-sh/ruff/pull/5856)
- Handle io errors gracefully by
[@&#8203;konstin](https://togithub.com/konstin) in
[https://github.com/astral-sh/ruff/pull/5611](https://togithub.com/astral-sh/ruff/pull/5611)
- Allow `respect_gitignore` when not in a git repo by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5937](https://togithub.com/astral-sh/ruff/pull/5937)

#### New Contributors

- [@&#8203;eggplants](https://togithub.com/eggplants) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5741](https://togithub.com/astral-sh/ruff/pull/5741)
- [@&#8203;guillaumeLepape](https://togithub.com/guillaumeLepape) made
their first contribution in
[https://github.com/astral-sh/ruff/pull/5786](https://togithub.com/astral-sh/ruff/pull/5786)
- [@&#8203;odiseo0](https://togithub.com/odiseo0) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5888](https://togithub.com/astral-sh/ruff/pull/5888)
- [@&#8203;DavidCain](https://togithub.com/DavidCain) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5889](https://togithub.com/astral-sh/ruff/pull/5889)
- [@&#8203;LaBatata101](https://togithub.com/LaBatata101) made their
first contribution in
[https://github.com/astral-sh/ruff/pull/5844](https://togithub.com/astral-sh/ruff/pull/5844)

**Full Changelog**:
astral-sh/ruff@v0.0.278...v0.0.279

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

♻ **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://developer.mend.io/github/allenporter/pyrainbird).

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

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot referenced this pull request in allenporter/flux-local Jul 24, 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://beta.ruff.rs/docs)
([source](https://togithub.com/astral-sh/ruff),
[changelog](https://togithub.com/astral-sh/ruff/releases)) | `==0.0.278`
-> `==0.0.280` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/ruff/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/ruff/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/ruff/0.0.278/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/ruff/0.0.278/0.0.280?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>astral-sh/ruff (ruff)</summary>

###
[`v0.0.280`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.280)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.279...v0.0.280)

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

#### What's Changed

##### Bug Fixes

- Avoid collapsing `elif` and `else` branches during import sorting by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5964](https://togithub.com/astral-sh/ruff/pull/5964)

**Full Changelog**:
astral-sh/ruff@v0.0.279...v0.0.280

###
[`v0.0.279`](https://togithub.com/astral-sh/ruff/releases/tag/v0.0.279)

[Compare
Source](https://togithub.com/astral-sh/ruff/compare/v0.0.278...v0.0.279)

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

#### What's Changed

##### Rules

- \[`flake8-pyi`] Implement flake8-pyi's PYI026 by
[@&#8203;LaBatata101](https://togithub.com/LaBatata101) in
[https://github.com/astral-sh/ruff/pull/5844](https://togithub.com/astral-sh/ruff/pull/5844)
- \[`flake8-pyi`] Implement flake8-pyi's `PYI017` by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[https://github.com/astral-sh/ruff/pull/5895](https://togithub.com/astral-sh/ruff/pull/5895)
- \[`flake8-pyi`] Implement flake8-pyi's `PYI036` by
[@&#8203;density](https://togithub.com/density) in
[https://github.com/astral-sh/ruff/pull/5668](https://togithub.com/astral-sh/ruff/pull/5668)
- \[`flake8-pyi`] Implement flake8-pyi's `PYI041` by
[@&#8203;density](https://togithub.com/density) in
[https://github.com/astral-sh/ruff/pull/5722](https://togithub.com/astral-sh/ruff/pull/5722)
- \[`flake8-use-pathlib`] Implement `os-path-getsize` and
`os-path-get(a|m|c)-time` (`PTH202-205`) by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5835](https://togithub.com/astral-sh/ruff/pull/5835)
- \[`flake8-use-pathlib`] Implement `path-constructor-default-argument`
(`PTH201`) by [@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5833](https://togithub.com/astral-sh/ruff/pull/5833)
- \[`pandas-vet`] Implement constant series rule (`PD101`) by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5802](https://togithub.com/astral-sh/ruff/pull/5802)
- \[`pylint`] Implement Pylint's `consider-using-in` (`PLR1714`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[https://github.com/astral-sh/ruff/pull/5193](https://togithub.com/astral-sh/ruff/pull/5193)

##### Rule changes

- \[`flake8-annotations`] Check for `Any` in other types for `ANN401` by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5601](https://togithub.com/astral-sh/ruff/pull/5601)
- \[`flake8-bugbear`] Add autofix for B004 by
[@&#8203;density](https://togithub.com/density) in
[https://github.com/astral-sh/ruff/pull/5788](https://togithub.com/astral-sh/ruff/pull/5788)
- \[`flake8-bugbear`] Remove `B904`'s lowercase exemption by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5751](https://togithub.com/astral-sh/ruff/pull/5751)
- \[`flake8-use-pathlib`] extend PTH118 with `os.sep` by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5935](https://togithub.com/astral-sh/ruff/pull/5935)
- \[`pyupgrade`] Expand scope of `quoted-annotation` rule (`UP037`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5766](https://togithub.com/astral-sh/ruff/pull/5766)
- \[`pyupgrade`] Extend PEP 604 rewrites to support some quoted
annotations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5725](https://togithub.com/astral-sh/ruff/pull/5725)
- \[`ruff`] Expand `RUF015` to include all expression types by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5767](https://togithub.com/astral-sh/ruff/pull/5767)

##### Bug Fixes

- Consider single element subscript expr for implicit optional by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5717](https://togithub.com/astral-sh/ruff/pull/5717)
- Ignore `Enum`-and-`str` subclasses for slots enforcement by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5749](https://togithub.com/astral-sh/ruff/pull/5749)
- Avoid removing raw strings in comparison fixes by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5755](https://togithub.com/astral-sh/ruff/pull/5755)
- Fix nested calls to `sorted` with differing arguments by
[@&#8203;density](https://togithub.com/density) in
[https://github.com/astral-sh/ruff/pull/5761](https://togithub.com/astral-sh/ruff/pull/5761)
- Use unused variable detection to power `incorrect-dict-iterator` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5763](https://togithub.com/astral-sh/ruff/pull/5763)
- Include alias when formatting import-from structs by
[@&#8203;guillaumeLepape](https://togithub.com/guillaumeLepape) in
[https://github.com/astral-sh/ruff/pull/5786](https://togithub.com/astral-sh/ruff/pull/5786)
- Make `lint_only` aware of the source kind by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5876](https://togithub.com/astral-sh/ruff/pull/5876)
- Restore `redefined-while-unused` violations in classes by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5926](https://togithub.com/astral-sh/ruff/pull/5926)
- Flatten nested tuples when fixing UP007 violations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5724](https://togithub.com/astral-sh/ruff/pull/5724)
- Ignore Jupyter Notebooks for `--add-noqa` by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5727](https://togithub.com/astral-sh/ruff/pull/5727)
- Avoid checking `EXE001` and `EXE002` on WSL by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[https://github.com/astral-sh/ruff/pull/5735](https://togithub.com/astral-sh/ruff/pull/5735)
- Properly group assignment targets by
[@&#8203;MichaReiser](https://togithub.com/MichaReiser) in
[https://github.com/astral-sh/ruff/pull/5728](https://togithub.com/astral-sh/ruff/pull/5728)
- Avoid stack overflow for non-BitOr binary types by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5743](https://togithub.com/astral-sh/ruff/pull/5743)
- Move function visit out of `Expr::Call` branches by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5772](https://togithub.com/astral-sh/ruff/pull/5772)
- \[B006] Add bytes to immutable types by
[@&#8203;harupy](https://togithub.com/harupy) in
[https://github.com/astral-sh/ruff/pull/5776](https://togithub.com/astral-sh/ruff/pull/5776)
- Format `SetComp` by [@&#8203;lkh42t](https://togithub.com/lkh42t) in
[https://github.com/astral-sh/ruff/pull/5774](https://togithub.com/astral-sh/ruff/pull/5774)
- Gate `runtime-import-in-type-checking-block` (`TCH004`) behind enabled
flag by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5789](https://togithub.com/astral-sh/ruff/pull/5789)
- perf: only compute start offset for overlong lines by
[@&#8203;sbrugman](https://togithub.com/sbrugman) in
[https://github.com/astral-sh/ruff/pull/5811](https://togithub.com/astral-sh/ruff/pull/5811)
- Change `pandas-use-of-dot-read-table` rule to emit only when
`read_table` is used on CSV data by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[https://github.com/astral-sh/ruff/pull/5807](https://togithub.com/astral-sh/ruff/pull/5807)
- Do not fix `NamedTuple` calls containing both a list of fields and
keywords by [@&#8203;harupy](https://togithub.com/harupy) in
[https://github.com/astral-sh/ruff/pull/5799](https://togithub.com/astral-sh/ruff/pull/5799)
- Ignore directories when collecting files to lint by
[@&#8203;harupy](https://togithub.com/harupy) in
[https://github.com/astral-sh/ruff/pull/5775](https://togithub.com/astral-sh/ruff/pull/5775)
- Add filename to `noqa` warnings by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[https://github.com/astral-sh/ruff/pull/5856](https://togithub.com/astral-sh/ruff/pull/5856)
- Handle io errors gracefully by
[@&#8203;konstin](https://togithub.com/konstin) in
[https://github.com/astral-sh/ruff/pull/5611](https://togithub.com/astral-sh/ruff/pull/5611)
- Allow `respect_gitignore` when not in a git repo by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5937](https://togithub.com/astral-sh/ruff/pull/5937)

#### New Contributors

- [@&#8203;eggplants](https://togithub.com/eggplants) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5741](https://togithub.com/astral-sh/ruff/pull/5741)
- [@&#8203;guillaumeLepape](https://togithub.com/guillaumeLepape) made
their first contribution in
[https://github.com/astral-sh/ruff/pull/5786](https://togithub.com/astral-sh/ruff/pull/5786)
- [@&#8203;odiseo0](https://togithub.com/odiseo0) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5888](https://togithub.com/astral-sh/ruff/pull/5888)
- [@&#8203;DavidCain](https://togithub.com/DavidCain) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5889](https://togithub.com/astral-sh/ruff/pull/5889)
- [@&#8203;LaBatata101](https://togithub.com/LaBatata101) made their
first contribution in
[https://github.com/astral-sh/ruff/pull/5844](https://togithub.com/astral-sh/ruff/pull/5844)

**Full Changelog**:
astral-sh/ruff@v0.0.278...v0.0.279

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

♻ **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://developer.mend.io/github/allenporter/flux-local).

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

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

Ruff fails when a directory ends with .py
3 participants