This repository was archived by the owner on Jul 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +19
-12
lines changed Expand file tree Collapse file tree 3 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ def reset(self):
29
29
self .issues = defaultdict (list )
30
30
self .failed_run = set ()
31
31
self .failed_setup = set ()
32
+ self .skipped = set ()
32
33
self .suppressed_warnings = defaultdict (int )
33
34
self .fixed = 0
34
35
@@ -71,6 +72,7 @@ def update(self, other):
71
72
72
73
self .failed_run |= other .failed_run
73
74
self .failed_setup |= other .failed_setup
75
+ self .skipped |= other .skipped
74
76
self .fixed += other .fixed
75
77
for k , v in other .suppressed_warnings .items ():
76
78
self .suppressed_warnings [k ] += v
Original file line number Diff line number Diff line change @@ -231,8 +231,11 @@ def setup(self, virtualenv_manager=None):
231
231
if virtualenv_manager is not None :
232
232
setupargs ["virtualenv_manager" ] = virtualenv_manager
233
233
start_time = time .monotonic ()
234
- res = findobject (linter ["setup" ])(
235
- ** setupargs ,
234
+ res = (
235
+ findobject (linter ["setup" ])(
236
+ ** setupargs ,
237
+ )
238
+ or 0
236
239
)
237
240
self .log .debug (
238
241
f"setup for { linter ['name' ]} finished in "
@@ -242,18 +245,22 @@ def setup(self, virtualenv_manager=None):
242
245
traceback .print_exc ()
243
246
res = 1
244
247
245
- if res :
248
+ if res > 0 :
246
249
self .result .failed_setup .add (linter ["name" ])
250
+ self .result .skipped .add (linter ["name" ])
251
+ elif res < 0 :
252
+ # Negative return code means the linter should be skipped for
253
+ # reasons other than a failure.
254
+ self .result .skipped .add (linter ["name" ])
255
+
256
+ self .linters = [l for l in self .linters if l ["name" ] not in self .result .skipped ]
247
257
248
258
if self .result .failed_setup :
249
259
print (
250
260
"error: problem with lint setup, skipping {}" .format (
251
261
", " .join (sorted (self .result .failed_setup ))
252
262
)
253
263
)
254
- self .linters = [
255
- l for l in self .linters if l ["name" ] not in self .result .failed_setup
256
- ]
257
264
return 1
258
265
return 0
259
266
Original file line number Diff line number Diff line change 31
31
32
32
def setup (root , ** setupargs ):
33
33
if setupargs .get ("substs" , {}).get ("MOZ_BUILD_APP" ) != "mobile/android" :
34
- return 1
34
+ return - 1
35
35
36
36
if "topobjdir" not in setupargs :
37
- print (
38
- "Skipping {}: a configured Android build is required!" .format (
39
- setupargs ["name" ]
40
- )
37
+ setupargs ["log" ].debug (
38
+ f"Skipping { setupargs ['name' ]} : a configured Android build is required!"
41
39
)
42
- return 1
40
+ return - 1
43
41
44
42
return 0
45
43
You can’t perform that action at this time.
0 commit comments