Project

General

Profile

Actions

Feature #5292

closed

linter: check python code too

Added by osmith over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Low
Assignee:
Target version:
-
Start date:
11/05/2021
Due date:
% Done:

0%

Spec Reference:

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.)

Actions #1

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
Actions #2

Updated by osmith over 2 years ago

  • Status changed from Feedback to Closed

Nice, thanks! Closing this issue then.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)