Skip to content

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

@simon-liebehenschel

Description

@simon-liebehenschel

The original code

from contextlib import nullcontext

ctx = nullcontext()
with ctx:
    ...

Steps to reproduce

ruff format --isolated --preview sample.py moves ellipsis:

from contextlib import nullcontext

ctx = nullcontext()
with ctx: ...

and now ruff --isolated --fix --preview sample.py will complain about : and ellipsis on a same line:

sample.py:4:9: E701 Multiple statements on one line (colon)
Found 1 error.

Expected behavior

No conflicts between ruff check and ruff format.

Versions

  • ruff 0.1.4
  • Python 3.11.6

Related

In the comment a developer assumed that E701 is not conflicting https://github.com/astral-sh/ruff/pull/8088/files#r1366486452

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions