amiller / HoneyBadgerBFT

The Honey Badger of BFT Protocols
Other
314 stars 84 forks source link

[test] add source code check to travis (pep8, etc) #33

Closed sbellem closed 6 years ago

sbellem commented 7 years ago

This helps to catch "style" deviations, such as improper indentation, unused imports, etc.

flake8 is commonly used for this

The goal of this issue is to setup the check in travis with "relaxed" conventions.

Conventions such as line length, single quotes vs double quotes, etc, can be established afterwards.

To diminish the risk of introducing errors at the expense of :"style", code coverage (e.g. #10) should be given priority.

For more on code quality tools see https://github.com/PyCQA.


Things to fix (full report):

qty err code description
8 E111 indentation is not a multiple of four
1 E114 indentation is not a multiple of four (comment)
1 E116 unexpected indentation (comment)
18 E201 whitespace after '('
20 E202 whitespace before ')'
10 E203 whitespace before ':'
12 E211 whitespace before '['
15 E221 multiple spaces before operator
3 E225 missing whitespace around operator
1 E227 missing whitespace around bitwise or shift operator
117 E231 missing whitespace after ':'
11 E261 at least two spaces before inline comment
3 E262 inline comment should start with '# '
93 E265 block comment should start with '# '
14 E266 too many leading '#' for block comment
3 E271 multiple spaces after keyword
5 E272 multiple spaces before keyword
72 E302 expected 2 blank lines, found 1
6 E303 too many blank lines (2)
14 E305 expected 2 blank lines after class or function definition, found 1
3 E306 expected 1 blank line before a nested definition, found 0
11 E402 module level import not at top of file
38 E501 line too long (118 > 79 characters)
41 E701 multiple statements on one line (colon)
1 E703 statement ends with a semicolon
4 E712 comparison to True should be 'if cond is True:' or 'if cond:'
7 E731 do not assign a lambda expression, use a def
27 F401 'honeybadgerbft.crypto.threshsig.boldyreva.deserialize1' imported but unused
1 F403 'from ecdsa_ssl import *' used; unable to detect undefined names
1 F405 'KEY' may be undefined, or defined from star imports: ecdsa_ssl
1 F812 list comprehension redefines 't' from line 80
3 F821 undefined name '_combine_and_verify'
12 F841 local variable 'aba' is assigned to but never used
29 W291 trailing whitespace
49 W293 blank line contains whitespace
7 W391 blank line at end of file
1 W604 backticks are deprecated, use 'repr()'
sbellem commented 6 years ago

Closing as this was handled in https://github.com/initc3/HoneyBadgerBFT-Python/pull/1