Skip to content

Allow collapsed-ellipsis bodies in other statements#8499

Merged
charliermarsh merged 2 commits intomainfrom
charlie/E701
Nov 6, 2023
Merged

Allow collapsed-ellipsis bodies in other statements#8499
charliermarsh merged 2 commits intomainfrom
charlie/E701

Conversation

@charliermarsh
Copy link
Member

Summary

Black and Ruff's preview styles now collapse statements like:

from contextlib import nullcontext

ctx = nullcontext()
with ctx: ...

Historically, we made an exception here for classes (#2837). This PR extends it to other statement kinds for consistency with the formatter.

Closes #8496.

@charliermarsh charliermarsh added the bug Something isn't working label Nov 6, 2023
@charliermarsh charliermarsh merged commit 8c146bb into main Nov 6, 2023
@charliermarsh charliermarsh deleted the charlie/E701 branch November 6, 2023 00:42
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2023

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+0 -9 violations, +0 -0 fixes in 41 projects)

latchbio/latch (+0 -9 violations, +0 -0 fixes)

- latch_cli/docker_utils/__init__.py:251:29: E701 Multiple statements on one line (colon)
- latch_cli/menus.py:298:29: E701 Multiple statements on one line (colon)
- latch_cli/services/get_executions.py:226:29: E701 Multiple statements on one line (colon)
- latch_cli/services/get_executions.py:319:29: E701 Multiple statements on one line (colon)
- latch_cli/services/get_executions.py:455:29: E701 Multiple statements on one line (colon)
- latch_cli/services/get_executions.py:516:29: E701 Multiple statements on one line (colon)
- latch_cli/services/local_dev_old.py:314:34: E701 Multiple statements on one line (colon)
- latch_cli/services/preview.py:179:29: E701 Multiple statements on one line (colon)
- latch_cli/utils/__init__.py:203:29: E701 Multiple statements on one line (colon)

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
E701 9 0 9 0 0

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -9 violations, +0 -0 fixes in 41 projects)

latchbio/latch (+0 -9 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

- latch_cli/docker_utils/__init__.py:251:29: E701 Multiple statements on one line (colon)
- latch_cli/menus.py:298:29: E701 Multiple statements on one line (colon)
- latch_cli/services/get_executions.py:226:29: E701 Multiple statements on one line (colon)
- latch_cli/services/get_executions.py:319:29: E701 Multiple statements on one line (colon)
- latch_cli/services/get_executions.py:455:29: E701 Multiple statements on one line (colon)
- latch_cli/services/get_executions.py:516:29: E701 Multiple statements on one line (colon)
- latch_cli/services/local_dev_old.py:314:34: E701 Multiple statements on one line (colon)
- latch_cli/services/preview.py:179:29: E701 Multiple statements on one line (colon)
- latch_cli/utils/__init__.py:203:29: E701 Multiple statements on one line (colon)

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
E701 9 0 9 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E701 is not listed on the "Conflicting lint rules" page but it conflicts with ruff format when --preview flag is used

1 participant