-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions especially welcomeContributions especially welcomeruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Summary
missing-trailing-comma
(COM812) and prohibited-trailing-comma
(COM819) have false negatives for type parameter lists, wherein trailing commas make no difference. The comma rules for type parameter lists should be the same as for normal parameter lists.
COM812 should fix this:
type X[
T
] = T
def f[
T
](): pass
class C[
T
]: pass
to this:
type X[
T,
] = T
def f[
T,
](): pass
class C[
T,
]: pass
COM819 should fix this:
type X[T,] = T
def f[T,](): pass
class C[T,]: pass
to this:
type X[T] = T
def f[T](): pass
class C[T]: pass
Version
ruff 0.12.0 (87f0feb 2025-06-17)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions especially welcomeContributions especially welcomeruleImplementing or modifying a lint ruleImplementing or modifying a lint rule