Skip to content

Skip SIM108 violations for complex if-statements#1802

Merged
charliermarsh merged 1 commit intomainfrom
charlie/SIM108
Jan 12, 2023
Merged

Skip SIM108 violations for complex if-statements#1802
charliermarsh merged 1 commit intomainfrom
charlie/SIM108

Conversation

@charliermarsh
Copy link
Member

We now skip SIM108 violations if: the resulting statement would exceed the user-specified line length, or the if statement contains comments.

Closes #1719.

Closes #1766.

@charliermarsh charliermarsh merged commit 4fce296 into main Jan 12, 2023
@charliermarsh charliermarsh deleted the charlie/SIM108 branch January 12, 2023 00:21
bruxisma referenced this pull request in ixm-one/pytest-cmake-presets Jan 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://togithub.com/charliermarsh/ruff) | `^0.0.218` ->
`^0.0.219` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.219/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.219/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.219/compatibility-slim/0.0.218)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.219/confidence-slim/0.0.218)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

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

#### What's Changed

- Disable update check by default by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/1786](https://togithub.com/charliermarsh/ruff/pull/1786)
- Improve PIE794 autofix behavior by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/1794](https://togithub.com/charliermarsh/ruff/pull/1794)
- Convert flake8-comprehensions checks to Checker style by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/1795](https://togithub.com/charliermarsh/ruff/pull/1795)
- Refactor flake8-comprehensions rules to take fewer arguments by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/1797](https://togithub.com/charliermarsh/ruff/pull/1797)
- Avoid rewriting flake8-comprehensions expressions for builtin
overrides by [@&#8203;charliermarsh](https://togithub.com/charliermarsh)
in
[https://github.com/charliermarsh/ruff/pull/1799](https://togithub.com/charliermarsh/ruff/pull/1799)
- Update readme to reflect
[#&#8203;1763](https://togithub.com/charliermarsh/ruff/issues/1763) by
[@&#8203;Czaki](https://togithub.com/Czaki) in
[https://github.com/charliermarsh/ruff/pull/1780](https://togithub.com/charliermarsh/ruff/pull/1780)
- Avoid flagging builtins for OSError rewrites by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/1800](https://togithub.com/charliermarsh/ruff/pull/1800)
- Skip unused argument checks for magic methods by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/1801](https://togithub.com/charliermarsh/ruff/pull/1801)
- Skip SIM108 violations for complex if-statements by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/1802](https://togithub.com/charliermarsh/ruff/pull/1802)
- \[`flake8-simplify`] Add Rule for `SIM115` (Use context handler for
opening files) by [@&#8203;saadmk11](https://togithub.com/saadmk11) in
[https://github.com/charliermarsh/ruff/pull/1782](https://togithub.com/charliermarsh/ruff/pull/1782)
- flake8\_simplify : SIM401 by
[@&#8203;chammika-become](https://togithub.com/chammika-become) in
[https://github.com/charliermarsh/ruff/pull/1778](https://togithub.com/charliermarsh/ruff/pull/1778)
- Avoid erroneous Q002 error message for single-quote docstrings by
[@&#8203;colin99d](https://togithub.com/colin99d) in
[https://github.com/charliermarsh/ruff/pull/1777](https://togithub.com/charliermarsh/ruff/pull/1777)
- Implement doc line length enforcement by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/1804](https://togithub.com/charliermarsh/ruff/pull/1804)
- Move top level `ruff` into `python` folder by
[@&#8203;messense](https://togithub.com/messense) in
[https://github.com/charliermarsh/ruff/pull/1806](https://togithub.com/charliermarsh/ruff/pull/1806)
- Improve globset documentation and help message by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/1808](https://togithub.com/charliermarsh/ruff/pull/1808)

#### New Contributors

- [@&#8203;Czaki](https://togithub.com/Czaki) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/1780](https://togithub.com/charliermarsh/ruff/pull/1780)

**Full Changelog**:
astral-sh/ruff@v0.0.218...v0.0.219

</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:eyJjcmVhdGVkSW5WZXIiOiIzNC45OC4xIiwidXBkYXRlZEluVmVyIjoiMzQuOTguMSJ9-->

Signed-off-by: Renovate Bot <bot@renovateapp.com>
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.

SIM108 autofix produces code that breaks E501 SIM108 autofix removes comments

1 participant