-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[PEP08] Project PEPin! #1277
Comments
There are currently three remaining errors:
I don't want to apply E731. I like assigning lambda to variable when it improve visibility. We could disable this error for the project E741 will be a nightmare to fix, I suggest that we use noqa comments. Concerning E402, I have mixed feelings between writing "except Exception" and using noqa comments. What are your opinions? |
My opinion about each:
|
I submitted PRs for E402 and E731. We are almost there =) I will try to fix the single What is your call for E722? |
With all the PR applied, a run of flake8 v3.5.0 returns the following errors:
|
PR #1626 contains a commit that enable all PE08 checks. |
Goals
During yesterday Scapy meetup, we discussed how we can improve the current state of Scapy source style with the following constraints:
Methodology
We performed a
flake8
run on commitf89055dac106f79f8892a33eca2e8b0ac29475ff
that shows 21733 errors made of 55 different errors/warnings. Scapy LoC is currently 38k.We decided to classify the errors type into three categories:
Automatic tests will be added and enforced as errors are fixed. In the mean time, the following command can be used to check for already fixed errors:
tox -e flake8
Stats
Here are the errors that need to be fixed. Comments, help and feedback are welcome!
F821 undefined name 'long'F601 dictionary key 'ldapUrl' repeated with different valuesF841 local variable 'name' is assigned to but never usedF811 redefinition of unused 'PcapTimeoutElapsed' from line 68F402 import 'conf' from line 30 shadowed by loop variableE231 missing whitespace after ','E501 line too long (80 > 79 characters)E302 expected 2 blank lines, found 1E201 whitespace after '{'E203 whitespace before ';'E128 continuation line under-indented for visual indentE202 whitespace before '}'E266 too many leading '#' for block commentE301 expected 1 blank line, found 0E225 missing whitespace around operatorE251 unexpected spaces around keyword / parameter equalsW293 blank line contains whitespaceE261 at least two spaces before inline commentE111 indentation is not a multiple of fourE265 block comment should start with '# 'W291 trailing whitespaceE305 expected 2 blank lines after class or function definition, found 1E127 continuation line over-indented for visual indentE303 too many blank lines (2)E221 multiple spaces before operatorE262 inline comment should start with '# 'E227 missing whitespace around bitwise or shift operatorE124 closing bracket does not match visual indentationW391 blank line at end of fileE131 continuation line unaligned for hanging indentE228 missing whitespace around modulo operatorW191 indentation contains tabsE114 indentation is not a multiple of four (comment)E129 visually indented line with same indent as next logical lineE401 multiple imports on one lineE701 multiple statements on one line (colon)E115 expected an indented block (comment)E122 continuation line missing indentation or outdentedE711 comparison to None should be 'if cond is None:'E306 expected 1 blank line before a nested definition, found 0E702 multiple statements on one line (semicolon)E222 multiple spaces after operatorE713 test for membership should be 'not in'E116 unexpected indentation (comment)E271 multiple spaces after keywordE272 multiple spaces before keywordE703 statement ends with a semicolonE101 indentation contains mixed spaces and tabsE211 whitespace before '('E712 comparison to True should be 'if cond is True:' or 'if cond:'E741 ambiguous variable name 'l'E722 do not use bare exceptE402 module level import not at top of fileE731 do not assign a lambda expression, use a defE502 the backslash is redundant between bracketsThe text was updated successfully, but these errors were encountered: