Skip to content

ruff and black disagree on .pyi format for one line def #2763

Description

@messense
class DummyClass:
    @staticmethod
    def get_42() -> int: ...

ruff gives test-crates/pyo3-pure/pyo3_pure.pyi:3:5: E704 Multiple statements on one line (def) while black formats it back to one line if you change it to

class DummyClass:
    @staticmethod
    def get_42() -> int:
        ...

Activity

  1. changed the title [-]ruff and black disagree on `.pyi` format[/-] [+]ruff and black disagree on `.pyi` format for one line `def`[/+] on Feb 11, 2023
  2. added
    bugAn issue describing something that isn't working, or a PR that fixes a bug
    on Feb 11, 2023
  3. charliermarsh commented on Feb 11, 2023

    @charliermarsh
    Member

    Need to figure out how to handle this because Flake8 and pycodestyle actually do flag these as errors (they just don't enable that rule by default, AFAICT).

  4. charliermarsh commented on Feb 11, 2023

    @charliermarsh
    Member

    I'm going to either disable this rule by default or remove it entirely.

  5. added a commit that references this issue on Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue describing something that isn't working, or a PR that fixes a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions