Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Commit

Permalink
chore: update pe-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
desbma committed Mar 25, 2023
1 parent eb00ef6 commit da97fc6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
@@ -1,7 +1,7 @@
# https://pre-commit.com
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -24,7 +24,7 @@ repos:
- --markdown-linebreak-ext=md

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v1.1.1
hooks:
- id: mypy
additional_dependencies:
Expand All @@ -33,7 +33,7 @@ repos:
- --ignore-missing-imports

- repo: https://github.com/pycqa/flake8
rev: 3.9.2
rev: 6.0.0
hooks:
- id: flake8
args:
Expand All @@ -45,15 +45,15 @@ repos:
- --max-line-length=120

- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
rev: 6.3.0
hooks:
- id: pydocstyle
args:
# http://www.pydocstyle.org/en/5.1.1/error_codes.html
- --ignore=D105,D107,D202,D210,D211,D212

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.4
rev: v0.9.0.2
hooks:
- id: shellcheck

Expand All @@ -67,15 +67,15 @@ repos:
- --profile=black

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 23.1.0
hooks:
- id: black
language_version: python3
args:
- --line-length=120

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v3.0.0-alpha.6
hooks:
- id: prettier
args:
Expand Down
2 changes: 1 addition & 1 deletion r128gain/__init__.py
Expand Up @@ -274,7 +274,7 @@ def scan(

futures: Dict[concurrent.futures.Future, Union[str, int]] = {}
if album_gain:
if skip_tagged and all(map(operator.itemgetter(1), loudness_tags)):
if skip_tagged and all(map(operator.itemgetter(1), loudness_tags)): # type: ignore
logger().info("All files already have an album gain tag, skipping album gain scan")
elif audio_filepaths:
calc_album_peak = any(map(lambda x: os.path.splitext(x)[-1].lower() != ".opus", audio_filepaths))
Expand Down
4 changes: 0 additions & 4 deletions tests/__init__.py
Expand Up @@ -434,7 +434,6 @@ def test_process(self): # noqa: C901
)

for i, skip_tagged in enumerate((True, False, True)):

if i == 0:
for file in files:
self.assertEqual(r128gain.has_loudness_tag(file), (False, False))
Expand All @@ -443,7 +442,6 @@ def test_process(self): # noqa: C901
with self.subTest(i=i, skip_tagged=skip_tagged, album_gain=album_gain), unittest.mock.patch(
"r128gain.get_r128_loudness", wraps=r128gain.get_r128_loudness
) as get_r128_loudness_mock:

r128gain.process(files, album_gain=album_gain, skip_tagged=skip_tagged)

if skip_tagged and (i > 0):
Expand Down Expand Up @@ -673,12 +671,10 @@ def test_process_recursive(self): # noqa: C901
# └── f.wv

for i, skip_tagged in enumerate((True, False, True)):

for album_gain in (False, True):
with self.subTest(i=i, skip_tagged=skip_tagged, album_gain=album_gain), unittest.mock.patch(
"r128gain.get_r128_loudness", wraps=r128gain.get_r128_loudness
) as get_r128_loudness_mock:

r128gain.process_recursive((self.temp_dir.name,), album_gain=album_gain, skip_tagged=skip_tagged)

if skip_tagged and (i > 0):
Expand Down

0 comments on commit da97fc6

Please sign in to comment.