forked from gitpython-developers/GitPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit 41d22b2
committed
Overhaul noqa directives
- Remove some noqa directives that are not needed at all anymore.
But there may still be some others I did not find.
- Fix the code and remove the noqa direcive in places where the
change is very simple and does not affect the interface (e.g.,
what could be taken to be public or not, what symbols are
available and what they refer to, etc.), the change makes the
code more idiomatic or clearer, and it fixes the flake8 complaint
completely.
- Turn file-level noqa directives into statement-level ones. A noqa
directive at file level, even if it lists one or more specific
error/warning numbers, actually suppresses flake8 for the entire
file. So the main benefit here is to enable other warnings. But
this also makes it clear what is producing the ones we suppress,
which makes it easier to know what is intentional and how it may
be reasonable to change it in the future.
- Move noqa directives at the end of multi-line imports to the top
line, where flake8 honors them, and eliminate redundant
directives that were added to work around their ineffectiveness.
(This is not really separate from the above point, since this is
often what allowed file-level directives to be removed.)
- Specify the errors/warnings each "noqa" should suppress. That is,
this turns every bare "noqa", aside from those eliminated as
described above, into a "noqa" for one or more specific
errors/warnings. This makes the intent clearer and avoids
oversuppression.
- Add missing ":" between "noqa" and error/warning numbers. When
these were absent, the intention was to suppress only the
specifically listed errors/warnings, but the effect was that the
listed numbers were ignored and *everything* was suppressed. In a
couple of cases it was necessary to change the listed numbers to
correct the list to what actually needed to be suppressed.
- Write every "noqa" in lower-case (not "NOQA"). There did not
appear to be a systematic reason for the different casing, and
having them all cased the same makes it easier to avoid mistakes
when grepping for them.
- Where an import is unused and does not appear intended to be
accesed from other modules, and is present only to support code
in the same module that is commented out, but whose removal
should be considered separately, comment out the statement or
part of the statement that imports it as well, rather than
writing a "noqa" for the unused import. This applies to only one
file, git/objects/util.py.1 parent cf5cb84 commit 41d22b2
File tree
21 files changed
+75
-95
lines changed- git
- index
- objects
- refs
- repo
- test
- lib
21 files changed
+75
-95
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 | - | ||
7 | 6 |
| |
8 | 7 |
| |
9 | - | ||
10 | - | ||
11 | - | ||
12 | - | ||
13 | 8 |
| |
14 | 9 |
| |
10 | + | ||
11 | + | ||
15 | 12 |
| |
13 | + | ||
14 | + | ||
16 | 15 |
| |
17 | 16 |
| |
18 | 17 |
| |
19 | 18 |
| |
20 | - | ||
21 | - | ||
22 | - | ||
23 | - | ||
19 | + | ||
20 | + | ||
21 | + | ||
22 | + | ||
24 | 23 |
| |
25 | 24 |
| |
26 | - | ||
27 | - | ||
25 | + | ||
26 | + | ||
28 | 27 |
| |
29 | 28 |
| |
30 | 29 |
| |
| |||
33 | 32 |
| |
34 | 33 |
| |
35 | 34 |
| |
36 | - | ||
35 | + | ||
37 | 36 |
| |
38 | 37 |
| |
39 | 38 |
| |
40 | 39 |
| |
41 | - | ||
40 | + | ||
42 | 41 |
| |
43 | 42 |
| |
44 | 43 |
| |
| |||
127 | 126 |
| |
128 | 127 |
| |
129 | 128 |
| |
130 | - | ||
129 | + | ||
131 | 130 |
| |
132 | 131 |
| |
133 | 132 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
965 | 965 |
| |
966 | 966 |
| |
967 | 967 |
| |
968 | - | ||
968 | + | ||
969 | 969 |
| |
970 | 970 |
| |
971 | 971 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 | - | ||
9 | - | ||
10 | 8 |
| |
11 | 9 |
| |
12 | 10 |
| |
13 | 11 |
| |
14 | - | ||
15 | - | ||
16 | - | ||
17 | - | ||
12 | + | ||
18 | 13 |
| |
19 | 14 |
| |
20 | 15 |
| |
21 | - | ||
16 | + | ||
22 | 17 |
| |
23 | 18 |
| |
24 | 19 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 | - | ||
7 | - | ||
8 | - | ||
9 | - | ||
6 | + | ||
7 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 | - | ||
7 | - | ||
8 | 6 |
| |
9 | 7 |
| |
10 | - | ||
11 | - | ||
12 | - | ||
8 | + | ||
9 | + | ||
10 | + | ||
13 | 11 |
| |
14 | - | ||
15 | - | ||
16 | - | ||
17 | - | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + | ||
18 | 16 |
| |
19 | 17 |
| |
20 | 18 |
| |
21 | - | ||
22 | - | ||
19 | + | ||
20 | + | ||
23 | 21 |
| |
24 | 22 |
| |
25 | 23 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 | - | ||
9 | - | ||
10 | - | ||
11 | 8 |
| |
12 | - | ||
13 | - | ||
14 | - | ||
15 | - | ||
9 | + | ||
16 | 10 |
| |
17 | - | ||
11 | + | ||
18 | 12 |
| |
13 | + | ||
19 | 14 |
| |
20 | - | ||
21 | - | ||
15 | + | ||
16 | + | ||
17 | + | ||
22 | 18 |
| |
23 | 19 |
| |
24 | 20 |
| |
25 | 21 |
| |
26 | 22 |
| |
27 | 23 |
| |
28 | 24 |
| |
29 | - | ||
25 | + | ||
30 | 26 |
| |
31 | 27 |
| |
32 | - | ||
28 | + | ||
33 | 29 |
| |
34 | 30 |
| |
35 | 31 |
| |
| |||
38 | 34 |
| |
39 | 35 |
| |
40 | 36 |
| |
41 | - | ||
37 | + | ||
42 | 38 |
| |
43 | 39 |
| |
44 | 40 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 | - | ||
5 | 4 |
| |
6 | 5 |
| |
7 | - | ||
8 | - | ||
9 | - | ||
10 | - | ||
11 | - | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + | ||
10 | + | ||
12 | 11 |
| |
13 | - | ||
12 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
34 | - | ||
35 | 34 |
| |
36 | - | ||
35 | + | ||
36 | + | ||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 | - | ||
14 | - | ||
13 | + | ||
14 | + | ||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 | - | ||
5 | 4 |
| |
6 | 5 |
| |
7 | 6 |
| |
| |||
31 | 30 |
| |
32 | 31 |
| |
33 | 32 |
| |
34 | - | ||
35 | - | ||
33 | + | ||
34 | + | ||
36 | 35 |
| |
37 | 36 |
| |
38 | 37 |
| |
|
0 commit comments