Bug 1155 - Run pychecker on python code in ThinLinc
Summary: Run pychecker on python code in ThinLinc
Status: ASSIGNED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Other (show other bugs)
Version: trunk
Hardware: PC Linux
: P2 Normal
Target Milestone: MediumPrio
Assignee: Pierre Ossman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-04 14:44 CET by Erik Forsberg
Modified: 2020-05-08 09:01 CEST (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Erik Forsberg cendio 2005-03-04 14:44:49 CET
We should run pychecker on the python code i ThinLinc.
Comment 1 Erik Forsberg cendio 2005-03-07 11:31:39 CET
There are several problems associated with running pychecker om the current
ThinLinc codebase. See 185113 in komintern with discussion.

I've created a program that creates a symlink farm to run pychecker on, so
programs with filenames not ending with .py can be checked.

I've fixed some serious errors, but to decrease the number of errors reported by
pychecker significantly, more code modification than I want to do right before a
release is required. 

Code must be moved into modules, a lot of programs should init their global
variables differently, we should check __name__ to see if it is '__main__' etc. 

I'll retarget this bug for 1.4.1, so we can do more about the problems during
development of that release.
Comment 2 Erik Forsberg cendio 2005-03-07 13:13:07 CET
Bah! Forgot to retarget.
Comment 3 Karl Mikaelsson cendio 2017-03-20 13:03:25 CET
FWIW: Here's what pycodestyle-2.0.0 reports for Python files in ctc/ (r32311):

> $ pycodestyle --statistics -qq <python-files>

> Num     Error
> 3762    E501 line too long (x > 79 characters)
> 3250    E231 missing whitespace after ','
> 1888    W293 blank line contains whitespace
> 1573    E302 expected 2 blank lines, found 1
> 1524    W191 indentation contains tabs
> 1430    W291 trailing whitespace
> 1244    E251 unexpected spaces around keyword / parameter equals
> 1137    E225 missing whitespace around operator
> 841     E101 indentation contains mixed spaces and tabs
> 781     E303 too many blank lines (2)
> 561     E202 whitespace before ']'
> 560     E201 whitespace after '['
> 527     E402 module level import not at top of file
> 518     E203 whitespace before ':'
> 447     E261 at least two spaces before inline comment
> 386     E128 continuation line under-indented for visual indent
> 359     W601 .has_key() is deprecated, use 'in'
> 329     E111 indentation is not a multiple of four
> 305     E703 statement ends with a semicolon
> 299     E701 multiple statements on one line (colon)
> 276     E265 block comment should start with '# '
> 241     E266 too many leading '#' for block comment
> 221     E221 multiple spaces before operator
> 215     E502 the backslash is redundant between brackets
> 203     E301 expected 1 blank line, found 0
> 173     E711 comparison to None should be 'if cond is not None:'
> 165     E127 continuation line over-indented for visual indent
> 128     E122 continuation line missing indentation or outdented
> 127     W391 blank line at end of file
> 121     E228 missing whitespace around modulo operator
> 88      E211 whitespace before '('
> 71      W602 deprecated form of raising exception
> 68      E401 multiple imports on one line
> 61      E222 multiple spaces after operator
> 52      E702 multiple statements on one line (semicolon)
> 50      E712 comparison to False should be 'if cond is False:' or 'if not cond:'
> 47      E731 do not assign a lambda expression, use a def
> 46      E227 missing whitespace around bitwise or shift operator
> 46      E113 unexpected indentation
> 43      E721 do not compare types, use 'isinstance()'
> 36      E272 multiple spaces before keyword
> 35      W604 backticks are deprecated, use 'repr()'
> 31      E262 inline comment should start with '# '
> 30      W603 '<>' is deprecated, use '!='
> 24      E131 continuation line unaligned for hanging indent
> 23      E713 test for membership should be 'not in'
> 22      E271 multiple spaces after keyword
> 22      E112 expected an indented block
> 20      E125 continuation line with same indent as next logical line
> 18      E124 closing bracket does not match visual indentation
> 16      E115 expected an indented block (comment)
> 12      E114 indentation is not a multiple of four (comment)
> 7       E116 unexpected indentation (comment)
> 6       E901 TokenError: EOF in multi-line statement
> 6       E129 visually indented line with same indent as next logical line
> 1       W292 no newline at end of file
> 1       E714 test for object identity should be 'is not'
> 1       E304 blank lines found after function decorator
> 1       E224 tab after operator
Comment 4 Karl Mikaelsson cendio 2017-06-01 15:39:58 CEST
Unused imports:

http://git.cendio.se/cgit/~derfian/thinlinc.git/log/?h=flake8-unused-imports

Found by running flake8 on our source tree

Note You need to log in before you can comment on or make changes to this bug.