Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[flake8-simplify] Implement dict-get-with-none-default (SIM910) #3874

Merged
merged 3 commits into from
Apr 4, 2023

Conversation

kyoto7250
Copy link
Contributor

close #3546

This PR implements SIM910 of flake8-simplify.

ref:

MartinThoma/flake8-simplify#173

@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.01     17.2±0.07ms     2.4 MB/sec    1.00     17.1±0.06ms     2.4 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      4.3±0.02ms     3.9 MB/sec    1.00      4.3±0.09ms     3.9 MB/sec
linter/all-rules/numpy/globals.py          1.00    541.5±2.33µs     5.4 MB/sec    1.00    541.7±1.34µs     5.4 MB/sec
linter/all-rules/pydantic/types.py         1.00      7.2±0.02ms     3.5 MB/sec    1.00      7.2±0.02ms     3.5 MB/sec
linter/default-rules/large/dataset.py      1.00      8.8±0.02ms     4.6 MB/sec    1.00      8.7±0.02ms     4.7 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.01   1976.7±7.42µs     8.4 MB/sec    1.00   1957.8±5.72µs     8.5 MB/sec
linter/default-rules/numpy/globals.py      1.01    218.1±0.41µs    13.5 MB/sec    1.00    216.3±2.08µs    13.6 MB/sec
linter/default-rules/pydantic/types.py     1.01      4.0±0.01ms     6.3 MB/sec    1.00      4.0±0.01ms     6.3 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.00     18.8±0.68ms     2.2 MB/sec    1.01     19.0±0.57ms     2.1 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      4.8±0.18ms     3.5 MB/sec    1.01      4.8±0.24ms     3.4 MB/sec
linter/all-rules/numpy/globals.py          1.00   568.4±23.82µs     5.2 MB/sec    1.03   586.1±32.44µs     5.0 MB/sec
linter/all-rules/pydantic/types.py         1.00      7.9±0.33ms     3.2 MB/sec    1.03      8.1±0.26ms     3.1 MB/sec
linter/default-rules/large/dataset.py      1.00      9.7±0.24ms     4.2 MB/sec    1.01      9.9±0.27ms     4.1 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.01      2.1±0.11ms     7.8 MB/sec    1.00      2.1±0.07ms     7.8 MB/sec
linter/default-rules/numpy/globals.py      1.00   229.5±12.55µs    12.9 MB/sec    1.00   228.7±11.81µs    12.9 MB/sec
linter/default-rules/pydantic/types.py     1.03      4.5±0.16ms     5.6 MB/sec    1.00      4.4±0.16ms     5.8 MB/sec

@charliermarsh charliermarsh changed the title impl SIM910 [flake8-simplify] Implement dict-get-with-none-default (SIM910) Apr 4, 2023
@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Apr 4, 2023
@charliermarsh charliermarsh enabled auto-merge (squash) April 4, 2023 03:47
@charliermarsh charliermarsh merged commit 46bcb1f into astral-sh:main Apr 4, 2023
bruxisma referenced this pull request in ixm-one/pytest-cmake-presets Apr 5, 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://github.com/charliermarsh/ruff) | `^0.0.260` ->
`^0.0.261` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.261/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.261/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.261/compatibility-slim/0.0.260)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.261/confidence-slim/0.0.260)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

[Compare
Source](https://github.com/charliermarsh/ruff/compare/v0.0.260...v0.0.261)

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

#### What's Changed

##### Rules

- \[`flake8-simplify`] Ignore `collapsible-if` violations for `if
False:` and `if True:` by
[@&#8203;JonathanPlasse](https://github.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/3732](https://github.com/charliermarsh/ruff/pull/3732)
- \[`flake8-pie`] Extend `unncessary-generator-any-all` to set
comprehensions by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3824](https://github.com/charliermarsh/ruff/pull/3824)
- \[`flake8-simplify`] Implement `dict-get-with-none-default` (`SIM910`)
by [@&#8203;kyoto7250](https://github.com/kyoto7250) in
[https://github.com/charliermarsh/ruff/pull/3874](https://github.com/charliermarsh/ruff/pull/3874)
- \[`flake8-annotations`] Additional simple magic return types by
[@&#8203;dhruvmanila](https://github.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/3805](https://github.com/charliermarsh/ruff/pull/3805)
- \[`flake8-pyi`]: fix PYI015 false positive on assignment of TypeVar &
friends by [@&#8203;bluetech](https://github.com/bluetech) in
[https://github.com/charliermarsh/ruff/pull/3861](https://github.com/charliermarsh/ruff/pull/3861)

##### Bug Fixes

- Improve robustness of argument removal for `encode` calls by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3802](https://github.com/charliermarsh/ruff/pull/3802)
- Fix SIM222 and SIM223 false positive by
[@&#8203;JonathanPlasse](https://github.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/3832](https://github.com/charliermarsh/ruff/pull/3832)
- When checking module visibility, don't check entire ancestry by
[@&#8203;Hnasar](https://github.com/Hnasar) in
[https://github.com/charliermarsh/ruff/pull/3835](https://github.com/charliermarsh/ruff/pull/3835)
- Improve top-of-file insertions for required imports by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3779](https://github.com/charliermarsh/ruff/pull/3779)
- Use multi-fix semantics for `inplace` removal by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3804](https://github.com/charliermarsh/ruff/pull/3804)
- Flag non-`Name` expressions in `duplicate-isinstance-call` by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3817](https://github.com/charliermarsh/ruff/pull/3817)
- Avoid `unnecessary-comprehension-any-all` for async generators by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3823](https://github.com/charliermarsh/ruff/pull/3823)
- Fix `is_module_name()` and improve perf of `is_identifier()` by
[@&#8203;JonathanPlasse](https://github.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/3795](https://github.com/charliermarsh/ruff/pull/3795)
- Allow starred arguments in B030 by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3871](https://github.com/charliermarsh/ruff/pull/3871)
- Support mutually exclusive branches for `B031` by
[@&#8203;dhruvmanila](https://github.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/3844](https://github.com/charliermarsh/ruff/pull/3844)
- Consider logger candidate from `logging` module only by
[@&#8203;dhruvmanila](https://github.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/3878](https://github.com/charliermarsh/ruff/pull/3878)

##### Core

- Add import insertion support to autofix capabilities by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3787](https://github.com/charliermarsh/ruff/pull/3787)
- Generate `ImportMap` from module path to imported dependencies by
[@&#8203;chanman3388](https://github.com/chanman3388) in
[https://github.com/charliermarsh/ruff/pull/3243](https://github.com/charliermarsh/ruff/pull/3243)

##### Docs

- Add documentation for `ruff-action` (GitHub Action!) by
[@&#8203;brucearctor](https://github.com/brucearctor) in
[https://github.com/charliermarsh/ruff/pull/3857](https://github.com/charliermarsh/ruff/pull/3857)

#### New Contributors

- [@&#8203;AetherUnbound](https://github.com/AetherUnbound) made their
first contribution in
[https://github.com/charliermarsh/ruff/pull/3806](https://github.com/charliermarsh/ruff/pull/3806)
- [@&#8203;Hnasar](https://github.com/Hnasar) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/3835](https://github.com/charliermarsh/ruff/pull/3835)
- [@&#8203;nvuillam](https://github.com/nvuillam) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/3848](https://github.com/charliermarsh/ruff/pull/3848)
- [@&#8203;brucearctor](https://github.com/brucearctor) made their
first contribution in
[https://github.com/charliermarsh/ruff/pull/3857](https://github.com/charliermarsh/ruff/pull/3857)

**Full Changelog**:
astral-sh/ruff@v0.0.260...v0.0.261

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

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

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

---

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

---

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

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4zMi4yIiwidXBkYXRlZEluVmVyIjoiMzUuMzIuMiJ9-->

Signed-off-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot referenced this pull request in allenporter/pyrainbird Apr 7, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

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

---

### Release Notes

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

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

[Compare
Source](https://github.com/charliermarsh/ruff/compare/v0.0.260...v0.0.261)

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

#### What's Changed

##### Rules

- \[`flake8-simplify`] Ignore `collapsible-if` violations for `if
False:` and `if True:` by
[@&#8203;JonathanPlasse](https://github.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/3732](https://github.com/charliermarsh/ruff/pull/3732)
- \[`flake8-pie`] Extend `unncessary-generator-any-all` to set
comprehensions by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3824](https://github.com/charliermarsh/ruff/pull/3824)
- \[`flake8-simplify`] Implement `dict-get-with-none-default` (`SIM910`)
by [@&#8203;kyoto7250](https://github.com/kyoto7250) in
[https://github.com/charliermarsh/ruff/pull/3874](https://github.com/charliermarsh/ruff/pull/3874)
- \[`flake8-annotations`] Additional simple magic return types by
[@&#8203;dhruvmanila](https://github.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/3805](https://github.com/charliermarsh/ruff/pull/3805)
- \[`flake8-pyi`]: fix PYI015 false positive on assignment of TypeVar &
friends by [@&#8203;bluetech](https://github.com/bluetech) in
[https://github.com/charliermarsh/ruff/pull/3861](https://github.com/charliermarsh/ruff/pull/3861)

##### Bug Fixes

- Improve robustness of argument removal for `encode` calls by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3802](https://github.com/charliermarsh/ruff/pull/3802)
- Fix SIM222 and SIM223 false positive by
[@&#8203;JonathanPlasse](https://github.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/3832](https://github.com/charliermarsh/ruff/pull/3832)
- When checking module visibility, don't check entire ancestry by
[@&#8203;Hnasar](https://github.com/Hnasar) in
[https://github.com/charliermarsh/ruff/pull/3835](https://github.com/charliermarsh/ruff/pull/3835)
- Improve top-of-file insertions for required imports by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3779](https://github.com/charliermarsh/ruff/pull/3779)
- Use multi-fix semantics for `inplace` removal by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3804](https://github.com/charliermarsh/ruff/pull/3804)
- Flag non-`Name` expressions in `duplicate-isinstance-call` by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3817](https://github.com/charliermarsh/ruff/pull/3817)
- Avoid `unnecessary-comprehension-any-all` for async generators by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3823](https://github.com/charliermarsh/ruff/pull/3823)
- Fix `is_module_name()` and improve perf of `is_identifier()` by
[@&#8203;JonathanPlasse](https://github.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/3795](https://github.com/charliermarsh/ruff/pull/3795)
- Allow starred arguments in B030 by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3871](https://github.com/charliermarsh/ruff/pull/3871)
- Support mutually exclusive branches for `B031` by
[@&#8203;dhruvmanila](https://github.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/3844](https://github.com/charliermarsh/ruff/pull/3844)
- Consider logger candidate from `logging` module only by
[@&#8203;dhruvmanila](https://github.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/3878](https://github.com/charliermarsh/ruff/pull/3878)

##### Core

- Add import insertion support to autofix capabilities by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3787](https://github.com/charliermarsh/ruff/pull/3787)
- Generate `ImportMap` from module path to imported dependencies by
[@&#8203;chanman3388](https://github.com/chanman3388) in
[https://github.com/charliermarsh/ruff/pull/3243](https://github.com/charliermarsh/ruff/pull/3243)

##### Docs

- Add documentation for `ruff-action` (GitHub Action!) by
[@&#8203;brucearctor](https://github.com/brucearctor) in
[https://github.com/charliermarsh/ruff/pull/3857](https://github.com/charliermarsh/ruff/pull/3857)

#### New Contributors

- [@&#8203;AetherUnbound](https://github.com/AetherUnbound) made their
first contribution in
[https://github.com/charliermarsh/ruff/pull/3806](https://github.com/charliermarsh/ruff/pull/3806)
- [@&#8203;Hnasar](https://github.com/Hnasar) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/3835](https://github.com/charliermarsh/ruff/pull/3835)
- [@&#8203;nvuillam](https://github.com/nvuillam) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/3848](https://github.com/charliermarsh/ruff/pull/3848)
- [@&#8203;brucearctor](https://github.com/brucearctor) made their
first contribution in
[https://github.com/charliermarsh/ruff/pull/3857](https://github.com/charliermarsh/ruff/pull/3857)

**Full Changelog**:
astral-sh/ruff@v0.0.260...v0.0.261

</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://app.renovatebot.com/dashboard#github/allenporter/pyrainbird).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4zNC4xIiwidXBkYXRlZEluVmVyIjoiMzUuMzQuMSJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot referenced this pull request in allenporter/flux-local Apr 7, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

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

---

### Release Notes

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

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

[Compare
Source](https://github.com/charliermarsh/ruff/compare/v0.0.260...v0.0.261)

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

#### What's Changed

##### Rules

- \[`flake8-simplify`] Ignore `collapsible-if` violations for `if
False:` and `if True:` by
[@&#8203;JonathanPlasse](https://github.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/3732](https://github.com/charliermarsh/ruff/pull/3732)
- \[`flake8-pie`] Extend `unncessary-generator-any-all` to set
comprehensions by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3824](https://github.com/charliermarsh/ruff/pull/3824)
- \[`flake8-simplify`] Implement `dict-get-with-none-default` (`SIM910`)
by [@&#8203;kyoto7250](https://github.com/kyoto7250) in
[https://github.com/charliermarsh/ruff/pull/3874](https://github.com/charliermarsh/ruff/pull/3874)
- \[`flake8-annotations`] Additional simple magic return types by
[@&#8203;dhruvmanila](https://github.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/3805](https://github.com/charliermarsh/ruff/pull/3805)
- \[`flake8-pyi`]: fix PYI015 false positive on assignment of TypeVar &
friends by [@&#8203;bluetech](https://github.com/bluetech) in
[https://github.com/charliermarsh/ruff/pull/3861](https://github.com/charliermarsh/ruff/pull/3861)

##### Bug Fixes

- Improve robustness of argument removal for `encode` calls by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3802](https://github.com/charliermarsh/ruff/pull/3802)
- Fix SIM222 and SIM223 false positive by
[@&#8203;JonathanPlasse](https://github.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/3832](https://github.com/charliermarsh/ruff/pull/3832)
- When checking module visibility, don't check entire ancestry by
[@&#8203;Hnasar](https://github.com/Hnasar) in
[https://github.com/charliermarsh/ruff/pull/3835](https://github.com/charliermarsh/ruff/pull/3835)
- Improve top-of-file insertions for required imports by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3779](https://github.com/charliermarsh/ruff/pull/3779)
- Use multi-fix semantics for `inplace` removal by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3804](https://github.com/charliermarsh/ruff/pull/3804)
- Flag non-`Name` expressions in `duplicate-isinstance-call` by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3817](https://github.com/charliermarsh/ruff/pull/3817)
- Avoid `unnecessary-comprehension-any-all` for async generators by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3823](https://github.com/charliermarsh/ruff/pull/3823)
- Fix `is_module_name()` and improve perf of `is_identifier()` by
[@&#8203;JonathanPlasse](https://github.com/JonathanPlasse) in
[https://github.com/charliermarsh/ruff/pull/3795](https://github.com/charliermarsh/ruff/pull/3795)
- Allow starred arguments in B030 by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3871](https://github.com/charliermarsh/ruff/pull/3871)
- Support mutually exclusive branches for `B031` by
[@&#8203;dhruvmanila](https://github.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/3844](https://github.com/charliermarsh/ruff/pull/3844)
- Consider logger candidate from `logging` module only by
[@&#8203;dhruvmanila](https://github.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/3878](https://github.com/charliermarsh/ruff/pull/3878)

##### Core

- Add import insertion support to autofix capabilities by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/3787](https://github.com/charliermarsh/ruff/pull/3787)
- Generate `ImportMap` from module path to imported dependencies by
[@&#8203;chanman3388](https://github.com/chanman3388) in
[https://github.com/charliermarsh/ruff/pull/3243](https://github.com/charliermarsh/ruff/pull/3243)

##### Docs

- Add documentation for `ruff-action` (GitHub Action!) by
[@&#8203;brucearctor](https://github.com/brucearctor) in
[https://github.com/charliermarsh/ruff/pull/3857](https://github.com/charliermarsh/ruff/pull/3857)

#### New Contributors

- [@&#8203;AetherUnbound](https://github.com/AetherUnbound) made their
first contribution in
[https://github.com/charliermarsh/ruff/pull/3806](https://github.com/charliermarsh/ruff/pull/3806)
- [@&#8203;Hnasar](https://github.com/Hnasar) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/3835](https://github.com/charliermarsh/ruff/pull/3835)
- [@&#8203;nvuillam](https://github.com/nvuillam) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/3848](https://github.com/charliermarsh/ruff/pull/3848)
- [@&#8203;brucearctor](https://github.com/brucearctor) made their
first contribution in
[https://github.com/charliermarsh/ruff/pull/3857](https://github.com/charliermarsh/ruff/pull/3857)

**Full Changelog**:
astral-sh/ruff@v0.0.260...v0.0.261

</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://app.renovatebot.com/dashboard#github/allenporter/flux-local).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4zNC4xIiwidXBkYXRlZEluVmVyIjoiMzUuMzQuMSJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: rewrite dict.get(key, None) as dict.get(key)
2 participants