Project

General

Profile

Actions

Architecture #12636

closed

Use pylint to verify python code

Added by François ARMAND almost 6 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
N/A
Category:
Packaging
Target version:
Effort required:
Name check:
Fix check:
Regression:

Description

We have a ton of problems due to python lack of static checks. We have typos (), we have missing imports (#12633), and this has dire consequences in production.

For example, #12633 could have been avoided without any special configuration:

% sudo pacman -S python-pylint
...
% pylint --disable=I,R,C,W ncf                                                                                      [18-05-16 11:16:19]
No config file found, using default configuration
************* Module ncf
E: 62,87: Using variable 'technique' before assignment (used-before-assignment)
E: 71,23: Class 'traceback' has no 'format_exc' member (no-member)
E: 71,23: Undefined variable 'traceback' (undefined-variable)

------------------------------------------------------------------
Your code has been rated at 7.79/10 (previous run: 7.79/10, +0.00)

We need to force use pylint in any python code before a release. The best place seems to be in CI. The ticket project should be changed if needed, depending on the implemented solution.


Subtasks 8 (0 open8 closed)

Architecture #12639: Use pylint to verify python code in ncfReleasedBenoît PECCATTEActions
Architecture #12640: Fix pylint error in ncf 4.1ReleasedBenoît PECCATTEActions
Architecture #12651: Fix pylint error in ncf 4.3ReleasedVincent MEMBRÉActions
Architecture #12641: Use pylint to verify python code in relayReleasedBenoît PECCATTEActions
Architecture #12642: Fix pylint error in relay codeReleasedVincent MEMBRÉActions
Architecture #12652: Fix pylint error in relay codeReleasedVincent MEMBRÉActions
Architecture #12655: Use pylint to verify python code in rudder repoReleasedVincent MEMBRÉActions
Architecture #12656: Use pylint to verify python code in rudder-pluginsReleasedBenoît PECCATTEActions
Actions

Also available in: Atom PDF