Skip to content

soft-keyword-shadowing (akin to A001) #21061

@theXaMi

Description

@theXaMi

Summary

match and case are keywords that exist for some time already and we don't have any rule to prevent using them as variables. Some static token highlighters are highlighting it as a keyword because of it (including Bitbucket's diff view). I think it should exist as an optional rule to Ruff.

The only issue I see is that soft keywords also include type keyword, which is already covered by rule A001, so we would have overlapping rules, but it could be justified that it's not the same thing as it's used in two completely different contexts - it's just the token that's the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-decisionAwaiting a decision from a maintainerruleImplementing 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