Skip to content

UP015 false negatives for many redundant open modes #14235

@dscorbett

Description

@dscorbett

redundant-open-modes (UP015) only recognizes seven redundant modes in Ruff 0.7.3:

enum OpenMode {
U,
Ur,
Ub,
RUb,
R,
Rt,
Wt,
}

However, many other modes are redundant. t and U can always be omitted. r is redundant unless b or + is present. The characters can appear in any order; although the rule handles wt, for example, it misses tw.

More information:

Metadata

Metadata

Assignees

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