Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3bb813e

Browse files
authoredMay 16, 2025··
Merge pull request #56 from adafruit/use_ruff
change to ruff
2 parents 365bb82 + 77c2e5a commit 3bb813e

20 files changed

+204
-501
lines changed
 

‎.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
.py text eol=lf
6+
.rst text eol=lf
7+
.txt text eol=lf
8+
.yaml text eol=lf
9+
.toml text eol=lf
10+
.license text eol=lf
11+
.md text eol=lf

‎.pre-commit-config.yaml

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,21 @@
1-
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
1+
# SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
22
#
33
# SPDX-License-Identifier: Unlicense
44

55
repos:
6-
- repo: https://github.com/python/black
7-
rev: 23.3.0
8-
hooks:
9-
- id: black
10-
- repo: https://github.com/fsfe/reuse-tool
11-
rev: v1.1.2
12-
hooks:
13-
- id: reuse
146
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v4.4.0
7+
rev: v4.5.0
168
hooks:
179
- id: check-yaml
1810
- id: end-of-file-fixer
1911
- id: trailing-whitespace
20-
- repo: https://github.com/pycqa/pylint
21-
rev: v2.17.4
12+
- repo: https://github.com/astral-sh/ruff-pre-commit
13+
rev: v0.3.4
2214
hooks:
23-
- id: pylint
24-
name: pylint (library code)
25-
types: [python]
26-
args:
27-
- --disable=consider-using-f-string
28-
exclude: "^(docs/|examples/|tests/|setup.py$)"
29-
- id: pylint
30-
name: pylint (example code)
31-
description: Run pylint rules on "examples/*.py" files
32-
types: [python]
33-
files: "^examples/"
34-
args:
35-
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code
36-
- id: pylint
37-
name: pylint (test code)
38-
description: Run pylint rules on "tests/*.py" files
39-
types: [python]
40-
files: "^tests/"
41-
args:
42-
- --disable=missing-docstring,consider-using-f-string,duplicate-code
15+
- id: ruff-format
16+
- id: ruff
17+
args: ["--fix"]
18+
- repo: https://github.com/fsfe/reuse-tool
19+
rev: v3.0.1
20+
hooks:
21+
- id: reuse

‎.pylintrc

Lines changed: 0 additions & 399 deletions
This file was deleted.

‎README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Introduction
1717
:alt: Build Status
1818

1919

20-
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
21-
:target: https://github.com/psf/black
22-
:alt: Code Style: Black
20+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
21+
:target: https://github.com/astral-sh/ruff
22+
:alt: Code Style: Ruff
2323

2424
A helper library for the Adafruit MacroPad RP2040.
2525

‎adafruit_macropad.py

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -49,39 +49,41 @@
4949
import array
5050
import math
5151
import time
52+
53+
import adafruit_midi
54+
import audiocore
55+
import audiomp3
56+
import audiopwmio
5257
import board
5358
import digitalio
54-
import rotaryio
59+
import displayio
5560
import keypad
5661
import neopixel
57-
import displayio
58-
import audiopwmio
59-
import audiocore
60-
import audiomp3
62+
import rotaryio
6163
import usb_hid
64+
import usb_midi
65+
from adafruit_debouncer import Debouncer
66+
from adafruit_hid.consumer_control import ConsumerControl
67+
from adafruit_hid.consumer_control_code import ConsumerControlCode
6268
from adafruit_hid.keyboard import Keyboard
6369
from adafruit_hid.keyboard_layout_base import KeyboardLayoutBase
6470
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
6571
from adafruit_hid.keycode import Keycode
66-
from adafruit_hid.consumer_control import ConsumerControl
67-
from adafruit_hid.consumer_control_code import ConsumerControlCode
6872
from adafruit_hid.mouse import Mouse
69-
import usb_midi
70-
import adafruit_midi
71-
from adafruit_midi.note_on import NoteOn
73+
from adafruit_midi.control_change import ControlChange
7274
from adafruit_midi.note_off import NoteOff
75+
from adafruit_midi.note_on import NoteOn
7376
from adafruit_midi.pitch_bend import PitchBend
74-
from adafruit_midi.control_change import ControlChange
7577
from adafruit_midi.program_change import ProgramChange
7678
from adafruit_simple_text_display import SimpleTextDisplay
77-
from adafruit_debouncer import Debouncer
7879

7980
try:
8081
# Only used for typing
81-
from typing import Tuple, Optional, Union, Iterator
82-
from neopixel import NeoPixel
82+
from typing import Iterator, Optional, Tuple, Union
83+
84+
import adafruit_hid
8385
from keypad import Keys
84-
import adafruit_hid # pylint:disable=ungrouped-imports
86+
from neopixel import NeoPixel
8587
except ImportError:
8688
pass
8789

@@ -113,9 +115,7 @@ class _PixelMapLite:
113115
def __init__(
114116
self,
115117
pixels: NeoPixel,
116-
order: Tuple[
117-
int, int, int, int, int, int, int, int, int, int, int, int
118-
] = ROTATED_KEYMAP_0,
118+
order: Tuple[int, int, int, int, int, int, int, int, int, int, int, int] = ROTATED_KEYMAP_0,
119119
):
120120
self._pixels = pixels
121121
self._order = order
@@ -134,8 +134,7 @@ def __setitem__(self, index: int, val: int) -> None:
134134
def __getitem__(self, index: int) -> int:
135135
if isinstance(index, slice):
136136
return [
137-
self._pixels[self._order[idx]]
138-
for idx in range(*index.indices(self._num_pixels))
137+
self._pixels[self._order[idx]] for idx in range(*index.indices(self._num_pixels))
139138
]
140139
if index < 0:
141140
index += self._num_pixels
@@ -171,7 +170,6 @@ def brightness(self, value: float) -> None:
171170
self._pixels.brightness = value
172171

173172

174-
# pylint: disable=too-many-lines, disable=invalid-name, too-many-instance-attributes, too-many-public-methods, too-many-arguments
175173
class MacroPad:
176174
"""
177175
Class representing a single MacroPad.
@@ -283,10 +281,8 @@ def __init__(
283281
self._mouse = None
284282
self._layout_class = layout_class
285283
self.Keycode = keycode_class
286-
# pylint:disable=global-statement
287284
global keycodes
288285
keycodes = keycode_class
289-
# pylint:enable=global-statement
290286

291287
# Define MIDI:
292288
try:
@@ -315,13 +311,13 @@ def rotate(self, rotation):
315311
is to the left, ``180`` is when the USB port is at the bottom, and
316312
``270`` is when the USB port is to the right. Defaults to ``0``.
317313
"""
318-
if rotation not in (0, 90, 180, 270):
314+
if rotation not in {0, 90, 180, 270}:
319315
raise ValueError("Only 90 degree rotations are supported.")
320316

321317
self._rotation = rotation
322318

323319
def _keys_and_pixels(
324-
order: Tuple[int, int, int, int, int, int, int, int, int, int, int, int]
320+
order: Tuple[int, int, int, int, int, int, int, int, int, int, int, int],
325321
) -> None:
326322
"""
327323
Generate key and pixel maps based on a specified order.
@@ -793,9 +789,7 @@ def PitchBend(pitch_bend: int, *, channel: Optional[int] = None) -> PitchBend:
793789
return PitchBend(pitch_bend=pitch_bend, channel=channel)
794790

795791
@staticmethod
796-
def ControlChange(
797-
control: int, value: int, *, channel: Optional[int] = None
798-
) -> ControlChange:
792+
def ControlChange(control: int, value: int, *, channel: Optional[int] = None) -> ControlChange:
799793
"""
800794
Control Change MIDI message. For more details, see the ``adafruit_midi.control_change``
801795
documentation in CircuitPython MIDI:
@@ -1081,15 +1075,15 @@ def play_file(self, file_name: str) -> None:
10811075
if file_name.lower().endswith(".wav"):
10821076
with audiopwmio.PWMAudioOut(board.SPEAKER) as audio, open(
10831077
file_name, "rb"
1084-
) as audio_file: # pylint: disable=not-callable
1078+
) as audio_file:
10851079
wavefile = audiocore.WaveFile(audio_file)
10861080
audio.play(wavefile)
10871081
while audio.playing:
10881082
pass
10891083
elif file_name.lower().endswith(".mp3"):
10901084
with audiopwmio.PWMAudioOut(board.SPEAKER) as audio, open(
10911085
file_name, "rb"
1092-
) as audio_file: # pylint: disable=not-callable
1086+
) as audio_file:
10931087
mp3file = audiomp3.MP3Decoder(audio_file)
10941088
audio.play(mp3file)
10951089
while audio.playing:

‎docs/api.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
.. If your library file(s) are nested in a directory (e.g. /adafruit_foo/foo.py)
55
.. use this format as the module name: "adafruit_foo.foo"
66
7+
API Reference
8+
#############
9+
710
.. automodule:: adafruit_macropad
811
:members:
912

‎docs/conf.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
# -*- coding: utf-8 -*-
2-
31
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
42
#
53
# SPDX-License-Identifier: MIT
64

5+
import datetime
76
import os
87
import sys
9-
import datetime
108

119
sys.path.insert(0, os.path.abspath(".."))
1210

@@ -67,9 +65,7 @@
6765
creation_year = "2021"
6866
current_year = str(datetime.datetime.now().year)
6967
year_duration = (
70-
current_year
71-
if current_year == creation_year
72-
else creation_year + " - " + current_year
68+
current_year if current_year == creation_year else creation_year + " - " + current_year
7369
)
7470
copyright = year_duration + " Kattni Rembor"
7571
author = "Kattni Rembor"

‎examples/macropad_display_image/macropad_display_image.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""
55
MacroPad display image demo. Displays a bitmap image on the built-in display.
66
"""
7+
78
from adafruit_macropad import MacroPad
89

910
macropad = MacroPad()

‎examples/macropad_grid_layout.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
Grid layout demo for MacroPad. Displays the key pressed in a grid matching the key layout on the
66
built-in display.
77
"""
8+
89
import displayio
910
import terminalio
1011
from adafruit_display_text import bitmap_label as label
1112
from adafruit_displayio_layout.layouts.grid_layout import GridLayout
13+
1214
from adafruit_macropad import MacroPad
1315

1416
macropad = MacroPad()
@@ -39,6 +41,6 @@
3941
key_event = macropad.keys.events.get()
4042
if key_event:
4143
if key_event.pressed:
42-
labels[key_event.key_number].text = "KEY{}".format(key_event.key_number)
44+
labels[key_event.key_number].text = f"KEY{key_event.key_number}"
4345
else:
4446
labels[key_event.key_number].text = ""

‎examples/macropad_keyboard_layout.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
"""
55
International layout demo for MacroPad.
66
"""
7+
78
import time
9+
810
from keyboard_layout_win_fr import KeyboardLayout
911
from keycode_win_fr import Keycode
12+
1013
from adafruit_macropad import MacroPad
1114

1215
macropad = MacroPad(
@@ -39,7 +42,6 @@
3942
macropad.keyboard.press(keycode)
4043
else:
4144
macropad.keyboard_layout.write(keycode)
42-
else:
43-
if isinstance(keycode, int):
44-
macropad.keyboard.release(keycode)
45+
elif isinstance(keycode, int):
46+
macropad.keyboard.release(keycode)
4547
time.sleep(0.05)

‎examples/macropad_keyboard_mouse.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
pressed. Finally, it moves the mouse left and right when the rotary encoder is rotated
99
counterclockwise and clockwise respectively.
1010
"""
11+
1112
from adafruit_macropad import MacroPad
1213

1314
macropad = MacroPad()
@@ -26,9 +27,7 @@
2627
if key_event.key_number == 2:
2728
macropad.keyboard_layout.write("Hello, World!")
2829
if key_event.key_number == 3:
29-
macropad.consumer_control.send(
30-
macropad.ConsumerControlCode.VOLUME_DECREMENT
31-
)
30+
macropad.consumer_control.send(macropad.ConsumerControlCode.VOLUME_DECREMENT)
3231

3332
macropad.encoder_switch_debounced.update()
3433

‎examples/macropad_led_animation_example.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
This simpletest example displays the Blink animation on the
66
MacroPad neopixels
77
"""
8+
89
from adafruit_led_animation.animation.blink import Blink
910
from adafruit_led_animation.color import BLUE
11+
1012
from adafruit_macropad import MacroPad
1113

1214
macropad = MacroPad()

‎examples/macropad_mp3/macropad_mp3.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
is pressed. All keys light up a color of the rainbow when pressed, but no audio is played for the
77
rest of the keys.
88
"""
9+
910
from rainbowio import colorwheel
11+
1012
from adafruit_macropad import MacroPad
1113

1214
macropad = MacroPad()
@@ -20,9 +22,7 @@
2022

2123
if key_event:
2224
if key_event.pressed:
23-
macropad.pixels[key_event.key_number] = colorwheel(
24-
int(255 / 12) * key_event.key_number
25-
)
25+
macropad.pixels[key_event.key_number] = colorwheel(int(255 / 12) * key_event.key_number)
2626
if key_event.key_number < len(audio_files):
2727
macropad.play_file(audio_files[key_event.key_number])
2828

‎examples/macropad_rainbow_keys.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
layout on the built-in display, and animates a rainbow the first time you press a key and turns it
77
off on the next press.
88
"""
9+
910
import displayio
1011
import terminalio
11-
from rainbowio import colorwheel
1212
from adafruit_display_text import bitmap_label as label
1313
from adafruit_displayio_layout.layouts.grid_layout import GridLayout
14+
from rainbowio import colorwheel
15+
1416
from adafruit_macropad import MacroPad
1517

1618
macropad = MacroPad()
@@ -43,7 +45,7 @@
4345
key_event = macropad.keys.events.get()
4446
if key_event:
4547
if key_event.pressed:
46-
labels[key_event.key_number].text = "KEY{}".format(key_event.key_number)
48+
labels[key_event.key_number].text = f"KEY{key_event.key_number}"
4749
# Turn the LED on with the first press, and off with the second press.
4850
lit_keys[key_event.key_number] = not lit_keys[key_event.key_number]
4951
else:

‎examples/macropad_rotation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
Lights up the associated pixel when the key is pressed. Displays the key number pressed and the
77
rotary encoder relative position on the display.
88
"""
9+
910
from rainbowio import colorwheel
11+
1012
from adafruit_macropad import MacroPad
1113

1214
macropad = MacroPad(rotation=90)
@@ -17,11 +19,9 @@
1719
key_event = macropad.keys.events.get()
1820
if key_event:
1921
if key_event.pressed:
20-
text_lines[1].text = "Key {}!".format(key_event.key_number)
21-
macropad.pixels[key_event.key_number] = colorwheel(
22-
int(255 / 12) * key_event.key_number
23-
)
22+
text_lines[1].text = f"Key {key_event.key_number}!"
23+
macropad.pixels[key_event.key_number] = colorwheel(int(255 / 12) * key_event.key_number)
2424
else:
2525
macropad.pixels.fill((0, 0, 0))
26-
text_lines[2].text = "Encoder {}".format(macropad.encoder)
26+
text_lines[2].text = f"Encoder {macropad.encoder}"
2727
text_lines.show()

‎examples/macropad_simpletest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
Simpletest demo for MacroPad. Prints the key pressed, the relative position of the rotary
66
encoder, and the state of the rotary encoder switch to the serial console.
77
"""
8+
89
import time
10+
911
from adafruit_macropad import MacroPad
1012

1113
macropad = MacroPad()
1214

1315
while True:
1416
key_event = macropad.keys.events.get()
1517
if key_event and key_event.pressed:
16-
print("Key pressed: {}".format(key_event.key_number))
17-
print("Encoder: {}".format(macropad.encoder))
18-
print("Encoder switch: {}".format(macropad.encoder_switch))
18+
print(f"Key pressed: {key_event.key_number}")
19+
print(f"Encoder: {macropad.encoder}")
20+
print(f"Encoder switch: {macropad.encoder_switch}")
1921
time.sleep(0.4)

‎examples/macropad_simpletest_display.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
encoder, and the state of the rotary encoder switch to the built-in display. Note that the key
77
pressed line does not appear until a key is pressed.
88
"""
9+
910
from adafruit_macropad import MacroPad
1011

1112
macropad = MacroPad()
@@ -15,7 +16,7 @@
1516
while True:
1617
key_event = macropad.keys.events.get()
1718
if key_event and key_event.pressed:
18-
text_lines[0].text = "Key {} pressed!".format(key_event.key_number)
19-
text_lines[1].text = "Rotary encoder {}".format(macropad.encoder)
20-
text_lines[2].text = "Encoder switch: {}".format(macropad.encoder_switch)
19+
text_lines[0].text = f"Key {key_event.key_number} pressed!"
20+
text_lines[1].text = f"Rotary encoder {macropad.encoder}"
21+
text_lines[2].text = f"Encoder switch: {macropad.encoder_switch}"
2122
text_lines.show()

‎examples/macropad_tone_keypad.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
MacroPad tone demo. Plays a different tone for each key pressed and lights up each key a different
66
color while the key is pressed.
77
"""
8+
89
from rainbowio import colorwheel
10+
911
from adafruit_macropad import MacroPad
1012

1113
macropad = MacroPad()
@@ -17,9 +19,7 @@
1719

1820
if key_event:
1921
if key_event.pressed:
20-
macropad.pixels[key_event.key_number] = colorwheel(
21-
int(255 / 12) * key_event.key_number
22-
)
22+
macropad.pixels[key_event.key_number] = colorwheel(int(255 / 12) * key_event.key_number)
2323
macropad.start_tone(tones[key_event.key_number])
2424

2525
else:

‎examples/macropad_tone_keypad_extended.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"""
1010

1111
from rainbowio import colorwheel
12+
1213
from adafruit_macropad import MacroPad
1314

1415
macropad = MacroPad()
@@ -79,11 +80,9 @@ def rgb_from_int(rgb):
7980
playing_index = top_index
8081

8182
# There are no keys pressed.
82-
else:
83-
# If a tone was playing, stop it.
84-
if playing_index is not None:
85-
macropad.stop_tone()
86-
playing_index = None
83+
elif playing_index is not None:
84+
macropad.stop_tone()
85+
playing_index = None
8786

8887
# If a key was pressed or released, update the pixels for the pressed keys.
8988
if update_pixels:

‎ruff.toml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# SPDX-FileCopyrightText: 2024 Tim Cocks for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
target-version = "py38"
6+
line-length = 100
7+
8+
[lint]
9+
preview = true
10+
select = ["I", "PL", "UP"]
11+
12+
extend-select = [
13+
"D419", # empty-docstring
14+
"E501", # line-too-long
15+
"W291", # trailing-whitespace
16+
"PLC0414", # useless-import-alias
17+
"PLC2401", # non-ascii-name
18+
"PLC2801", # unnecessary-dunder-call
19+
"PLC3002", # unnecessary-direct-lambda-call
20+
"E999", # syntax-error
21+
"PLE0101", # return-in-init
22+
"F706", # return-outside-function
23+
"F704", # yield-outside-function
24+
"PLE0116", # continue-in-finally
25+
"PLE0117", # nonlocal-without-binding
26+
"PLE0241", # duplicate-bases
27+
"PLE0302", # unexpected-special-method-signature
28+
"PLE0604", # invalid-all-object
29+
"PLE0605", # invalid-all-format
30+
"PLE0643", # potential-index-error
31+
"PLE0704", # misplaced-bare-raise
32+
"PLE1141", # dict-iter-missing-items
33+
"PLE1142", # await-outside-async
34+
"PLE1205", # logging-too-many-args
35+
"PLE1206", # logging-too-few-args
36+
"PLE1307", # bad-string-format-type
37+
"PLE1310", # bad-str-strip-call
38+
"PLE1507", # invalid-envvar-value
39+
"PLE2502", # bidirectional-unicode
40+
"PLE2510", # invalid-character-backspace
41+
"PLE2512", # invalid-character-sub
42+
"PLE2513", # invalid-character-esc
43+
"PLE2514", # invalid-character-nul
44+
"PLE2515", # invalid-character-zero-width-space
45+
"PLR0124", # comparison-with-itself
46+
"PLR0202", # no-classmethod-decorator
47+
"PLR0203", # no-staticmethod-decorator
48+
"UP004", # useless-object-inheritance
49+
"PLR0206", # property-with-parameters
50+
"PLR0904", # too-many-public-methods
51+
"PLR0911", # too-many-return-statements
52+
"PLR0912", # too-many-branches
53+
"PLR0913", # too-many-arguments
54+
"PLR0914", # too-many-locals
55+
"PLR0915", # too-many-statements
56+
"PLR0916", # too-many-boolean-expressions
57+
"PLR1702", # too-many-nested-blocks
58+
"PLR1704", # redefined-argument-from-local
59+
"PLR1711", # useless-return
60+
"C416", # unnecessary-comprehension
61+
"PLR1733", # unnecessary-dict-index-lookup
62+
"PLR1736", # unnecessary-list-index-lookup
63+
64+
# ruff reports this rule is unstable
65+
#"PLR6301", # no-self-use
66+
67+
"PLW0108", # unnecessary-lambda
68+
"PLW0120", # useless-else-on-loop
69+
"PLW0127", # self-assigning-variable
70+
"PLW0129", # assert-on-string-literal
71+
"B033", # duplicate-value
72+
"PLW0131", # named-expr-without-context
73+
"PLW0245", # super-without-brackets
74+
"PLW0406", # import-self
75+
"PLW0602", # global-variable-not-assigned
76+
"PLW0603", # global-statement
77+
"PLW0604", # global-at-module-level
78+
79+
# fails on the try: import typing used by libraries
80+
#"F401", # unused-import
81+
82+
"F841", # unused-variable
83+
"E722", # bare-except
84+
"PLW0711", # binary-op-exception
85+
"PLW1501", # bad-open-mode
86+
"PLW1508", # invalid-envvar-default
87+
"PLW1509", # subprocess-popen-preexec-fn
88+
"PLW2101", # useless-with-lock
89+
"PLW3301", # nested-min-max
90+
]
91+
92+
ignore = [
93+
"PLR2004", # magic-value-comparison
94+
"UP030", # format literals
95+
"PLW1514", # unspecified-encoding
96+
"PLR0913", # too-many-arguments
97+
"PLR0915", # too-many-statements
98+
"PLR0917", # too-many-positional-arguments
99+
"PLR0904", # too-many-public-methods
100+
"PLR0912", # too-many-branches
101+
"PLR0916", # too-many-boolean-expressions
102+
"PLR6301", # could-be-static no-self-use
103+
"PLC0415", # import outside toplevel
104+
"PLC2701", # private import
105+
"PLW0603", # global statement
106+
]
107+
108+
[format]
109+
line-ending = "lf"

0 commit comments

Comments
 (0)
Please sign in to comment.