-
Notifications
You must be signed in to change notification settings - Fork 25
/
out
457 lines (413 loc) · 14.8 KB
/
out
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
busylight/__main__.py:52:32: F841 [*] Local variable `error` is assigned to but never used
|
50 | try:
51 | return parse_color_string(value, ctx.obj.dim)
52 | except ColorLookupError as error:
| ^^^^^ F841
53 | typer.secho(f"No color match for '{value}'", fg="red")
54 | raise typer.Exit(code=1) from None
|
= help: Remove assignment to unused variable `error`
busylight/__main__.py:154:29: F841 [*] Local variable `error` is assigned to but never used
|
152 | except (KeyboardInterrupt, TimeoutError):
153 | manager.off(ctx.obj.lights)
154 | except NoLightsFound as error:
| ^^^^^ F841
155 | typer.secho("No lights to turn on.", fg="red")
156 | raise typer.Exit() from None
|
= help: Remove assignment to unused variable `error`
busylight/__main__.py:165:29: F841 [*] Local variable `error` is assigned to but never used
|
163 | try:
164 | manager.off(ctx.obj.lights)
165 | except NoLightsFound as error:
| ^^^^^ F841
166 | typer.secho("No lights to turn off.", fg="red")
|
= help: Remove assignment to unused variable `error`
busylight/__main__.py:189:29: F841 [*] Local variable `error` is assigned to but never used
|
187 | except (KeyboardInterrupt, TimeoutError):
188 | manager.off(ctx.obj.lights)
189 | except NoLightsFound as error:
| ^^^^^ F841
190 | typer.secho("Unable to blink lights.", fg="red")
191 | raise typer.Exit(code=1) from None
|
= help: Remove assignment to unused variable `error`
busylight/__main__.py:210:29: F841 [*] Local variable `error` is assigned to but never used
|
208 | except (KeyboardInterrupt, TimeoutError):
209 | manager.off(ctx.obj.lights)
210 | except NoLightsFound as error:
| ^^^^^ F841
211 | typer.secho(f"No rainbow for you.", fg="red")
212 | raise typer.Exit(code=1) from None
|
= help: Remove assignment to unused variable `error`
busylight/__main__.py:211:21: F541 [*] f-string without any placeholders
|
209 | manager.off(ctx.obj.lights)
210 | except NoLightsFound as error:
211 | typer.secho(f"No rainbow for you.", fg="red")
| ^^^^^^^^^^^^^^^^^^^^^^ F541
212 | raise typer.Exit(code=1) from None
|
= help: Remove extraneous `f` prefix
busylight/__main__.py:230:29: F841 [*] Local variable `error` is assigned to but never used
|
228 | except (KeyboardInterrupt, TimeoutError):
229 | manager.off(ctx.obj.lights)
230 | except NoLightsFound as error:
| ^^^^^ F841
231 | typer.secho(f"Unable to pulse lights.", fg="red")
232 | raise typer.Exit(code=1) from None
|
= help: Remove assignment to unused variable `error`
busylight/__main__.py:231:21: F541 [*] f-string without any placeholders
|
229 | manager.off(ctx.obj.lights)
230 | except NoLightsFound as error:
231 | typer.secho(f"Unable to pulse lights.", fg="red")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ F541
232 | raise typer.Exit(code=1) from None
|
= help: Remove extraneous `f` prefix
busylight/__main__.py:258:29: F841 [*] Local variable `error` is assigned to but never used
|
256 | except (KeyboardInterrupt, TimeoutError):
257 | manager.off(ctx.obj.lights)
258 | except NoLightsFound as error:
| ^^^^^ F841
259 | typer.secho(f"Unable to flash lights impressively.", fg="red")
260 | raise typer.Exit(code=1) from None
|
= help: Remove assignment to unused variable `error`
busylight/__main__.py:259:21: F541 [*] f-string without any placeholders
|
257 | manager.off(ctx.obj.lights)
258 | except NoLightsFound as error:
259 | typer.secho(f"Unable to flash lights impressively.", fg="red")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F541
260 | raise typer.Exit(code=1) from None
|
= help: Remove extraneous `f` prefix
busylight/__main__.py:296:29: F841 [*] Local variable `error` is assigned to but never used
|
294 | continue
295 | typer.secho(v, fg="green")
296 | except NoLightsFound as error:
| ^^^^^ F841
297 | typer.secho(f"No lights detected.", fg="red")
298 | raise typer.Exit(code=1) from None
|
= help: Remove assignment to unused variable `error`
busylight/__main__.py:297:21: F541 [*] f-string without any placeholders
|
295 | typer.secho(v, fg="green")
296 | except NoLightsFound as error:
297 | typer.secho(f"No lights detected.", fg="red")
| ^^^^^^^^^^^^^^^^^^^^^^ F541
298 | raise typer.Exit(code=1) from None
|
= help: Remove extraneous `f` prefix
busylight/api/__init__.py:7:21: F401 `.models.EndPoint` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
|
6 | from .busylight_api import busylightapi
7 | from .models import EndPoint, LightDescription, LightOperation
| ^^^^^^^^ F401
8 |
9 | __all__ = ["busylightapi"]
|
= help: Add unused import `EndPoint` to __all__
busylight/api/__init__.py:7:31: F401 `.models.LightDescription` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
|
6 | from .busylight_api import busylightapi
7 | from .models import EndPoint, LightDescription, LightOperation
| ^^^^^^^^^^^^^^^^ F401
8 |
9 | __all__ = ["busylightapi"]
|
= help: Add unused import `LightDescription` to __all__
busylight/api/__init__.py:7:49: F401 `.models.LightOperation` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
|
6 | from .busylight_api import busylightapi
7 | from .models import EndPoint, LightDescription, LightOperation
| ^^^^^^^^^^^^^^ F401
8 |
9 | __all__ = ["busylightapi"]
|
= help: Add unused import `LightOperation` to __all__
busylight/api/busylight_api.py:83:13: E712 Avoid equality comparisons to `True`; use `if global_options.debug:` for truth checks
|
81 | )
82 |
83 | if (global_options.debug == True) and (self.origins == None):
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E712
84 | logger.info(
85 | 'However, debug mode is enabled! Using debug mode CORS allowed origins: \'["http://localhost", "http://127.0.0.1"]\''
|
= help: Replace with `global_options.debug`
busylight/api/busylight_api.py:83:64: E711 Comparison to `None` should be `cond is None`
|
81 | )
82 |
83 | if (global_options.debug == True) and (self.origins == None):
| ^^^^ E711
84 | logger.info(
85 | 'However, debug mode is enabled! Using debug mode CORS allowed origins: \'["http://localhost", "http://127.0.0.1"]\''
|
= help: Replace with `cond is None`
busylight/api/busylight_api.py:171:25: F841 [*] Local variable `error` is assigned to but never used
|
169 | try:
170 | await busylightapi.off()
171 | except Exception as error:
| ^^^^^ F841
172 | logger.debug("problem during shutdown: {error}")
|
= help: Remove assignment to unused variable `error`
busylight/color.py:4:20: F401 [*] `typing.List` imported but unused
|
2 | """
3 |
4 | from typing import List, Tuple
| ^^^^ F401
5 |
6 | import webcolors
|
= help: Remove unused import: `typing.List`
busylight/effects/blink.py:4:23: F401 [*] `itertools.cycle` imported but unused
|
2 | """
3 |
4 | from itertools import cycle
| ^^^^^ F401
5 | from typing import List, Tuple
|
= help: Remove unused import: `itertools.cycle`
busylight/effects/gradient.py:5:23: F401 [*] `itertools.cycle` imported but unused
|
5 | from itertools import cycle
| ^^^^^ F401
6 | from typing import List, Tuple
|
= help: Remove unused import: `itertools.cycle`
busylight/effects/spectrum.py:6:23: F401 [*] `itertools.cycle` imported but unused
|
4 | import math
5 |
6 | from itertools import cycle
| ^^^^^ F401
7 | from typing import List, Tuple
|
= help: Remove unused import: `itertools.cycle`
busylight/lights/__init__.py:60:5: F401 `.exceptions.InvalidLightInfo` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
|
59 | from .exceptions import (
60 | InvalidLightInfo,
| ^^^^^^^^^^^^^^^^ F401
61 | LightUnavailable,
62 | LightUnsupported,
|
= help: Add unused import `InvalidLightInfo` to __all__
busylight/lights/agile_innovative/blinkstick.py:7:20: F401 [*] `loguru.logger` imported but unused
|
5 | from typing import Dict, Tuple
6 |
7 | from loguru import logger
| ^^^^^^ F401
8 |
9 | from ..hidlight import HIDLight
|
= help: Remove unused import: `loguru.logger`
busylight/lights/compulab/fit_statusb.py:6:20: F401 [*] `loguru.logger` imported but unused
|
4 | from typing import Dict, Tuple
5 |
6 | from loguru import logger
| ^^^^^^ F401
7 |
8 | from ..seriallight import SerialLight
|
= help: Remove unused import: `loguru.logger`
busylight/lights/hidlight.py:4:20: F401 [*] `typing.Any` imported but unused
|
2 | """
3 |
4 | from typing import Any, Dict, List, Union
| ^^^ F401
5 |
6 | import hid
|
= help: Remove unused import
busylight/lights/hidlight.py:4:25: F401 [*] `typing.Dict` imported but unused
|
2 | """
3 |
4 | from typing import Any, Dict, List, Union
| ^^^^ F401
5 |
6 | import hid
|
= help: Remove unused import
busylight/lights/hidlight.py:4:37: F401 [*] `typing.Union` imported but unused
|
2 | """
3 |
4 | from typing import Any, Dict, List, Union
| ^^^^^ F401
5 |
6 | import hid
|
= help: Remove unused import
busylight/lights/hidlight.py:6:8: F401 [*] `hid` imported but unused
|
4 | from typing import Any, Dict, List, Union
5 |
6 | import hid
| ^^^ F401
7 |
8 | from loguru import logger
|
= help: Remove unused import: `hid`
busylight/lights/hidlight.py:99:13: F841 Local variable `results` is assigned to but never used
|
98 | try:
99 | results = self.read_strategy(8, timeout_ms=100)
| ^^^^^^^ F841
100 | return True
101 | except (ValueError, OSError):
|
= help: Remove assignment to unused variable `results`
busylight/lights/kuando/busylight_alpha.py:6:33: F401 [*] `typing.Union` imported but unused
|
4 | import asyncio
5 |
6 | from typing import Dict, Tuple, Union
| ^^^^^ F401
7 |
8 | from loguru import logger
|
= help: Remove unused import: `typing.Union`
busylight/lights/kuando/busylight_alpha.py:8:20: F401 [*] `loguru.logger` imported but unused
|
6 | from typing import Dict, Tuple, Union
7 |
8 | from loguru import logger
| ^^^^^^ F401
9 |
10 | from ..hidlight import HIDLight
|
= help: Remove unused import: `loguru.logger`
busylight/lights/light.py:17:8: F401 [*] `asyncio` imported but unused
|
16 | import abc
17 | import asyncio
| ^^^^^^^ F401
18 |
19 | from contextlib import contextmanager
|
= help: Remove unused import: `asyncio`
busylight/lights/luxafor/mute.py:6:20: F401 [*] `loguru.logger` imported but unused
|
4 | from typing import Dict, Tuple
5 |
6 | from loguru import logger
| ^^^^^^ F401
7 |
8 | from .flag import Flag
|
= help: Remove unused import: `loguru.logger`
busylight/lights/muteme/_muteme.py:8:20: F401 [*] `loguru.logger` imported but unused
|
6 | from bitvector import BitVector, BitField, ReadOnlyBitField
7 |
8 | from loguru import logger
| ^^^^^^ F401
|
= help: Remove unused import: `loguru.logger`
busylight/lights/muteme/muteme.py:6:20: F401 [*] `loguru.logger` imported but unused
|
4 | from typing import Dict, Tuple
5 |
6 | from loguru import logger
| ^^^^^^ F401
7 |
8 | from ..hidlight import HIDLight
|
= help: Remove unused import: `loguru.logger`
busylight/lights/mutesync/mutesync.py:6:20: F401 [*] `loguru.logger` imported but unused
|
4 | from typing import Dict, Tuple
5 |
6 | from loguru import logger
| ^^^^^^ F401
7 |
8 | from ..seriallight import SerialLight
|
= help: Remove unused import: `loguru.logger`
busylight/lights/taskable.py:6:20: F401 [*] `typing.Any` imported but unused
|
4 | import asyncio
5 |
6 | from typing import Any, Awaitable, Dict, Optional
| ^^^ F401
|
= help: Remove unused import: `typing.Any`
busylight/lights/taskable.py:67:46: F841 [*] Local variable `error` is assigned to but never used
|
65 | task.cancel()
66 | return task
67 | except (KeyError, AttributeError) as error:
| ^^^^^ F841
68 | pass
|
= help: Remove assignment to unused variable `error`
busylight/lights/thingm/blink1.py:6:20: F401 [*] `loguru.logger` imported but unused
|
4 | from typing import Callable, Dict, Tuple
5 |
6 | from loguru import logger
| ^^^^^^ F401
7 |
8 | from ..hidlight import HIDLight
|
= help: Remove unused import: `loguru.logger`
busylight/manager.py:7:20: F401 [*] `typing.Dict` imported but unused
|
6 | from contextlib import suppress
7 | from typing import Dict, List, Optional, Union, Tuple
| ^^^^ F401
8 | from loguru import logger
|
= help: Remove unused import
busylight/manager.py:7:42: F401 [*] `typing.Union` imported but unused
|
6 | from contextlib import suppress
7 | from typing import Dict, List, Optional, Union, Tuple
| ^^^^^ F401
8 | from loguru import logger
|
= help: Remove unused import
busylight/manager.py:14:20: F401 [*] `.speed.Speed` imported but unused
|
12 | from .lights import LightUnavailable, NoLightsFound, Light
13 |
14 | from .speed import Speed
| ^^^^^ F401
|
= help: Remove unused import: `.speed.Speed`
busylight/manager.py:291:40: F841 [*] Local variable `error` is assigned to but never used
|
289 | try:
290 | light.off()
291 | except LightUnavailable as error:
| ^^^^^ F841
292 | logger.debug("{light} is {error}")
|
= help: Remove assignment to unused variable `error`
Found 44 errors.
[*] 37 fixable with the `--fix` option (3 hidden fixes can be enabled with the `--unsafe-fixes` option).