-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Summary
pathlib.Path('/file').chmod(444) means something different than what it seems, should be chmod(0o444).
Also, chmod of a decimal or hexadecimal literal is most likely unintentional, because it is are hard to read and the standard usage is octal. For example, telling the mode bits from 292 or 0x124 is not straightforward.
A new rule could look for a numeric literal and propose the octal form. There exist stat.S_* constants listed at os.chmod(), but honestly I'm not their fan, as the 3-digit version is cleaner and is standard in the POSIX world.
I don't have experience with the similar functions, but I guess the rule should also cover them.
pathlib.Path.lchmod()os.chmod()os.fchmod()os.lchmod()
Docs
chirizxc and UnknownPlatypus
Metadata
Metadata
Assignees
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint rule