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

PyUpgrade: Replace pipes with capture_output=True #1415

Merged
merged 11 commits into from
Dec 28, 2022
Merged

PyUpgrade: Replace pipes with capture_output=True #1415

merged 11 commits into from
Dec 28, 2022

Conversation

colin99d
Copy link
Contributor

@colin99d colin99d commented Dec 28, 2022

Creating this PR for visibility. It will remain a draft until the following two issues are resolved:

  • I am not sure how to avoid double counting errors, since there are two different ranges and two different fixes need to be applied.
  • Currently the autofix::Fix::deletion seems to be leaving extra dangling commas and spaces. I am assuming this is my error, and will dig in for a fix.

Update: Both of these fixed, lets get this merged.

A part of #827

@colin99d colin99d marked this pull request as ready for review December 28, 2022 12:58
@charliermarsh
Copy link
Member

Sweet, will review today.

@squiddy
Copy link
Contributor

squiddy commented Dec 28, 2022

May I suggest to include test cases from pyupgrade? https://github.com/asottile/pyupgrade/blob/main/tests/features/capture_output_test.py

Examples I don't see covered:

run(["foo"], stdout=None, stderr=PIPE)

from foo import PIPE
from subprocess import run
subprocess.run(["foo"], stdout=PIPE, stderr=PIPE)

@charliermarsh
Copy link
Member

(Oh, yes please, I forgot that we were including the pyupgrade test cases.)

@colin99d
Copy link
Contributor Author

I will add them for both of my PRs

@charliermarsh
Copy link
Member

🙏 Thank you

@colin99d
Copy link
Contributor Author

She passed em flawlessly!

@charliermarsh charliermarsh merged commit 34842b4 into astral-sh:main Dec 28, 2022
renovate bot referenced this pull request in ixm-one/pytest-cmake-presets Dec 29, 2022
[![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.198` ->
`^0.0.199` |
[![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.199/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.199/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.199/compatibility-slim/0.0.198)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.199/confidence-slim/0.0.198)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

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

#### What's Changed

- Check for keyword arguments before the last star argument by
[@&#8203;andersk](https://github.com/andersk) in
[https://github.com/charliermarsh/ruff/pull/1420](https://github.com/charliermarsh/ruff/pull/1420)
- Add Support for GitLab CI Code Quality Report Format by
[@&#8203;saadmk11](https://github.com/saadmk11) in
[https://github.com/charliermarsh/ruff/pull/1424](https://github.com/charliermarsh/ruff/pull/1424)
- Turn off wasm-pack tests by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/1427](https://github.com/charliermarsh/ruff/pull/1427)
- Extract duplicated logic into method by
[@&#8203;hanneskaeufler](https://github.com/hanneskaeufler) in
[https://github.com/charliermarsh/ruff/pull/1428](https://github.com/charliermarsh/ruff/pull/1428)
- Rewrite xml.etree.cElementTree to xml.etree.ElementTree by
[@&#8203;colin99d](https://github.com/colin99d) in
[https://github.com/charliermarsh/ruff/pull/1426](https://github.com/charliermarsh/ruff/pull/1426)
- PyUpgrade: Replace pipes with `capture_output=True` by
[@&#8203;colin99d](https://github.com/colin99d) in
[https://github.com/charliermarsh/ruff/pull/1415](https://github.com/charliermarsh/ruff/pull/1415)
- Add a --diff flag to dry-run autofixes by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/1431](https://github.com/charliermarsh/ruff/pull/1431)
- Split into lint and lint-and-fix methods by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/1432](https://github.com/charliermarsh/ruff/pull/1432)
- Warn the user when max iteration count is reached by
[@&#8203;charliermarsh](https://github.com/charliermarsh) in
[https://github.com/charliermarsh/ruff/pull/1433](https://github.com/charliermarsh/ruff/pull/1433)

#### New Contributors

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

**Full Changelog**:
astral-sh/ruff@v0.0.198...v0.0.199

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

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.

3 participants