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

Implement PYI030: Unnecessary literal union #5570

Merged
merged 16 commits into from
Jul 7, 2023
Merged

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Jul 6, 2023

Implements PYI030 as part of #848

Union expressions should never have more than one Literal member, as Literal[1] | Literal[2] is semantically identical to Literal[1, 2].

Note we differ slightly from the flake8-pyi implementation:

  • We detect cases where there are parentheses or nested unions
  • We detect cases with mixed Union and | syntax
  • We use the same error message for all violations; flake8-pyi has two different messages
  • We retain the user's quoting style when displaying string literals; flake8-pyi uses single quotes
  • We warn on duplicates of the same literal Literal[1] | Literal[1]
    • flake8-pyi does not warn on this because it overlaps with PYI016; we can avoid a violation here if we want but then we'll need to track the hashes of all seen literals alongside the vector of literal expressions which I would prefer to keep ordered
❯ flake8 --select Y030 crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:9:9: Y030 Multiple Literal members in a union. Use a single Literal, e.g. "Literal[1, 2]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:12:17: Y030 Multiple Literal members in a union. Use a single Literal, e.g. "Literal[1, 2]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:17:16: Y030 Multiple Literal members in a union. Use a single Literal, e.g. "Literal[1, 2]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:22:9: Y030 Multiple Literal members in a union. Combine them into one, e.g. "Literal[1, 2]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:23:9: Y030 Multiple Literal members in a union. Combine them into one, e.g. "Literal[1, 2]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:24:9: Y030 Multiple Literal members in a union. Combine them into one, e.g. "Literal[1, 2]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:25:9: Y030 Multiple Literal members in a union. Combine them into one, e.g. "Literal[1, 2]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:28:10: Y030 Multiple Literal members in a union. Use a single Literal, e.g. "Literal[1, 2]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:35:11: Y030 Multiple Literal members in a union. Combine them into one, e.g. "Literal[1, 2]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:38:15: Y030 Multiple Literal members in a union. Use a single Literal, e.g. "Literal[1, 2]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:41:10: Y030 Multiple Literal members in a union. Use a single Literal, e.g. "Literal[1, 2, 3]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:42:10: Y030 Multiple Literal members in a union. Use a single Literal, e.g. "Literal[1, 2, 3, 4]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:45:10: Y030 Multiple Literal members in a union. Combine them into one, e.g. "Literal[1, 2, 3]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:48:10: Y030 Multiple Literal members in a union. Use a single Literal, e.g. "Literal[1, 'foo', True]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:60:10: Y030 Multiple Literal members in a union. Use a single Literal, e.g. "Literal[1, 2]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:64:5: Y030 Multiple Literal members in a union. Use a single Literal, e.g. "Literal[1, 2]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:71:10: Y030 Multiple Literal members in a union. Use a single Literal, e.g. "Literal[1, 2, 3, 4]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:74:23: Y030 Multiple Literal members in a union. Use a single Literal, e.g. "Literal[1, 2]".
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:77:10: Y030 Multiple Literal members in a union. Use a single Literal, e.g. "Literal[1, 2]".
(19 errors)
❯ ./target/debug/ruff --select PYI030 crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:9:9: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:12:17: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:17:16: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:22:9: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:23:9: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:24:9: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:25:9: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:28:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:31:9: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:34:9: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:35:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:38:15: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:41:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2, 3]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:42:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2, 3, 4]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:45:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2, 3]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:48:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, "foo", True]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:51:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 1]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:60:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:63:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:71:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2, 3, 4]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:74:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:77:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:80:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi:83:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 2]`
Found 24 errors.

@zanieb zanieb changed the title Implement PYI0303: Unnecessary literal union Implement PYI030: Unnecessary literal union Jul 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2023

PR Check Results

Ecosystem

ℹ️ ecosystem check detected changes. (+3, -0, 0 error(s))

airflow (+2, -0)

+ airflow/cli/commands/task_command.py:72:21: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[False, "db", "memory"]`
+ airflow/models/mappedoperator.py:80:20: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal["expand", "partial"]`

bokeh (+1, -0)

+ src/bokeh/core/serialization.py:148:25: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal["bool", "object"]`

Rules changed: 1
Rule Changes Additions Removals
PYI030 3 3 0

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.01      9.1±0.37ms     4.5 MB/sec    1.00      9.0±0.45ms     4.5 MB/sec
formatter/numpy/ctypeslib.py               1.00  1960.9±78.37µs     8.5 MB/sec    1.02  1996.2±111.16µs     8.3 MB/sec
formatter/numpy/globals.py                 1.00   228.9±15.92µs    12.9 MB/sec    1.02   232.9±20.43µs    12.7 MB/sec
formatter/pydantic/types.py                1.00      4.3±0.22ms     5.9 MB/sec    1.02      4.4±0.25ms     5.8 MB/sec
linter/all-rules/large/dataset.py          1.02     15.9±0.55ms     2.6 MB/sec    1.00     15.6±0.50ms     2.6 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.03      4.0±0.26ms     4.2 MB/sec    1.00      3.9±0.20ms     4.3 MB/sec
linter/all-rules/numpy/globals.py          1.01   507.1±34.80µs     5.8 MB/sec    1.00   500.2±27.49µs     5.9 MB/sec
linter/all-rules/pydantic/types.py         1.03      7.0±0.34ms     3.6 MB/sec    1.00      6.8±0.28ms     3.8 MB/sec
linter/default-rules/large/dataset.py      1.00      7.6±0.28ms     5.4 MB/sec    1.00      7.6±0.23ms     5.4 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00  1619.5±67.59µs    10.3 MB/sec    1.02  1645.2±78.43µs    10.1 MB/sec
linter/default-rules/numpy/globals.py      1.00   193.8±12.17µs    15.2 MB/sec    1.03   200.3±14.57µs    14.7 MB/sec
linter/default-rules/pydantic/types.py     1.00      3.4±0.14ms     7.5 MB/sec    1.04      3.5±0.18ms     7.2 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.00     11.9±0.38ms     3.4 MB/sec    1.00     11.9±0.48ms     3.4 MB/sec
formatter/numpy/ctypeslib.py               1.00      2.6±0.12ms     6.4 MB/sec    1.01      2.6±0.10ms     6.4 MB/sec
formatter/numpy/globals.py                 1.00   293.6±19.61µs    10.1 MB/sec    1.01   296.5±18.84µs    10.0 MB/sec
formatter/pydantic/types.py                1.00      5.5±0.26ms     4.6 MB/sec    1.04      5.8±0.28ms     4.4 MB/sec
linter/all-rules/large/dataset.py          1.01     20.5±0.66ms  2031.6 KB/sec    1.00     20.2±0.55ms     2.0 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      5.4±0.29ms     3.1 MB/sec    1.00      5.3±0.18ms     3.1 MB/sec
linter/all-rules/numpy/globals.py          1.00   654.2±44.01µs     4.5 MB/sec    1.01   663.5±36.00µs     4.4 MB/sec
linter/all-rules/pydantic/types.py         1.03      9.2±0.39ms     2.8 MB/sec    1.00      8.9±0.31ms     2.9 MB/sec
linter/default-rules/large/dataset.py      1.01     10.4±0.50ms     3.9 MB/sec    1.00     10.3±0.30ms     3.9 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00      2.2±0.11ms     7.6 MB/sec    1.03      2.3±0.09ms     7.4 MB/sec
linter/default-rules/numpy/globals.py      1.00   253.7±17.24µs    11.6 MB/sec    1.03   261.8±15.93µs    11.3 MB/sec
linter/default-rules/pydantic/types.py     1.00      4.5±0.21ms     5.6 MB/sec    1.02      4.6±0.17ms     5.5 MB/sec

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.

Looking good!

}

/// Traverse a "union" type annotation, calling `func` on each expression in the union.
fn traverse_union<'a, F>(func: &mut F, expr: &'a Expr, semantic: &SemanticModel)
Copy link
Member Author

Choose a reason for hiding this comment

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

In a follow-up, we can probably use this in PYI016 (#3922) and fix support for typing.Union there

Comment on lines +148 to +154
PYI030.pyi:51:10: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[1, 1]`
|
50 | # Shouldn't emit for duplicate field types with same value; covered by Y016
51 | field16: Literal[1] | Literal[1] # OK
| ^^^^^^^^^^^^^^^^^^^^^^^ PYI030
52 |
53 | # Shouldn't emit if in new parent type
Copy link
Member Author

Choose a reason for hiding this comment

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

We should probably avoid emitting this but I'm hesitant to add a hash map alongside the vector used to display items in the correct order.

@zanieb zanieb marked this pull request as ready for review July 6, 2023 22:22
@@ -3136,6 +3150,7 @@ where
if self.is_stub {
if self.enabled(Rule::DuplicateUnionMember)
&& self.semantic.in_type_definition()
Copy link
Member

Choose a reason for hiding this comment

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

We may want to add these (&& self.semantic.in_type_definition()) to the Rule::UnnecessaryLiteralUnion condition too. I can't quite remember why they're necessary here. I'm guessing it's because for |, if it's used outside of a type definition, it's not a union operator (it's a bitwise or, I think).

Copy link
Member Author

Choose a reason for hiding this comment

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

That's true for the DuplicateUnionMember rule where they're checking for any duplicate items in a | but here we know we are constrained to literal types where this does apply.

We test for this at

https://github.com/charliermarsh/ruff/blob/1759d914456b62dfc479518ce8717949935f6c87/crates/ruff/resources/test/fixtures/flake8_pyi/PYI030.pyi#L28

You can see that a bitwise or of literals resolve to a Union outside of an annotation:

In [3]: Literal[1] | Literal[2]
Out[3]: typing.Union[typing.Literal[1], typing.Literal[2]]

In [4]: x = Literal[1] | Literal[2]

In [5]: x
Out[5]: typing.Union[typing.Literal[1], typing.Literal[2]]

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 guess it's possible that someone has Literal[1] | bar | Literal[2] where bar implements some sort of custom bitwise or behavior and this rule no longer holds but I'm not sure that's worth handling

Copy link
Member

Choose a reason for hiding this comment

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

Interesting, that makes sense. Thanks for the thorough follow-up!

@zanieb
Copy link
Member Author

zanieb commented Jul 6, 2023

Note we could implement auto-fix for this but it seems painful given the enumerated edge-cases in the test file. We can pursue it at a later time if requested.

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.

LGTM! Couple small comments, address at your discretion.

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Jul 6, 2023
crates/ruff/src/checkers/ast/mod.rs Outdated Show resolved Hide resolved
crates/ruff/src/checkers/ast/mod.rs Outdated Show resolved Hide resolved
@zanieb zanieb enabled auto-merge (squash) July 7, 2023 16:32
@zanieb zanieb merged commit bb7303f into astral-sh:main Jul 7, 2023
15 checks passed
renovate bot added a commit to ixm-one/pytest-cmake-presets that referenced this pull request Jul 12, 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.277`
-> `^0.0.278` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/compatibility-slim/0.0.277)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/confidence-slim/0.0.277)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

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

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

#### What's Changed

##### Rules

- \[`pylint`] Implement `typevar-bivariance` (`PLC0131`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5517
- \[`flake8-pyi`] Implement `unnecessary-literal-union` (`PYI030`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[astral-sh/ruff#5570
- \[`pylint`] Implement `type-name-incorrect-variance` (`PLC0105`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5651
- \[`ruff`] Implement `unnecessary-list-allocation-for-first-element`
(`RUF015`) by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[astral-sh/ruff#5549
- \[`flake8-bugbear`] Implement `re-sub-positional-args` (`B034`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5669
- \[`ruff`] Implement `invalid-index-type` (`RUF016`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[astral-sh/ruff#5602

##### Settings

- \[`isort`] Add `--case-sensitive` flag by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#5539
- \[`isort`] Support globbing in `isort` options by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5473

##### Bug Fixes

- Support autofix for some multiline `str.format` calls by
[@&#8203;harupy](https://togithub.com/harupy) in
[astral-sh/ruff#5638
- Avoid triggering `unnecessary-map` (`C417`) for late-bound lambdas by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5520
- Avoid triggering DTZ001-006 when using `.astimezone()` by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5524
- Enable attribute lookups via semantic model by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5536
- Avoid syntax errors when rewriting str(dict) in f-strings by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5538
- Differentiate between runtime and typing-time annotations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5575
- Only run pyproject.toml lint rules when enabled by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5578
- Refactor isort directive skips to use iterators by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5623
- Allow descriptor instantiations in dataclass fields by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5537
- Refactor `noqa` directive parsing away from regex-based implementation
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5554
- Emit warnings for invalid `# noqa` directives by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5571
- Support individual codes on `# flake8: noqa` directives by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5618
- Add `tkinter` import convention by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5626
- Avoid `PERF401` if conditional depends on list var by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5603
- Fix typo in complex-if-statement-in-stub message by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5635
- Make TRY301 trigger only if a `raise` throws a caught exception by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[astral-sh/ruff#5455
- Skip flake8-future-annotations checks in stub files by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5652
- Always allow PEP 585 and PEP 604 rewrites in stub files by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5653
- Add support for `Union` declarations without `|` to PYI016 by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[astral-sh/ruff#5598
- Ignore `_name_` and `_value_` accesses in `flake8-self` rules by
[@&#8203;monosans](https://togithub.com/monosans) in
[astral-sh/ruff#5663
- Refactor `repeated_keys()` to use `ComparableExpr` by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#5696

#### New Contributors

- [@&#8203;karosis88](https://togithub.com/karosis88) made their first
contribution in
[astral-sh/ruff#5560
- [@&#8203;petermattia](https://togithub.com/petermattia) made their
first contribution in
[astral-sh/ruff#5579
-
[@&#8203;DimitriPapadopoulos](https://togithub.com/DimitriPapadopoulos)
made their first contribution in
[astral-sh/ruff#5607

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

</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://developer.mend.io/github/ixm-one/pytest-cmake-presets).

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

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
jankatins added a commit to jankatins/pr-workflow-example that referenced this pull request Jul 12, 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.277`
-> `0.0.278` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/compatibility-slim/0.0.277)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/confidence-slim/0.0.277)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

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

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

#### What's Changed

##### Rules

- \[`pylint`] Implement `typevar-bivariance` (`PLC0131`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5517
- \[`flake8-pyi`] Implement `unnecessary-literal-union` (`PYI030`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[astral-sh/ruff#5570
- \[`pylint`] Implement `type-name-incorrect-variance` (`PLC0105`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5651
- \[`ruff`] Implement `unnecessary-list-allocation-for-first-element`
(`RUF015`) by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[astral-sh/ruff#5549
- \[`flake8-bugbear`] Implement `re-sub-positional-args` (`B034`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5669
- \[`ruff`] Implement `invalid-index-type` (`RUF016`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[astral-sh/ruff#5602

##### Settings

- \[`isort`] Add `--case-sensitive` flag by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#5539
- \[`isort`] Support globbing in `isort` options by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5473

##### Bug Fixes

- Support autofix for some multiline `str.format` calls by
[@&#8203;harupy](https://togithub.com/harupy) in
[astral-sh/ruff#5638
- Avoid triggering `unnecessary-map` (`C417`) for late-bound lambdas by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5520
- Avoid triggering DTZ001-006 when using `.astimezone()` by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5524
- Enable attribute lookups via semantic model by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5536
- Avoid syntax errors when rewriting str(dict) in f-strings by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5538
- Differentiate between runtime and typing-time annotations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5575
- Only run pyproject.toml lint rules when enabled by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5578
- Refactor isort directive skips to use iterators by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5623
- Allow descriptor instantiations in dataclass fields by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5537
- Refactor `noqa` directive parsing away from regex-based implementation
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5554
- Emit warnings for invalid `# noqa` directives by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5571
- Support individual codes on `# flake8: noqa` directives by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5618
- Add `tkinter` import convention by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5626
- Avoid `PERF401` if conditional depends on list var by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5603
- Fix typo in complex-if-statement-in-stub message by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5635
- Make TRY301 trigger only if a `raise` throws a caught exception by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[astral-sh/ruff#5455
- Skip flake8-future-annotations checks in stub files by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5652
- Always allow PEP 585 and PEP 604 rewrites in stub files by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5653
- Add support for `Union` declarations without `|` to PYI016 by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[astral-sh/ruff#5598
- Ignore `_name_` and `_value_` accesses in `flake8-self` rules by
[@&#8203;monosans](https://togithub.com/monosans) in
[astral-sh/ruff#5663
- Refactor `repeated_keys()` to use `ComparableExpr` by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#5696

#### New Contributors

- [@&#8203;karosis88](https://togithub.com/karosis88) made their first
contribution in
[astral-sh/ruff#5560
- [@&#8203;petermattia](https://togithub.com/petermattia) made their
first contribution in
[astral-sh/ruff#5579
-
[@&#8203;DimitriPapadopoulos](https://togithub.com/DimitriPapadopoulos)
made their first contribution in
[astral-sh/ruff#5607

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

</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:eyJjcmVhdGVkSW5WZXIiOiIzNi41LjMiLCJ1cGRhdGVkSW5WZXIiOiIzNi41LjMiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->
renovate bot added a commit to allenporter/pyrainbird that referenced this pull request Jul 14, 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.277`
-> `==0.0.278` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/compatibility-slim/0.0.277)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/confidence-slim/0.0.277)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

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

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

See the [release blog post](https://astral.sh/blog/ruff-v0.0.278) for
more, including detailed descriptions of any newly added rules.

#### What's Changed

##### Rules

- \[`pylint`] Implement `typevar-bivariance` (`PLC0131`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5517
- \[`flake8-pyi`] Implement `unnecessary-literal-union` (`PYI030`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[astral-sh/ruff#5570
- \[`pylint`] Implement `type-name-incorrect-variance` (`PLC0105`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5651
- \[`ruff`] Implement `unnecessary-list-allocation-for-first-element`
(`RUF015`) by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[astral-sh/ruff#5549
- \[`flake8-bugbear`] Implement `re-sub-positional-args` (`B034`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5669
- \[`ruff`] Implement `invalid-index-type` (`RUF016`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[astral-sh/ruff#5602

##### Settings

- \[`isort`] Add `--case-sensitive` flag by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#5539
- \[`isort`] Support globbing in `isort` options by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5473

##### Bug Fixes

- Support autofix for some multiline `str.format` calls by
[@&#8203;harupy](https://togithub.com/harupy) in
[astral-sh/ruff#5638
- Avoid triggering `unnecessary-map` (`C417`) for late-bound lambdas by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5520
- Avoid triggering DTZ001-006 when using `.astimezone()` by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5524
- Enable attribute lookups via semantic model by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5536
- Avoid syntax errors when rewriting str(dict) in f-strings by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5538
- Differentiate between runtime and typing-time annotations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5575
- Only run pyproject.toml lint rules when enabled by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5578
- Refactor isort directive skips to use iterators by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5623
- Allow descriptor instantiations in dataclass fields by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5537
- Refactor `noqa` directive parsing away from regex-based implementation
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5554
- Emit warnings for invalid `# noqa` directives by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5571
- Support individual codes on `# flake8: noqa` directives by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5618
- Add `tkinter` import convention by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5626
- Avoid `PERF401` if conditional depends on list var by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5603
- Fix typo in complex-if-statement-in-stub message by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5635
- Make TRY301 trigger only if a `raise` throws a caught exception by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[astral-sh/ruff#5455
- Skip flake8-future-annotations checks in stub files by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5652
- Always allow PEP 585 and PEP 604 rewrites in stub files by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5653
- Add support for `Union` declarations without `|` to PYI016 by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[astral-sh/ruff#5598
- Ignore `_name_` and `_value_` accesses in `flake8-self` rules by
[@&#8203;monosans](https://togithub.com/monosans) in
[astral-sh/ruff#5663
- Refactor `repeated_keys()` to use `ComparableExpr` by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#5696

#### New Contributors

- [@&#8203;karosis88](https://togithub.com/karosis88) made their first
contribution in
[astral-sh/ruff#5560
- [@&#8203;petermattia](https://togithub.com/petermattia) made their
first contribution in
[astral-sh/ruff#5579
-
[@&#8203;DimitriPapadopoulos](https://togithub.com/DimitriPapadopoulos)
made their first contribution in
[astral-sh/ruff#5607

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

</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:eyJjcmVhdGVkSW5WZXIiOiIzNi41LjMiLCJ1cGRhdGVkSW5WZXIiOiIzNi41LjMiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot added a commit to allenporter/flux-local that referenced this pull request Jul 15, 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.275`
-> `==0.0.278` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/compatibility-slim/0.0.275)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.278/confidence-slim/0.0.275)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

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

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

See the [release blog post](https://astral.sh/blog/ruff-v0.0.278) for
more, including detailed descriptions of any newly added rules.

#### What's Changed

##### Rules

- \[`pylint`] Implement `typevar-bivariance` (`PLC0131`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5517
- \[`flake8-pyi`] Implement `unnecessary-literal-union` (`PYI030`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[astral-sh/ruff#5570
- \[`pylint`] Implement `type-name-incorrect-variance` (`PLC0105`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5651
- \[`ruff`] Implement `unnecessary-list-allocation-for-first-element`
(`RUF015`) by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[astral-sh/ruff#5549
- \[`flake8-bugbear`] Implement `re-sub-positional-args` (`B034`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5669
- \[`ruff`] Implement `invalid-index-type` (`RUF016`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[astral-sh/ruff#5602

##### Settings

- \[`isort`] Add `--case-sensitive` flag by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#5539
- \[`isort`] Support globbing in `isort` options by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5473

##### Bug Fixes

- Support autofix for some multiline `str.format` calls by
[@&#8203;harupy](https://togithub.com/harupy) in
[astral-sh/ruff#5638
- Avoid triggering `unnecessary-map` (`C417`) for late-bound lambdas by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5520
- Avoid triggering DTZ001-006 when using `.astimezone()` by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5524
- Enable attribute lookups via semantic model by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5536
- Avoid syntax errors when rewriting str(dict) in f-strings by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5538
- Differentiate between runtime and typing-time annotations by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5575
- Only run pyproject.toml lint rules when enabled by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5578
- Refactor isort directive skips to use iterators by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5623
- Allow descriptor instantiations in dataclass fields by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5537
- Refactor `noqa` directive parsing away from regex-based implementation
by [@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5554
- Emit warnings for invalid `# noqa` directives by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5571
- Support individual codes on `# flake8: noqa` directives by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5618
- Add `tkinter` import convention by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5626
- Avoid `PERF401` if conditional depends on list var by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5603
- Fix typo in complex-if-statement-in-stub message by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5635
- Make TRY301 trigger only if a `raise` throws a caught exception by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[astral-sh/ruff#5455
- Skip flake8-future-annotations checks in stub files by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5652
- Always allow PEP 585 and PEP 604 rewrites in stub files by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5653
- Add support for `Union` declarations without `|` to PYI016 by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[astral-sh/ruff#5598
- Ignore `_name_` and `_value_` accesses in `flake8-self` rules by
[@&#8203;monosans](https://togithub.com/monosans) in
[astral-sh/ruff#5663
- Refactor `repeated_keys()` to use `ComparableExpr` by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#5696

#### New Contributors

- [@&#8203;karosis88](https://togithub.com/karosis88) made their first
contribution in
[astral-sh/ruff#5560
- [@&#8203;petermattia](https://togithub.com/petermattia) made their
first contribution in
[astral-sh/ruff#5579
-
[@&#8203;DimitriPapadopoulos](https://togithub.com/DimitriPapadopoulos)
made their first contribution in
[astral-sh/ruff#5607

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

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

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

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

#### What's Changed

##### Breaking Changes

- Add .ipynb_checkpoints, .pyenv, .pytest_cache, and .vscode to default
excludes by [@&#8203;charliermarsh](https://togithub.com/charliermarsh)
in
[astral-sh/ruff#5513

##### Rules

- \[`pylint`] Implement Pylint `typevar-name-mismatch` (`C0132`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5501

##### Settings

- Add `ruff rule --all` subcommand (with JSON output) by
[@&#8203;akx](https://togithub.com/akx) in
[astral-sh/ruff#5059

##### Bug Fixes

- Fix eval detection for suspicious-eval-usage by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5506
- Avoid PERF rules for iteration-dependent assignments by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5508
- Avoid returning first-match for rule prefixes by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5511

**Full Changelog**:
astral-sh/ruff@v0.0.276...v0.0.277

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

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

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

See the [release blog post](https://astral.sh/blog/ruff-v0.0.276) for
more, including detailed descriptions of any newly added rules.

#### What's Changed

Highlights include: experimental support for linting Jupyter Notebooks.

To opt-in to linting Jupyter Notebook files, add the `*.ipynb` pattern
to your [`include`](settings.md#include)
setting, like so:

```toml
[tool.ruff]

### Allow Ruff to discover `*.ipynb` files.
include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
```

This will prompt Ruff to discover Jupyter Notebook files in any
specified directories, and lint them
accordingly.

Jupyter Notebook support is currently opt-in and experimental. We'd love
your help testing it out.
Have feedback? Run into issues? [Let us
know!](https://togithub.com/astral-sh/ruff/issues/new)

##### New Rules

- \[`flake8-pyi`] Implement `PYI002`, `PYI003`, `PYI004`, `PYI005` by
[@&#8203;density](https://togithub.com/density) in
[astral-sh/ruff#5457
- \[`numpy`] Implement `numpy-deprecated-function` (`NPY003`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5468
- \[`perflint`] Implement `unnecessary-list-cast` (`PERF101`) by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#5121
- \[`perflint`] Implement `try-except-in-loop` (`PERF203`) by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[astral-sh/ruff#5166
- \[`perflint`] Implement `manual-list-comprehension` (`PERF401`) and
`manual-list-copy` (`PERF402`) rules by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[astral-sh/ruff#5298
- \[`pylint`] Implement Pylint `single-string-used-for-slots` (`C0205`)
as `single-string-slots` (`PLC0205`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[astral-sh/ruff#5399

##### Jupyter

- Experimental release for Jupyter notebook integration by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5363
- Enable --watch for Jupyter notebooks by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5394
- Consider Jupyter index for code frames (`--show-source`) by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5402
- fixup! Consider Jupyter index for code frames (`--show-source`)
([#&#8203;5402](https://togithub.com/astral-sh/ruff/issues/5402)) by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5414

##### Settings

- \[`pyupgrade`] Restore the `keep-runtime-typing` setting by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5470
- Add `PythonVersion::Py312` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5316

##### Bug Fixes

- Support `pydantic.BaseSettings` in `mutable-class-default` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5312
- Allow `__slots__` assignments in `mutable-class-default` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5314
- Avoid syntax errors when removing f-string prefixes by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5319
- Ignore unpacking in `iteration-over-set` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5392
- Replace same length equal line with dash line in D407 by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5383
- Exclude docstrings from PYI053 by
[@&#8203;intgr](https://togithub.com/intgr) in
[astral-sh/ruff#5405
- Use "manual" fixability for E731 in shadowed context by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5430
- Detect consecutive, non-newline-delimited NumPy sections by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5467
- Fix `unnecessary-encode-utf8` to fix `encode` on parenthesized strings
correctly by [@&#8203;harupy](https://togithub.com/harupy) in
[astral-sh/ruff#5478
- Allow `Final` assignments in stubs by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5490
- Respect `abc` decorators when classifying function types by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5315
- Allow `@Author` format for "Missing Author" rule in `flake8-todos` by
[@&#8203;mayrholu](https://togithub.com/mayrholu) in
[astral-sh/ruff#4903
- Ignore type aliases for RUF013 by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[astral-sh/ruff#5344
- Change W605 autofix to use raw strings if possible by
[@&#8203;hauntsaninja](https://togithub.com/hauntsaninja) in
[astral-sh/ruff#5352
- Add space when migrating to raw string by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5358
- Update the `invalid-escape-sequence` rule by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5359
- Include BaseException in B017 rule by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5466
- \[`flake8-django`] Skip duplicate violations in `DJ012` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[astral-sh/ruff#5469

#### New Contributors

- [@&#8203;mayrholu](https://togithub.com/mayrholu) made their first
contribution in
[astral-sh/ruff#4903
- [@&#8203;hauntsaninja](https://togithub.com/hauntsaninja) made their
first contribution in
[astral-sh/ruff#5352
- [@&#8203;ethunk](https://togithub.com/ethunk) made their first
contribution in
[astral-sh/ruff#5397
- [@&#8203;LouisDISPA](https://togithub.com/LouisDISPA) made their first
contribution in
[astral-sh/ruff#5475

**Full Changelog**:
astral-sh/ruff@v0.0.275...v0.0.276

</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:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNTkuNyIsInVwZGF0ZWRJblZlciI6IjM2LjUuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

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
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants