Skip to content

Commit f85c21e

Browse files
committed
Linted.
1 parent 551345f commit f85c21e

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repos:
2424
name: pylint (library code)
2525
types: [python]
2626
args:
27-
- --disable=consider-using-f-string
27+
- --disable=consider-using-f-string,duplicate-code
2828
exclude: "^(docs/|examples/|tests/|setup.py$)"
2929
- id: pylint
3030
name: pylint (example code)

adafruit_circuitplayground/bluefruit.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ def play_mp3(self, file_name):
161161
with self._audio_out(
162162
board.SPEAKER
163163
) as audio: # pylint: disable=not-callable
164-
mp3file = audiomp3.MP3Decoder(open(file_name, "rb"))
164+
mp3file = audiomp3.MP3Decoder(
165+
open(file_name, "rb") # pylint: disable=consider-using-with
166+
)
165167
audio.play(mp3file)
166168
while audio.playing:
167169
pass

adafruit_circuitplayground/circuit_playground_base.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,9 @@ def play_file(self, file_name):
802802
self.stop_tone()
803803
self._speaker_enable.value = True
804804
with self._audio_out(board.SPEAKER) as audio: # pylint: disable=not-callable
805-
wavefile = audiocore.WaveFile(open(file_name, "rb"))
805+
wavefile = audiocore.WaveFile(
806+
open(file_name, "rb") # pylint: disable=consider-using-with
807+
)
806808
audio.play(wavefile)
807809
while audio.playing:
808810
pass

0 commit comments

Comments
 (0)