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

Warn on PEP 604 syntax not in an annotation, but don't autofix #4170

Merged
merged 1 commit into from
May 2, 2023

Conversation

wookie184
Copy link
Contributor

Closes #3937. (also related, #4108)

This was removed after #3215 and #2981, although in both those cases, the issue isn't specific to the syntax not being in an annotation. AFAICT it's pretty much an equally safe change in both places, although in this PR i've made it so it will only warn and not autofix anyway.

@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.00     15.0±0.05ms     2.7 MB/sec    1.00     15.0±0.09ms     2.7 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      3.6±0.01ms     4.6 MB/sec    1.00      3.6±0.03ms     4.6 MB/sec
linter/all-rules/numpy/globals.py          1.01    374.1±1.50µs     7.9 MB/sec    1.00    371.0±0.78µs     8.0 MB/sec
linter/all-rules/pydantic/types.py         1.01      6.3±0.03ms     4.1 MB/sec    1.00      6.2±0.02ms     4.1 MB/sec
linter/default-rules/large/dataset.py      1.01      7.6±0.03ms     5.4 MB/sec    1.00      7.6±0.03ms     5.4 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00   1581.0±4.35µs    10.5 MB/sec    1.00  1588.5±11.92µs    10.5 MB/sec
linter/default-rules/numpy/globals.py      1.00    171.8±0.65µs    17.2 MB/sec    1.00    171.3±0.18µs    17.2 MB/sec
linter/default-rules/pydantic/types.py     1.01      3.4±0.00ms     7.6 MB/sec    1.00      3.4±0.00ms     7.6 MB/sec
parser/large/dataset.py                    1.00      5.9±0.03ms     6.9 MB/sec    1.02      6.0±0.01ms     6.8 MB/sec
parser/numpy/ctypeslib.py                  1.00   1139.5±1.08µs    14.6 MB/sec    1.02   1161.9±1.40µs    14.3 MB/sec
parser/numpy/globals.py                    1.00    116.0±0.28µs    25.4 MB/sec    1.01    117.3±0.22µs    25.2 MB/sec
parser/pydantic/types.py                   1.00      2.5±0.00ms    10.2 MB/sec    1.02      2.5±0.05ms    10.1 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.00     21.5±0.55ms  1938.0 KB/sec    1.04     22.3±0.60ms  1864.1 KB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      5.3±0.18ms     3.1 MB/sec    1.03      5.5±0.19ms     3.0 MB/sec
linter/all-rules/numpy/globals.py          1.00   626.5±22.79µs     4.7 MB/sec    1.03   643.3±32.95µs     4.6 MB/sec
linter/all-rules/pydantic/types.py         1.00      8.9±0.29ms     2.9 MB/sec    1.04      9.3±0.33ms     2.7 MB/sec
linter/default-rules/large/dataset.py      1.00     10.9±0.26ms     3.7 MB/sec    1.03     11.3±0.34ms     3.6 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.00      2.3±0.08ms     7.3 MB/sec    1.06      2.4±0.12ms     7.0 MB/sec
linter/default-rules/numpy/globals.py      1.00   268.4±22.56µs    11.0 MB/sec    1.07   287.6±17.61µs    10.3 MB/sec
linter/default-rules/pydantic/types.py     1.00      4.8±0.20ms     5.3 MB/sec    1.05      5.1±0.19ms     5.0 MB/sec
parser/large/dataset.py                    1.04      9.3±0.46ms     4.4 MB/sec    1.00      8.9±0.39ms     4.5 MB/sec
parser/numpy/ctypeslib.py                  1.00  1727.6±65.50µs     9.6 MB/sec    1.01  1749.0±66.00µs     9.5 MB/sec
parser/numpy/globals.py                    1.00    171.1±7.31µs    17.2 MB/sec    1.04    177.8±7.40µs    16.6 MB/sec
parser/pydantic/types.py                   1.00      3.8±0.09ms     6.7 MB/sec    1.01      3.9±0.14ms     6.6 MB/sec

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Thank you

@charliermarsh charliermarsh merged commit ac600bb into astral-sh:main May 2, 2023
renovate bot referenced this pull request in ixm-one/pytest-cmake-presets May 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://togithub.com/charliermarsh/ruff) | `^0.0.264` ->
`^0.0.265` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/compatibility-slim/0.0.264)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/confidence-slim/0.0.264)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

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

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

#### What's Changed

##### Breaking Changes

- Change `--fix-only` exit semantics to mirror `--fix` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4146](https://togithub.com/charliermarsh/ruff/pull/4146)

##### Rules

- \[flake8-pyi] PYI020 by [@&#8203;arya-k](https://togithub.com/arya-k)
in
[https://github.com/charliermarsh/ruff/pull/4211](https://togithub.com/charliermarsh/ruff/pull/4211)
- Update B027 to support autofixing by
[@&#8203;aacunningham](https://togithub.com/aacunningham) in
[https://github.com/charliermarsh/ruff/pull/4178](https://togithub.com/charliermarsh/ruff/pull/4178)
- \[`flake8-pyi`] Implement `PYI042` and `PYI043` by
[@&#8203;arya-k](https://togithub.com/arya-k) in
[https://github.com/charliermarsh/ruff/pull/4214](https://togithub.com/charliermarsh/ruff/pull/4214)
- \[`pylint`] Implement import-self (`W0406`) by
[@&#8203;chanman3388](https://togithub.com/chanman3388) in
[https://github.com/charliermarsh/ruff/pull/4154](https://togithub.com/charliermarsh/ruff/pull/4154)
- Warn on PEP 604 syntax not in an annotation, but don't autofix by
[@&#8203;wookie184](https://togithub.com/wookie184) in
[https://github.com/charliermarsh/ruff/pull/4170](https://togithub.com/charliermarsh/ruff/pull/4170)

##### Bug Fixes

- Fix panic in pydocstyle D214 when docstring indentation is empty by
[@&#8203;madkinsz](https://togithub.com/madkinsz) in
[https://github.com/charliermarsh/ruff/pull/4216](https://togithub.com/charliermarsh/ruff/pull/4216)
- Render tabs as 4 spaces in diagnostics by
[@&#8203;MichaReiser](https://togithub.com/MichaReiser) in
[https://github.com/charliermarsh/ruff/pull/4132](https://togithub.com/charliermarsh/ruff/pull/4132)
- Fix era panic caused by out of bound edition by
[@&#8203;leiserfg](https://togithub.com/leiserfg) in
[https://github.com/charliermarsh/ruff/pull/4206](https://togithub.com/charliermarsh/ruff/pull/4206)
- End of statement insertion should occur after newline by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4215](https://togithub.com/charliermarsh/ruff/pull/4215)
- Ignore **debuggerskip** in unused variable checks by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4229](https://togithub.com/charliermarsh/ruff/pull/4229)

##### CLI

- Show settings path in `--show-settings` output by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4199](https://togithub.com/charliermarsh/ruff/pull/4199)

##### Documentation

- Allow linking to individual rules by
[@&#8203;calumy](https://togithub.com/calumy) in
[https://github.com/charliermarsh/ruff/pull/4158](https://togithub.com/charliermarsh/ruff/pull/4158)

#### New Contributors

- [@&#8203;wookie184](https://togithub.com/wookie184) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4170](https://togithub.com/charliermarsh/ruff/pull/4170)
- [@&#8203;arya-k](https://togithub.com/arya-k) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4211](https://togithub.com/charliermarsh/ruff/pull/4211)

**Full Changelog**:
astral-sh/ruff@v0.0.264...v0.0.265

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

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/flux-local May 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://togithub.com/charliermarsh/ruff) | `==0.0.264` ->
`==0.0.265` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/compatibility-slim/0.0.264)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/confidence-slim/0.0.264)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

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

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

#### What's Changed

##### Breaking Changes

- Change `--fix-only` exit semantics to mirror `--fix` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4146](https://togithub.com/charliermarsh/ruff/pull/4146)

##### Rules

- \[flake8-pyi] PYI020 by [@&#8203;arya-k](https://togithub.com/arya-k)
in
[https://github.com/charliermarsh/ruff/pull/4211](https://togithub.com/charliermarsh/ruff/pull/4211)
- Update B027 to support autofixing by
[@&#8203;aacunningham](https://togithub.com/aacunningham) in
[https://github.com/charliermarsh/ruff/pull/4178](https://togithub.com/charliermarsh/ruff/pull/4178)
- \[`flake8-pyi`] Implement `PYI042` and `PYI043` by
[@&#8203;arya-k](https://togithub.com/arya-k) in
[https://github.com/charliermarsh/ruff/pull/4214](https://togithub.com/charliermarsh/ruff/pull/4214)
- \[`pylint`] Implement import-self (`W0406`) by
[@&#8203;chanman3388](https://togithub.com/chanman3388) in
[https://github.com/charliermarsh/ruff/pull/4154](https://togithub.com/charliermarsh/ruff/pull/4154)
- Warn on PEP 604 syntax not in an annotation, but don't autofix by
[@&#8203;wookie184](https://togithub.com/wookie184) in
[https://github.com/charliermarsh/ruff/pull/4170](https://togithub.com/charliermarsh/ruff/pull/4170)

##### Bug Fixes

- Fix panic in pydocstyle D214 when docstring indentation is empty by
[@&#8203;madkinsz](https://togithub.com/madkinsz) in
[https://github.com/charliermarsh/ruff/pull/4216](https://togithub.com/charliermarsh/ruff/pull/4216)
- Render tabs as 4 spaces in diagnostics by
[@&#8203;MichaReiser](https://togithub.com/MichaReiser) in
[https://github.com/charliermarsh/ruff/pull/4132](https://togithub.com/charliermarsh/ruff/pull/4132)
- Fix era panic caused by out of bound edition by
[@&#8203;leiserfg](https://togithub.com/leiserfg) in
[https://github.com/charliermarsh/ruff/pull/4206](https://togithub.com/charliermarsh/ruff/pull/4206)
- End of statement insertion should occur after newline by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4215](https://togithub.com/charliermarsh/ruff/pull/4215)
- Ignore **debuggerskip** in unused variable checks by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4229](https://togithub.com/charliermarsh/ruff/pull/4229)

##### CLI

- Show settings path in `--show-settings` output by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4199](https://togithub.com/charliermarsh/ruff/pull/4199)

##### Documentation

- Allow linking to individual rules by
[@&#8203;calumy](https://togithub.com/calumy) in
[https://github.com/charliermarsh/ruff/pull/4158](https://togithub.com/charliermarsh/ruff/pull/4158)

#### New Contributors

- [@&#8203;wookie184](https://togithub.com/wookie184) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4170](https://togithub.com/charliermarsh/ruff/pull/4170)
- [@&#8203;arya-k](https://togithub.com/arya-k) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4211](https://togithub.com/charliermarsh/ruff/pull/4211)

**Full Changelog**:
astral-sh/ruff@v0.0.264...v0.0.265

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

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot referenced this pull request in allenporter/pyrainbird May 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://togithub.com/charliermarsh/ruff) | `==0.0.264` ->
`==0.0.265` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/compatibility-slim/0.0.264)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.265/confidence-slim/0.0.264)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

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

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

#### What's Changed

##### Breaking Changes

- Change `--fix-only` exit semantics to mirror `--fix` by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4146](https://togithub.com/charliermarsh/ruff/pull/4146)

##### Rules

- \[flake8-pyi] PYI020 by [@&#8203;arya-k](https://togithub.com/arya-k)
in
[https://github.com/charliermarsh/ruff/pull/4211](https://togithub.com/charliermarsh/ruff/pull/4211)
- Update B027 to support autofixing by
[@&#8203;aacunningham](https://togithub.com/aacunningham) in
[https://github.com/charliermarsh/ruff/pull/4178](https://togithub.com/charliermarsh/ruff/pull/4178)
- \[`flake8-pyi`] Implement `PYI042` and `PYI043` by
[@&#8203;arya-k](https://togithub.com/arya-k) in
[https://github.com/charliermarsh/ruff/pull/4214](https://togithub.com/charliermarsh/ruff/pull/4214)
- \[`pylint`] Implement import-self (`W0406`) by
[@&#8203;chanman3388](https://togithub.com/chanman3388) in
[https://github.com/charliermarsh/ruff/pull/4154](https://togithub.com/charliermarsh/ruff/pull/4154)
- Warn on PEP 604 syntax not in an annotation, but don't autofix by
[@&#8203;wookie184](https://togithub.com/wookie184) in
[https://github.com/charliermarsh/ruff/pull/4170](https://togithub.com/charliermarsh/ruff/pull/4170)

##### Bug Fixes

- Fix panic in pydocstyle D214 when docstring indentation is empty by
[@&#8203;madkinsz](https://togithub.com/madkinsz) in
[https://github.com/charliermarsh/ruff/pull/4216](https://togithub.com/charliermarsh/ruff/pull/4216)
- Render tabs as 4 spaces in diagnostics by
[@&#8203;MichaReiser](https://togithub.com/MichaReiser) in
[https://github.com/charliermarsh/ruff/pull/4132](https://togithub.com/charliermarsh/ruff/pull/4132)
- Fix era panic caused by out of bound edition by
[@&#8203;leiserfg](https://togithub.com/leiserfg) in
[https://github.com/charliermarsh/ruff/pull/4206](https://togithub.com/charliermarsh/ruff/pull/4206)
- End of statement insertion should occur after newline by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4215](https://togithub.com/charliermarsh/ruff/pull/4215)
- Ignore **debuggerskip** in unused variable checks by
[@&#8203;charliermarsh](https://togithub.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/4229](https://togithub.com/charliermarsh/ruff/pull/4229)

##### CLI

- Show settings path in `--show-settings` output by
[@&#8203;dhruvmanila](https://togithub.com/dhruvmanila) in
[https://github.com/charliermarsh/ruff/pull/4199](https://togithub.com/charliermarsh/ruff/pull/4199)

##### Documentation

- Allow linking to individual rules by
[@&#8203;calumy](https://togithub.com/calumy) in
[https://github.com/charliermarsh/ruff/pull/4158](https://togithub.com/charliermarsh/ruff/pull/4158)

#### New Contributors

- [@&#8203;wookie184](https://togithub.com/wookie184) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4170](https://togithub.com/charliermarsh/ruff/pull/4170)
- [@&#8203;arya-k](https://togithub.com/arya-k) made their first
contribution in
[https://github.com/charliermarsh/ruff/pull/4211](https://togithub.com/charliermarsh/ruff/pull/4211)

**Full Changelog**:
astral-sh/ruff@v0.0.264...v0.0.265

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

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.

Add warning for PEP 604 when not in annotation
3 participants