-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
previewRelated to preview mode featuresRelated to preview mode featuresruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Summary
non-octal-permissions
(RUF064) ignores a decimal zero except when it has multiple digits. People sometimes write zero as 000
to parallel other three-digit permissions. RUF064 should either ignore multi-digit decimal zeros or fix them to octal zeros. The fix could be safe.
$ cat >ruf064.py <<'# EOF'
import os
os.chmod("secrets.txt", 000)
# EOF
$ ruff --isolated check ruf064.py --select RUF064 --preview
ruf064.py:2:25: RUF064 Non-octal mode
|
1 | import os
2 | os.chmod("secrets.txt", 000)
| ^^^ RUF064
|
= help: Replace with octal literal
Found 1 error.
Version
ruff 0.12.1 (32c5418 2025-06-26)
Metadata
Metadata
Assignees
Labels
previewRelated to preview mode featuresRelated to preview mode featuresruleImplementing or modifying a lint ruleImplementing or modifying a lint rule