1 |
Hi, |
2 |
|
3 |
Recently I've begun to run pylint on the portage codebase. You can see some |
4 |
recent PRs on this[0][1][2]. Most of the linter errors I've fixed are what |
5 |
I consider 'fairly trivial'. In general I'm happy to disable errors (or |
6 |
instances of errors) in addition to resolving them. You can see some of |
7 |
this in https://github.com/gentoo/portage/pull/593/files where we just |
8 |
blanket disable a bunch of very numerous messages (either because I don't |
9 |
expect to ever fix them, or because they are more work that I think we |
10 |
should do at the moment.) |
11 |
|
12 |
So I see essentially a few choices: |
13 |
- (a) Do we fix errors in certain classes and run the linter as part of |
14 |
CI. This means that once we resolve errors of a certain class, we can |
15 |
enable that class of check and prevent new occurrences. |
16 |
- (b) Do we just avoid running the linter as part of CI (perhaps because |
17 |
we are not far enough along on this journey) and focus our efforts to get |
18 |
to a point where we can do (a) without spamming CI? |
19 |
- (c) What messages should we bother not fixing at all so we can just not |
20 |
work on those classes of error? |
21 |
|
22 |
As an example of (c); I believe 'protected-access' is likely intrusive to |
23 |
fix and pointless for portage (cat is out of the bag) where as a message |
24 |
like W0612(unused-variable) is plausibly something we should fix |
25 |
throughout the codebase. Similarly I think "E0602(undefined-variable)" is |
26 |
often a bug in how pylint treats our lazy initialized variables, so most of |
27 |
these are false positives. |
28 |
|
29 |
I think getting these messages recorded will also enable other people |
30 |
besides me to fix them (I know b-man said he was interested.) Curious to |
31 |
hear thought on this. |
32 |
|
33 |
-A |
34 |
|
35 |
[0] |
36 |
https://gitweb.gentoo.org/proj/portage.git/commit/?id=49794e185350f0f9c8099ff84507873685b2b0f1 |
37 |
[1] |
38 |
https://gitweb.gentoo.org/proj/portage.git/commit/?id=550727af87d5f646617e0c19a3f3300c8117e7f5 |
39 |
[2] |
40 |
https://gitweb.gentoo.org/proj/portage.git/commit/?id=be20b37180f709ab0e451e4e07b6e82ac3a87b56 |