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

End of statement insertion should occur after newline #4215

Merged
merged 3 commits into from
May 4, 2023

Conversation

dhruvmanila
Copy link
Member

@dhruvmanila dhruvmanila commented May 4, 2023

To-Do:

  • Update documentation for end_of_statement_insertion. Currently, it's same as that of top_of_file_insertion ;)
  • Add test cases for end_of_statement_insertion if possible (refer to end_of_statement_insertion test cases) This seems to be a bit difficult due to the dependency on Checker
  • Add test case for SIM105 with an existing non-contextlib import (testing end_of_statement_insertion)
  • Add test case for SIM105 with contextlib already imported

fixes: #4203

@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.03     14.8±0.11ms     2.8 MB/sec    1.00     14.3±0.10ms     2.8 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      3.4±0.03ms     4.8 MB/sec    1.00      3.4±0.03ms     4.9 MB/sec
linter/all-rules/numpy/globals.py          1.01    421.9±0.92µs     7.0 MB/sec    1.00    416.7±0.82µs     7.1 MB/sec
linter/all-rules/pydantic/types.py         1.04      6.1±0.06ms     4.1 MB/sec    1.00      5.9±0.05ms     4.3 MB/sec
linter/default-rules/large/dataset.py      1.03      7.2±0.05ms     5.7 MB/sec    1.00      7.0±0.03ms     5.8 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.01   1501.9±5.64µs    11.1 MB/sec    1.00   1493.3±3.71µs    11.2 MB/sec
linter/default-rules/numpy/globals.py      1.01    168.4±0.25µs    17.5 MB/sec    1.00    166.5±0.30µs    17.7 MB/sec
linter/default-rules/pydantic/types.py     1.02      3.2±0.02ms     8.1 MB/sec    1.00      3.1±0.01ms     8.2 MB/sec
parser/large/dataset.py                    1.00      5.4±0.01ms     7.5 MB/sec    1.00      5.5±0.01ms     7.4 MB/sec
parser/numpy/ctypeslib.py                  1.00   1060.0±4.61µs    15.7 MB/sec    1.00   1059.8±2.34µs    15.7 MB/sec
parser/numpy/globals.py                    1.00    107.8±0.31µs    27.4 MB/sec    1.00    108.3±0.43µs    27.2 MB/sec
parser/pydantic/types.py                   1.00      2.3±0.00ms    11.0 MB/sec    1.00      2.3±0.00ms    11.0 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.00     20.7±0.35ms  2012.3 KB/sec    1.00     20.8±0.39ms  2004.3 KB/sec
linter/all-rules/numpy/ctypeslib.py        1.00      5.1±0.14ms     3.3 MB/sec    1.00      5.1±0.11ms     3.3 MB/sec
linter/all-rules/numpy/globals.py          1.00   602.4±31.41µs     4.9 MB/sec    1.00   599.7±21.69µs     4.9 MB/sec
linter/all-rules/pydantic/types.py         1.01      8.7±0.20ms     2.9 MB/sec    1.00      8.7±0.21ms     2.9 MB/sec
linter/default-rules/large/dataset.py      1.00     10.4±0.22ms     3.9 MB/sec    1.00     10.3±0.19ms     3.9 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.01      2.2±0.06ms     7.6 MB/sec    1.00      2.2±0.07ms     7.6 MB/sec
linter/default-rules/numpy/globals.py      1.00    243.4±8.08µs    12.1 MB/sec    1.03   249.6±11.76µs    11.8 MB/sec
linter/default-rules/pydantic/types.py     1.00      4.6±0.11ms     5.5 MB/sec    1.00      4.6±0.14ms     5.5 MB/sec
parser/large/dataset.py                    1.01      8.3±0.12ms     4.9 MB/sec    1.00      8.2±0.11ms     5.0 MB/sec
parser/numpy/ctypeslib.py                  1.02  1595.2±49.16µs    10.4 MB/sec    1.00  1563.3±45.80µs    10.7 MB/sec
parser/numpy/globals.py                    1.00    162.3±8.88µs    18.2 MB/sec    1.00    161.6±5.71µs    18.3 MB/sec
parser/pydantic/types.py                   1.01      3.5±0.07ms     7.3 MB/sec    1.00      3.5±0.08ms     7.3 MB/sec

@dhruvmanila dhruvmanila marked this pull request as ready for review May 4, 2023 13:52
crates/ruff/src/importer.rs Show resolved Hide resolved
@MichaReiser MichaReiser merged commit bb2cbf1 into astral-sh:main May 4, 2023
13 checks passed
@dhruvmanila dhruvmanila deleted the add-import-after-newline branch May 4, 2023 14:23
renovate bot added a commit to ixm-one/pytest-cmake-presets that referenced this pull request 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
[astral-sh/ruff#4146

##### Rules

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

##### Bug Fixes

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

##### CLI

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

##### Documentation

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

#### New Contributors

- [@&#8203;wookie184](https://togithub.com/wookie184) made their first
contribution in
[astral-sh/ruff#4170
- [@&#8203;arya-k](https://togithub.com/arya-k) made their first
contribution in
[astral-sh/ruff#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 added a commit to allenporter/flux-local that referenced this pull request 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
[astral-sh/ruff#4146

##### Rules

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

##### Bug Fixes

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

##### CLI

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

##### Documentation

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

#### New Contributors

- [@&#8203;wookie184](https://togithub.com/wookie184) made their first
contribution in
[astral-sh/ruff#4170
- [@&#8203;arya-k](https://togithub.com/arya-k) made their first
contribution in
[astral-sh/ruff#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 added a commit to allenporter/pyrainbird that referenced this pull request 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
[astral-sh/ruff#4146

##### Rules

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

##### Bug Fixes

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

##### CLI

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

##### Documentation

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

#### New Contributors

- [@&#8203;wookie184](https://togithub.com/wookie184) made their first
contribution in
[astral-sh/ruff#4170
- [@&#8203;arya-k](https://togithub.com/arya-k) made their first
contribution in
[astral-sh/ruff#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.

[Autofix error] My File: test/distributed/elastic/rendezvous/etcd_rendezvous_backend_test.py
2 participants