improve coding style
flake8 reports a lot of coding style violations
flake8 | wc -l
366
While some can be safely ignored (E501 line too long
, E128 continuation line under-indented for visual indent
, ...), others are more dangerous :
# indentation problem :
# E111 indentation is not a multiple of four
flake8 | grep E111 | wc -l
13
flake8 does not report the pokemon exception handling, but swallowing all exceptions is not a good practice (and can be dangerous, as will handle any exception, like, for example, undefined variable (NameError
))
-
bt.py#L27
(should except
KeyError
or at leastException
) -
bt.py#L34 (should except
KeyError
or at leastException
) -
bt.py#L43 (should except
KeyError
or at leastException
) -
views.py#L60 (should except
Violation.DoesNotExists
or at leastException
) -
views.py#L84 (should except
Violation.DoesNotExists
or at leastException
)
Other result from flake8 can help to keep the codebase clean (ex : unused imports or common pep8 violations)
# unused imports
flake8 | grep F401 | wc -l
35
Note : tools like autopep8 or yapf can help with common pep8 errors automagically.
I propose myself to do the dirty job, but this kind of merge request is likely to generate conflicts :)