-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
STYLE ruff: enable PIE #51434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STYLE ruff: enable PIE #51434
Changes from all commits
6d05c42
7bb6483
e24c898
73b3951
0970ed5
b4de25d
0bf01bb
6942810
416f49f
f58be1c
da52ef7
2d3ffb9
2cdc091
6cd00ab
df2d3fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -865,23 +865,23 @@ class StataMissingValue: | |
MISSING_VALUES[i + b] = "." + chr(96 + i) | ||
|
||
float32_base: bytes = b"\x00\x00\x00\x7f" | ||
increment: int = struct.unpack("<i", b"\x00\x08\x00\x00")[0] | ||
increment_32: int = struct.unpack("<i", b"\x00\x08\x00\x00")[0] | ||
for i in range(27): | ||
key = struct.unpack("<f", float32_base)[0] | ||
MISSING_VALUES[key] = "." | ||
if i > 0: | ||
MISSING_VALUES[key] += chr(96 + i) | ||
int_value = struct.unpack("<i", struct.pack("<f", key))[0] + increment | ||
int_value = struct.unpack("<i", struct.pack("<f", key))[0] + increment_32 | ||
float32_base = struct.pack("<i", int_value) | ||
|
||
float64_base: bytes = b"\x00\x00\x00\x00\x00\x00\xe0\x7f" | ||
increment = struct.unpack("q", b"\x00\x00\x00\x00\x00\x01\x00\x00")[0] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why remove this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The error was PIE794. The fix that was suggested was removing one of the instances. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks - I don't think we can remove it though can you rename the first one to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have corrected this. |
||
increment_64 = struct.unpack("q", b"\x00\x00\x00\x00\x00\x01\x00\x00")[0] | ||
for i in range(27): | ||
key = struct.unpack("<d", float64_base)[0] | ||
MISSING_VALUES[key] = "." | ||
if i > 0: | ||
MISSING_VALUES[key] += chr(96 + i) | ||
int_value = struct.unpack("q", struct.pack("<d", key))[0] + increment | ||
int_value = struct.unpack("q", struct.pack("<d", key))[0] + increment_64 | ||
float64_base = struct.pack("q", int_value) | ||
|
||
BASE_MISSING_VALUES: Final = { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -212,6 +212,8 @@ select = [ | |
"Q", | ||
# pylint | ||
"PLE", "PLR", "PLW", | ||
# misc lints | ||
"PIE", | ||
# tidy imports | ||
"TID", | ||
] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error was PIE794. The fix that was suggested was removing one of the instances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah you're right, it is indeed duplicated. thanks!