aokellermann/securedrop

Linter

Opened this issue · 2 comments

Description

To maintain good code quality, we should have a linter to perform static analysis on our python code. This issue has 3 steps:

  • Pick a linter and comment on this issue why you picked it, until we all agree to use it.
  • Write a bash script (/scripts/lint.sh) to return a non-zero exit code if the code has any errors.
  • Create a CI step to check the code for linting errors.

I've been looking at pylint. Seems to be widely used.. It has style and error checking. it says it's easily customizable to only show desired messages or level of detail. Although I haven't tried changing the default behavior yet.

https://docs.pylint.org/en/1.6.0/index.html

Going with pylint. Settings: column width = 120, Suppress docstring warnings.