-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
]: passto this:
type X[
T,
] = T
def f[
T,
](): pass
class C[
T,
]: passCOM819 should fix this:
type X[T,] = T
def f[T,](): pass
class C[T,]: passto this:
type X[T] = T
def f[T](): pass
class C[T]: passVersion
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