-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
W504 - line break after binary operator #1660
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1660 +/- ##
==========================================
- Coverage 85.6% 85.08% -0.52%
==========================================
Files 181 180 -1
Lines 42218 41473 -745
==========================================
- Hits 36140 35288 -852
- Misses 6078 6185 +107
|
7d98e26 to
3d55979
Compare
p-l-
left a comment
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.
Is it worth it? Maybe we could decide we ignore W504 globally?
|
(copy & paste of my review message here) Is it worth it? Maybe we could decide we ignore W504 globally? |
|
@p-l- most of the W504 errors were easily fixed. It was a lot of work because the code has many of them, but it seems OK to enforce W504. |
|
@gpotter2 do you understand why the windows tests fail? |
e9d542b to
adb73f1
Compare
9d01980 to
b1d0f83
Compare
|
I don’t see tests failing as abruptly:/ I’ll try to figure it out |
|
Is it also failing on a real Windows system? |
scapy/arch/bpf/core.py
Outdated
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.
Could you move the if to a next line and remove at least the E501 new noqa?
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.
rewritten with in instead of find() to save space.
scapy/arch/windows/__init__.py
Outdated
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.
I don't understand this change. Wouldn't it be cleaner to keep the previous version and cut the longest lines to remove the noqa?
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.
noqa removed
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.
I still don't understand. error_msg += ... creates a new string each time.
I'm not sure to agree. IMO W504 should be permitted. They are disabled by default, and I'm not sure it makes sens to forbid both W503 and W504. |
|
I agree, enforcing both don’t make any sense. I did not notice that before your comment.
As this PR does not work, it is safe to close it and decide to only enforce W503.
|
This PR fixes #1659. I tried to limit the use of
noqabut it is needed in some places.