Feature #5292
closedlinter: check python code too
0%
Description
dexter asked if we could lint python code too. Adding this issue for future reference.
We could use e.g. flake8, to conform to the official python style guide, if it is installed: https://www.python.org/dev/peps/pep-0008/
(With some checks disabled that we don't follow in Osmocom python code, for example max line length of 79 characters or always having two empty lines between functions.)
Updated by fixeria over 2 years ago
- Status changed from New to Feedback
Hey Oliver,
We could use e.g. flake8, to conform to the official python style guide, if it is installed: [...]
we already employ pylint in contrib/jenkins.sh, so I submitted a patch enabling W0301 (unnecessary semicolon):
https://gerrit.osmocom.org/c/pysim/+/26123 contrib/jenkins.sh: make pylint warn about unnecessary semicolon [NEW]
and it seems to work:
https://jenkins.osmocom.org/jenkins/job/gerrit-pysim/1557/
************* Module pySim.utils pySim/utils.py:136:0: W0301: Unnecessary semicolon (unnecessary-semicolon) pySim/utils.py:246:0: W0301: Unnecessary semicolon (unnecessary-semicolon) ************* Module pySim-shell pySim-shell.py:75:0: W0301: Unnecessary semicolon (unnecessary-semicolon) pySim-shell.py:78:0: W0301: Unnecessary semicolon (unnecessary-semicolon) pySim-shell.py:83:0: W0301: Unnecessary semicolon (unnecessary-semicolon) pySim-shell.py:210:0: W0301: Unnecessary semicolon (unnecessary-semicolon) pySim-shell.py:355:0: W0301: Unnecessary semicolon (unnecessary-semicolon) Build step 'Execute shell' marked build as failure
Updated by osmith over 2 years ago
- Status changed from Feedback to Closed
Nice, thanks! Closing this issue then.