Proposal: Allow 3-digit-grouped binary in non_octal_unix_permissions
#11243
Labels
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
Description
I personally much prefer to write Unix permissions in binary rather than octal. For comparison:
rwxr-xr--
0b111_101_100
0o754
ugo+rwx,go-w,o-x
oru+rwx,g+rx-w,o+r-wx
The 3-group binary format is more readable than octal in my opinion, because it lines up very neatly with the ls(1)
rwxrwxrwx
format, and does not require any binary conversion or lookup tables in one’s head.Currently Clippy disallows the following code:
To support this pattern, Clippy should include an exception in the
non_octal_unix_permissions
andunusual_byte_groupings
lints, to specifically allow binary literals of the exact format0b[XXX_]XXX_XXX_XXX
.Version
Additional Labels
@rustbot label +C-enhancement
The text was updated successfully, but these errors were encountered: