3-manifolds / SnapPy

SnapPy is a package for studying the topology and geometry of 3-manifolds, with a focus on hyperbolic structures. It is based on the SnapPea kernel written by Jeff Weeks.
https://snappy.computop.org/
84 stars 39 forks source link

fix pycodestyle issues #87

Open fchapoton opened 1 year ago

fchapoton commented 1 year ago

Here is the summary of pycodestyle on the code base (6 January 2023) ; this does not look very nice.

28 E101 indentation contains mixed spaces and tabs 9 E111 indentation is not a multiple of 4 14 E114 indentation is not a multiple of 4 (comment) 1 E115 expected an indented block (comment) 4 E116 unexpected indentation (comment) 5 E117 over-indented 11 E121 continuation line under-indented for hanging indent 40 E122 continuation line missing indentation or outdented 80 E123 closing bracket does not match indentation of opening bracket's line 36 E124 closing bracket does not match visual indentation 28 E125 continuation line with same indent as next logical line 121 E126 continuation line over-indented for hanging indent 96 E127 continuation line over-indented for visual indent 509 E128 continuation line under-indented for visual indent 27 E129 visually indented line with same indent as next logical line 25 E131 continuation line unaligned for hanging indent 1701 E201 whitespace after '[' 1505 E202 whitespace before ']' 1134 E203 whitespace before ':' 15 E211 whitespace before '(' 284 E221 multiple spaces before operator 67 E222 multiple spaces after operator 157 E225 missing whitespace around operator 1588 E226 missing whitespace around arithmetic operator 13 E227 missing whitespace around bitwise or shift operator 198 E228 missing whitespace around modulo operator 2945 E231 missing whitespace after ':' 167 E241 multiple spaces after ',' 6304 E251 unexpected spaces around keyword / parameter equals 300 E261 at least two spaces before inline comment 18 E262 inline comment should start with '# ' 223 E265 block comment should start with '# ' 101 E266 too many leading '#' for block comment 30 E271 multiple spaces after keyword 29 E272 multiple spaces before keyword 62 E301 expected 1 blank line, found 0 1940 E302 expected 2 blank lines, found 1 176 E303 too many blank lines (3) 227 E305 expected 2 blank lines after class or function definition, found 1 7 E306 expected 1 blank line before a nested definition, found 0 54 E401 multiple imports on one line 83 E402 module level import not at top of file 4 E502 the backslash is redundant between brackets 33 E701 multiple statements on one line (colon) 2 E703 statement ends with a semicolon 2 E704 multiple statements on one line (def) 87 E714 test for object identity should be 'is not' 1 E721 do not compare types, use 'isinstance()' 72 E722 do not use bare 'except' 24 E731 do not assign a lambda expression, use a def 4 E743 ambiguous function definition 'I' 1349 W191 indentation contains tabs 255 W291 trailing whitespace 946 W293 blank line contains whitespace 47 W391 blank line at end of file 60 W605 invalid escape sequence '\e'

fchapoton commented 1 year ago

and restricted to twister/

14 E101 indentation contains mixed spaces and tabs 2 E123 closing bracket does not match indentation of opening bracket's line 1 E201 whitespace after '[' 77 E226 missing whitespace around arithmetic operator 4 E231 missing whitespace after ':' 6 E251 unexpected spaces around keyword / parameter equals 1 E261 at least two spaces before inline comment 2 E266 too many leading '#' for block comment 10 E302 expected 2 blank lines, found 1 1 E303 too many blank lines (2) 1 E305 expected 2 blank lines after class or function definition, found 1 16 E701 multiple statements on one line (colon) 1 E703 statement ends with a semicolon 1 E704 multiple statements on one line (def) 645 W191 indentation contains tabs 13 W291 trailing whitespace 117 W293 blank line contains whitespace

fchapoton commented 1 year ago

a good first step would be through #85

fchapoton commented 1 year ago

the only part that we can change here is python/

Here is what remains in this folder after the recent wave of fixes, following the use of a linter workflow:

4       E121 continuation line under-indented for hanging indent
12      E122 continuation line missing indentation or outdented
34      E123 closing bracket does not match indentation of opening bracket's line
14      E124 closing bracket does not match visual indentation
14      E125 continuation line with same indent as next logical line
43      E126 continuation line over-indented for hanging indent
42      E127 continuation line over-indented for visual indent
160     E128 continuation line under-indented for visual indent
10      E129 visually indented line with same indent as next logical line
12      E131 continuation line unaligned for hanging indent
729     E201 whitespace after '['
647     E202 whitespace before ']'
528     E203 whitespace before ':'
108     E221 multiple spaces before operator
58      E225 missing whitespace around operator
601     E226 missing whitespace around arithmetic operator
1239    E231 missing whitespace after ','
64      E241 multiple spaces after ','
2688    E251 unexpected spaces around keyword / parameter equals
133     E261 at least two spaces before inline comment
50      E265 block comment should start with '# '
41      E266 too many leading '#' for block comment
21      E402 module level import not at top of file
2       E502 the backslash is redundant between brackets
40      E714 test for object identity should be 'is not'
26      E722 do not use bare 'except'
10      E731 do not assign a lambda expression, use a def
2       E743 ambiguous function definition 'I'
fchapoton commented 1 year ago

new summary for python/ as of 25th of June 2023

12      E122 continuation line missing indentation or outdented
33      E123 closing bracket does not match indentation of opening bracket's line
15      E124 closing bracket does not match visual indentation
13      E125 continuation line with same indent as next logical line
42      E126 continuation line over-indented for hanging indent
44      E127 continuation line over-indented for visual indent
170     E128 continuation line under-indented for visual indent
10      E129 visually indented line with same indent as next logical line
11      E131 continuation line unaligned for hanging indent
715     E201 whitespace after '['
643     E202 whitespace before ']'
519     E203 whitespace before ':'
1       E221 multiple spaces before operator
600     E226 missing whitespace around arithmetic operator
1237    E231 missing whitespace after ','
2       E241 multiple spaces after ','
132     E261 at least two spaces before inline comment
25      E302 expected 2 blank lines, found 1
3       E305 expected 2 blank lines after class or function definition, found 1
21      E402 module level import not at top of file
2       E502 the backslash is redundant between brackets
1       E703 statement ends with a semicolon
26      E722 do not use bare 'except'
10      E731 do not assign a lambda expression, use a def
2       E743 ambiguous function definition 'I'
2       W291 trailing whitespace
5       W293 blank line contains whitespace
1       W391 blank line at end of file