Skip to content

PIE794 Duplicate class field not marked as duplicate #22683

@bhirsz

Description

@bhirsz

Summary

Playground link: https://play.ruff.rs/e8e979ae-a4d2-49a1-b883-7242fc0a2a6c

from dataclasses import dataclass


@dataclass
class TextEdit:
    start_line: int
    start_line: int

I have Python dataclass with duplicated class field. It didn't trigger any ruff rule. The closes rule I have found is PIE794 which reports duplicate class fields (with values assigned).

Version

ruff v0.14.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions