Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork939
Commit41d22b2
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 parentcf5cb84 commit41d22b2
File tree
21 files changed
+75
-95
lines changed- git
- index
- objects
- refs
- repo
- test
- lib
21 files changed
+75
-95
lines changedLines changed: 13 additions & 14 deletions
Original 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 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
965 | 965 |
| |
966 | 966 |
| |
967 | 967 |
| |
968 |
| - | |
| 968 | + | |
969 | 969 |
| |
970 | 970 |
| |
971 | 971 |
| |
|
Lines changed: 2 additions & 7 deletions
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 |
| |
|
Lines changed: 2 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
7 |
| - | |
8 |
| - | |
9 |
| - | |
| 6 | + | |
| 7 | + |
Lines changed: 9 additions & 11 deletions
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 |
| |
|
Lines changed: 9 additions & 13 deletions
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 |
| |
|
Lines changed: 6 additions & 7 deletions
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 | + |
Lines changed: 2 additions & 2 deletions
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 |
| |
|
Lines changed: 2 additions & 2 deletions
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 |
| |
|
Lines changed: 2 additions & 3 deletions
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 |
| |
|
Lines changed: 1 addition & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
7 |
| - | |
8 |
| - | |
| 6 | + |
Lines changed: 6 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 |
| - | |
5 |
| - | |
6 | 4 |
| |
7 | 5 |
| |
8 |
| - | |
| 6 | + | |
9 | 7 |
| |
10 | 8 |
| |
11 | 9 |
| |
| |||
16 | 14 |
| |
17 | 15 |
| |
18 | 16 |
| |
19 |
| - | |
| 17 | + | |
20 | 18 |
| |
21 | 19 |
| |
22 |
| - | |
| 20 | + | |
23 | 21 |
| |
24 | 22 |
| |
25 | 23 |
| |
26 | 24 |
| |
27 | 25 |
| |
28 |
| - | |
| 26 | + | |
29 | 27 |
| |
30 |
| - | |
| 28 | + | |
31 | 29 |
| |
32 | 30 |
| |
33 | 31 |
| |
34 | 32 |
| |
35 | 33 |
| |
36 |
| - | |
| 34 | + | |
37 | 35 |
| |
38 | 36 |
| |
39 | 37 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
62 | 62 |
| |
63 | 63 |
| |
64 | 64 |
| |
65 |
| - | |
66 |
| - | |
67 |
| - | |
68 | 65 |
| |
69 | 66 |
| |
70 |
| - | |
| 67 | + | |
71 | 68 |
| |
72 | 69 |
| |
73 | 70 |
| |
| |||
79 | 76 |
| |
80 | 77 |
| |
81 | 78 |
| |
| 79 | + | |
| 80 | + | |
| 81 | + | |
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
7 | 6 |
| |
8 |
| - | |
| 7 | + | |
| 8 | + | |
9 | 9 |
| |
10 | 10 |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
145 | 145 |
| |
146 | 146 |
| |
147 | 147 |
| |
148 |
| - | |
| 148 | + | |
149 | 149 |
| |
150 | 150 |
| |
151 | 151 |
| |
| |||
305 | 305 |
| |
306 | 306 |
| |
307 | 307 |
| |
308 |
| - | |
| 308 | + | |
309 | 309 |
| |
310 | 310 |
| |
311 | 311 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
475 | 475 |
| |
476 | 476 |
| |
477 | 477 |
| |
478 |
| - | |
| 478 | + | |
479 | 479 |
| |
480 | 480 |
| |
481 | 481 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
125 | 125 |
| |
126 | 126 |
| |
127 | 127 |
| |
128 |
| - | |
| 128 | + | |
129 | 129 |
| |
130 | 130 |
| |
131 | 131 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
28 |
| - | |
| 28 | + | |
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
|
0 commit comments
Comments
(0)