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

Add support for Union declarations without | to PYI016 #5598

Merged
merged 10 commits into from
Jul 10, 2023

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Jul 7, 2023

Previously, PYI016 only supported reporting violations for unions defined with |. Now, union declarations with typing.Union are supported.

This implementation reuses the union traversal logic from #5570.

PYI016 will not attempt to fix cases where Union is used. Unlike |, removing members from a Union can result in an invalid union definition. We may be able to support this in the future as in PYI030 the complexity seems high.

Tested with new snapshot cases ./target/debug/ruff --select PYI016 crates/ruff/resources/test/fixtures/flake8_pyi/PYI016.pyi --show-source

Comment on lines +46 to +50
# Shouldn't emit if in new parent type
field16: int | dict[int, str] # OK

# Shouldn't emit if not in a union parent
field17: dict[int, int] # OK
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've added some more edge cases that are not relevant for this pull request but are good to cover

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

PR Check Results

Ecosystem

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

bokeh (+3, -0)

+ src/bokeh/core/property/factors.py:51:56: PYI016 Duplicate union member `tuple[str, str]`
+ src/bokeh/core/property/factors.py:52:85: PYI016 Duplicate union member `tp.Sequence[tuple[str, str]]`
+ src/bokeh/plotting/contour.py:43:88: PYI016 Duplicate union member `ContourColor`

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

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
formatter/large/dataset.py                 1.01      9.5±0.03ms     4.3 MB/sec    1.00      9.4±0.03ms     4.3 MB/sec
formatter/numpy/ctypeslib.py               1.02      2.1±0.01ms     7.9 MB/sec    1.00      2.1±0.02ms     8.0 MB/sec
formatter/numpy/globals.py                 1.00    235.5±1.50µs    12.5 MB/sec    1.00    235.3±1.40µs    12.5 MB/sec
formatter/pydantic/types.py                1.03      4.7±0.03ms     5.5 MB/sec    1.00      4.5±0.01ms     5.6 MB/sec
linter/all-rules/large/dataset.py          1.03     16.9±0.10ms     2.4 MB/sec    1.00     16.3±0.11ms     2.5 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      4.2±0.01ms     4.0 MB/sec    1.00      4.1±0.02ms     4.1 MB/sec
linter/all-rules/numpy/globals.py          1.00    526.0±2.37µs     5.6 MB/sec    1.00    524.5±3.25µs     5.6 MB/sec
linter/all-rules/pydantic/types.py         1.02      7.4±0.03ms     3.5 MB/sec    1.00      7.3±0.03ms     3.5 MB/sec
linter/default-rules/large/dataset.py      1.08      8.8±0.04ms     4.6 MB/sec    1.00      8.1±0.02ms     5.0 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.05   1879.3±4.13µs     8.9 MB/sec    1.00  1792.9±48.92µs     9.3 MB/sec
linter/default-rules/numpy/globals.py      1.03    211.8±1.06µs    13.9 MB/sec    1.00    204.7±0.72µs    14.4 MB/sec
linter/default-rules/pydantic/types.py     1.07      3.9±0.02ms     6.5 MB/sec    1.00      3.7±0.01ms     7.0 MB/sec

Windows

group                                      main                                    pr
-----                                      ----                                    --
formatter/large/dataset.py                 1.00     11.1±0.43ms     3.7 MB/sec     1.00     11.2±0.43ms     3.6 MB/sec
formatter/numpy/ctypeslib.py               1.00      2.4±0.11ms     7.0 MB/sec     1.02      2.4±0.19ms     6.9 MB/sec
formatter/numpy/globals.py                 1.00   278.4±21.02µs    10.6 MB/sec     1.03   286.8±19.95µs    10.3 MB/sec
formatter/pydantic/types.py                1.04      5.4±0.28ms     4.7 MB/sec     1.00      5.2±0.25ms     4.9 MB/sec
linter/all-rules/large/dataset.py          1.00     17.6±0.88ms     2.3 MB/sec     1.07     18.9±0.53ms     2.2 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      4.9±0.36ms     3.4 MB/sec     1.00      4.9±0.15ms     3.4 MB/sec
linter/all-rules/numpy/globals.py          1.00   552.8±35.29µs     5.3 MB/sec     1.09   601.9±31.64µs     4.9 MB/sec
linter/all-rules/pydantic/types.py         1.00      7.8±0.31ms     3.3 MB/sec     1.09      8.5±0.40ms     3.0 MB/sec
linter/default-rules/large/dataset.py      1.00      8.9±0.54ms     4.6 MB/sec     1.10      9.7±0.34ms     4.2 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00  1993.0±115.12µs     8.4 MB/sec    1.02      2.0±0.08ms     8.2 MB/sec
linter/default-rules/numpy/globals.py      1.00    244.7±9.98µs    12.1 MB/sec     1.01   246.6±13.32µs    12.0 MB/sec
linter/default-rules/pydantic/types.py     1.00      4.3±0.18ms     6.0 MB/sec     1.03      4.4±0.24ms     5.8 MB/sec

@zanieb
Copy link
Member Author

zanieb commented Jul 7, 2023

@@ -2201,7 +2201,12 @@ where
}
Copy link
Member

@charliermarsh charliermarsh Jul 8, 2023

Choose a reason for hiding this comment

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

Nit: this part above can be rewritten with some optional chaining:

let check = self
    .semantic
    .expr_grandparent()
    .and_then(Expr::as_subscript_expr)
    .map_or(true, |parent| {
        !self.semantic.match_typing_expr(&parent.value, "Union")
    });

This is nice because you can avoid the mut, and all the logic is contained in one fluid expression. You could even inline this condition in the if and avoid creating check entirely.

Copy link
Member

Choose a reason for hiding this comment

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

Nit: I would prefer keeping the variable (I find such lengthy if's hard to read) but give it a name with more semantical meaning. Like, what are we testing here? is_union maybe?

This has the advantage that if there's a bug I have an easier time fixing it because:

  • if is_union is false when the expression is a union -> Okay, the bug must be with the expression initializing is_union. The same if is_union is true when it should not.
  • I don't need to spend time understanding this expression if the bug is with the diagnostic or fix generation but not identifying what a union is.

Copy link
Member Author

@zanieb zanieb Jul 10, 2023

Choose a reason for hiding this comment

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

is_union_but_grandparent_is_not :) I'm not sure what a good name would be yet. I'll think on it.

edit: maybe is_unchecked_union

// SAFETY: impossible to have a duplicate without a `parent` node.
let parent = parent.expect("Parent node must exist");
// If the parent node is not a `BinOp` we will not perform a fix
if let Expr::BinOp(ast::ExprBinOp { left, right, .. }) = parent {
Copy link
Member

@charliermarsh charliermarsh Jul 8, 2023

Choose a reason for hiding this comment

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

I think this could be written as if let Some(Expr::BinOp(...)) = parent to avoid the .expect above. (I think this code already existed, but we generally prefer safe over unsafe even if the condition is always expected to hold true -- it's debatable whether this is the right policy, here's a blog post that argues for the opposite: https://blog.burntsushi.net/unwrap/.)

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a little awkward actually we still need to have an .unwrap() when we call range() unless we want to write two if let statements? Perhaps I'm missing something. It is kind of nice to panic here because the traversal code is broken if this invariant does not hold but 🤷‍♀️ I can see both sides.

Copy link
Member Author

Choose a reason for hiding this comment

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

checker.diagnostics.push(diagnostic);
}
// Add all diagnostics to the checker
checker.diagnostics.append(&mut diagnostics);
Copy link
Member

Choose a reason for hiding this comment

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

(It'd be nice to append these directly as we go rather than allocate an intermediary vector, but it's not critical. I assume that lifetimes and borrowing got in the way per Discord.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I tried to do this a couple ways and it seems like a pain

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

This looks great! Love the additional test coverage too. Couple nits but nothing blocking.

@@ -2201,7 +2201,12 @@ where
}
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I would prefer keeping the variable (I find such lengthy if's hard to read) but give it a name with more semantical meaning. Like, what are we testing here? is_union maybe?

This has the advantage that if there's a bug I have an easier time fixing it because:

  • if is_union is false when the expression is a union -> Okay, the bug must be with the expression initializing is_union. The same if is_union is true when it should not.
  • I don't need to spend time understanding this expression if the bug is with the diagnostic or fix generation but not identifying what a union is.

range: _,
}) = expr
{
// The union data structure usually looks like this:
Copy link
Member

Choose a reason for hiding this comment

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

These comments are awesome. They make reviewing the code much easier and will certainly be useful when reading this code in the future.

Copy link
Member Author

Choose a reason for hiding this comment

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

These actually came from the previous contribution so I can't take credit :)

crates/ruff/src/rules/flake8_pyi/mod.rs Outdated Show resolved Hide resolved
@zanieb zanieb enabled auto-merge (squash) July 10, 2023 17:02
@zanieb zanieb merged commit d19839f into astral-sh:main Jul 10, 2023
renovate bot referenced this pull request in ixm-one/pytest-cmake-presets 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
[https://github.com/astral-sh/ruff/pull/5517](https://togithub.com/astral-sh/ruff/pull/5517)
- \[`flake8-pyi`] Implement `unnecessary-literal-union` (`PYI030`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[https://github.com/astral-sh/ruff/pull/5570](https://togithub.com/astral-sh/ruff/pull/5570)
- \[`pylint`] Implement `type-name-incorrect-variance` (`PLC0105`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[https://github.com/astral-sh/ruff/pull/5651](https://togithub.com/astral-sh/ruff/pull/5651)
- \[`ruff`] Implement `unnecessary-list-allocation-for-first-element`
(`RUF015`) by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[https://github.com/astral-sh/ruff/pull/5549](https://togithub.com/astral-sh/ruff/pull/5549)
- \[`flake8-bugbear`] Implement `re-sub-positional-args` (`B034`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5669](https://togithub.com/astral-sh/ruff/pull/5669)
- \[`ruff`] Implement `invalid-index-type` (`RUF016`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[https://github.com/astral-sh/ruff/pull/5602](https://togithub.com/astral-sh/ruff/pull/5602)

##### Settings

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

##### Bug Fixes

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

#### New Contributors

- [@&#8203;karosis88](https://togithub.com/karosis88) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5560](https://togithub.com/astral-sh/ruff/pull/5560)
- [@&#8203;petermattia](https://togithub.com/petermattia) made their
first contribution in
[https://github.com/astral-sh/ruff/pull/5579](https://togithub.com/astral-sh/ruff/pull/5579)
-
[@&#8203;DimitriPapadopoulos](https://togithub.com/DimitriPapadopoulos)
made their first contribution in
[https://github.com/astral-sh/ruff/pull/5607](https://togithub.com/astral-sh/ruff/pull/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 referenced this pull request in jankatins/pr-workflow-example 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
[https://github.com/astral-sh/ruff/pull/5517](https://togithub.com/astral-sh/ruff/pull/5517)
- \[`flake8-pyi`] Implement `unnecessary-literal-union` (`PYI030`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[https://github.com/astral-sh/ruff/pull/5570](https://togithub.com/astral-sh/ruff/pull/5570)
- \[`pylint`] Implement `type-name-incorrect-variance` (`PLC0105`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[https://github.com/astral-sh/ruff/pull/5651](https://togithub.com/astral-sh/ruff/pull/5651)
- \[`ruff`] Implement `unnecessary-list-allocation-for-first-element`
(`RUF015`) by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[https://github.com/astral-sh/ruff/pull/5549](https://togithub.com/astral-sh/ruff/pull/5549)
- \[`flake8-bugbear`] Implement `re-sub-positional-args` (`B034`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5669](https://togithub.com/astral-sh/ruff/pull/5669)
- \[`ruff`] Implement `invalid-index-type` (`RUF016`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[https://github.com/astral-sh/ruff/pull/5602](https://togithub.com/astral-sh/ruff/pull/5602)

##### Settings

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

##### Bug Fixes

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

#### New Contributors

- [@&#8203;karosis88](https://togithub.com/karosis88) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5560](https://togithub.com/astral-sh/ruff/pull/5560)
- [@&#8203;petermattia](https://togithub.com/petermattia) made their
first contribution in
[https://github.com/astral-sh/ruff/pull/5579](https://togithub.com/astral-sh/ruff/pull/5579)
-
[@&#8203;DimitriPapadopoulos](https://togithub.com/DimitriPapadopoulos)
made their first contribution in
[https://github.com/astral-sh/ruff/pull/5607](https://togithub.com/astral-sh/ruff/pull/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 referenced this pull request in allenporter/pyrainbird 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
[https://github.com/astral-sh/ruff/pull/5517](https://togithub.com/astral-sh/ruff/pull/5517)
- \[`flake8-pyi`] Implement `unnecessary-literal-union` (`PYI030`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[https://github.com/astral-sh/ruff/pull/5570](https://togithub.com/astral-sh/ruff/pull/5570)
- \[`pylint`] Implement `type-name-incorrect-variance` (`PLC0105`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[https://github.com/astral-sh/ruff/pull/5651](https://togithub.com/astral-sh/ruff/pull/5651)
- \[`ruff`] Implement `unnecessary-list-allocation-for-first-element`
(`RUF015`) by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[https://github.com/astral-sh/ruff/pull/5549](https://togithub.com/astral-sh/ruff/pull/5549)
- \[`flake8-bugbear`] Implement `re-sub-positional-args` (`B034`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5669](https://togithub.com/astral-sh/ruff/pull/5669)
- \[`ruff`] Implement `invalid-index-type` (`RUF016`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[https://github.com/astral-sh/ruff/pull/5602](https://togithub.com/astral-sh/ruff/pull/5602)

##### Settings

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

##### Bug Fixes

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

#### New Contributors

- [@&#8203;karosis88](https://togithub.com/karosis88) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5560](https://togithub.com/astral-sh/ruff/pull/5560)
- [@&#8203;petermattia](https://togithub.com/petermattia) made their
first contribution in
[https://github.com/astral-sh/ruff/pull/5579](https://togithub.com/astral-sh/ruff/pull/5579)
-
[@&#8203;DimitriPapadopoulos](https://togithub.com/DimitriPapadopoulos)
made their first contribution in
[https://github.com/astral-sh/ruff/pull/5607](https://togithub.com/astral-sh/ruff/pull/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 referenced this pull request in allenporter/flux-local 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
[https://github.com/astral-sh/ruff/pull/5517](https://togithub.com/astral-sh/ruff/pull/5517)
- \[`flake8-pyi`] Implement `unnecessary-literal-union` (`PYI030`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[https://github.com/astral-sh/ruff/pull/5570](https://togithub.com/astral-sh/ruff/pull/5570)
- \[`pylint`] Implement `type-name-incorrect-variance` (`PLC0105`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[https://github.com/astral-sh/ruff/pull/5651](https://togithub.com/astral-sh/ruff/pull/5651)
- \[`ruff`] Implement `unnecessary-list-allocation-for-first-element`
(`RUF015`) by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[https://github.com/astral-sh/ruff/pull/5549](https://togithub.com/astral-sh/ruff/pull/5549)
- \[`flake8-bugbear`] Implement `re-sub-positional-args` (`B034`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5669](https://togithub.com/astral-sh/ruff/pull/5669)
- \[`ruff`] Implement `invalid-index-type` (`RUF016`) by
[@&#8203;zanieb](https://togithub.com/zanieb) in
[https://github.com/astral-sh/ruff/pull/5602](https://togithub.com/astral-sh/ruff/pull/5602)

##### Settings

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

##### Bug Fixes

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

#### New Contributors

- [@&#8203;karosis88](https://togithub.com/karosis88) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5560](https://togithub.com/astral-sh/ruff/pull/5560)
- [@&#8203;petermattia](https://togithub.com/petermattia) made their
first contribution in
[https://github.com/astral-sh/ruff/pull/5579](https://togithub.com/astral-sh/ruff/pull/5579)
-
[@&#8203;DimitriPapadopoulos](https://togithub.com/DimitriPapadopoulos)
made their first contribution in
[https://github.com/astral-sh/ruff/pull/5607](https://togithub.com/astral-sh/ruff/pull/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
[https://github.com/astral-sh/ruff/pull/5513](https://togithub.com/astral-sh/ruff/pull/5513)

##### Rules

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

##### Settings

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

##### Bug Fixes

- Fix eval detection for suspicious-eval-usage by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5506](https://togithub.com/astral-sh/ruff/pull/5506)
- Avoid PERF rules for iteration-dependent assignments by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5508](https://togithub.com/astral-sh/ruff/pull/5508)
- Avoid returning first-match for rule prefixes by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5511](https://togithub.com/astral-sh/ruff/pull/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
[https://github.com/astral-sh/ruff/pull/5457](https://togithub.com/astral-sh/ruff/pull/5457)
- \[`numpy`] Implement `numpy-deprecated-function` (`NPY003`) by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5468](https://togithub.com/astral-sh/ruff/pull/5468)
- \[`perflint`] Implement `unnecessary-list-cast` (`PERF101`) by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[https://github.com/astral-sh/ruff/pull/5121](https://togithub.com/astral-sh/ruff/pull/5121)
- \[`perflint`] Implement `try-except-in-loop` (`PERF203`) by
[@&#8203;evanrittenhouse](https://togithub.com/evanrittenhouse) in
[https://github.com/astral-sh/ruff/pull/5166](https://togithub.com/astral-sh/ruff/pull/5166)
- \[`perflint`] Implement `manual-list-comprehension` (`PERF401`) and
`manual-list-copy` (`PERF402`) rules by
[@&#8203;qdegraaf](https://togithub.com/qdegraaf) in
[https://github.com/astral-sh/ruff/pull/5298](https://togithub.com/astral-sh/ruff/pull/5298)
- \[`pylint`] Implement Pylint `single-string-used-for-slots` (`C0205`)
as `single-string-slots` (`PLC0205`) by
[@&#8203;tjkuson](https://togithub.com/tjkuson) in
[https://github.com/astral-sh/ruff/pull/5399](https://togithub.com/astral-sh/ruff/pull/5399)

##### Jupyter

- Experimental release for Jupyter notebook integration by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5363](https://togithub.com/astral-sh/ruff/pull/5363)
- Enable --watch for Jupyter notebooks by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/astral-sh/ruff/pull/5394](https://togithub.com/astral-sh/ruff/pull/5394)
- Consider Jupyter index for code frames (`--show-source`) by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/astral-sh/ruff/pull/5402](https://togithub.com/astral-sh/ruff/pull/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
[https://github.com/astral-sh/ruff/pull/5414](https://togithub.com/astral-sh/ruff/pull/5414)

##### Settings

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

##### Bug Fixes

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

#### New Contributors

- [@&#8203;mayrholu](https://togithub.com/mayrholu) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/4903](https://togithub.com/astral-sh/ruff/pull/4903)
- [@&#8203;hauntsaninja](https://togithub.com/hauntsaninja) made their
first contribution in
[https://github.com/astral-sh/ruff/pull/5352](https://togithub.com/astral-sh/ruff/pull/5352)
- [@&#8203;ethunk](https://togithub.com/ethunk) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5397](https://togithub.com/astral-sh/ruff/pull/5397)
- [@&#8203;LouisDISPA](https://togithub.com/LouisDISPA) made their first
contribution in
[https://github.com/astral-sh/ruff/pull/5475](https://togithub.com/astral-sh/ruff/pull/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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants