Skip to content

Commit

Permalink
ruff line-length
Browse files Browse the repository at this point in the history
  • Loading branch information
dunossauro committed Jan 15, 2025
1 parent e77f378 commit 716fd6d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ vmh = "vmh.cli:app"
pythonpath = "."
filterwarnings = 'ignore'

[tool.ruff]
line-length = 79

[tool.ruff.lint]
select = ['I', 'N', 'F', 'E', 'W', 'D', 'PL']
ignore = ['D100', 'D101', 'D103', 'D104', 'D203', 'D213', 'PLR0913']
Expand Down
11 changes: 7 additions & 4 deletions tests/test_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

from pydub import AudioSegment

from vmh.audio import _audio_chain, cut_silences, detect_silences, extract_audio
from vmh.audio import (
_audio_chain,
cut_silences,
detect_silences,
extract_audio,
)

audio_stub = {
'path': 'tests/test_assets/audio_test.wav',
Expand Down Expand Up @@ -152,9 +157,7 @@ def test_cut_audio_silences(tmpdir):
inpurt_file = 'tests/test_assets/sas.wav'
output_file = tmpdir / 'out.mp3'
expected_size = 1
cut_silences(
inpurt_file, output_file
)
cut_silences(inpurt_file, output_file)

audio_seg: AudioSegment = AudioSegment.from_mp3(str(output_file))

Expand Down
5 changes: 4 additions & 1 deletion vmh/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ def extract_audio(
if eq:
_eq_path = Path(output_file)
eq_path = _eq_path.parent / ('eq_' + _eq_path.name)
return Path(output_file), Path(process_audio(output_file, str(eq_path)))
return (
Path(output_file),
Path(process_audio(output_file, str(eq_path))),
)

return Path(output_file)

Expand Down
8 changes: 6 additions & 2 deletions vmh/equalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def _get_board() -> Pedalboard:
"""
effects = fx_chain

plugins = [getattr(pedalboard, effect)(**effects[effect]) for effect in effects]
plugins = [
getattr(pedalboard, effect)(**effects[effect]) for effect in effects
]

return Pedalboard(plugins)

Expand All @@ -54,7 +56,9 @@ def process_audio(

effected = board(audio, ifile.samplerate)

with AudioFile(output_file, 'w', ifile.samplerate, ifile.num_channels) as outfile:
with AudioFile(
output_file, 'w', ifile.samplerate, ifile.num_channels
) as outfile:
outfile.write(effected)

return Path(output_file)

0 comments on commit 716fd6d

Please sign in to comment.