mirror of
https://github.com/ivuorinen/aeonview.git
synced 2026-03-14 19:58:56 +00:00
chore(hooks): add editorconfig-checker and fix lines exceeding 80 chars
Add editorconfig-checker pre-commit hook to catch line-length violations locally. Shorten docstrings in aeonview.py and aeonview_test.py that exceeded the 80-character editorconfig limit. Remove double-quote-string-fixer hook that conflicted with ruff-format.
This commit is contained in:
@@ -30,6 +30,12 @@ repos:
|
||||
- id: name-tests-test
|
||||
- id: no-commit-to-branch
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
|
||||
rev: "3.6.1"
|
||||
hooks:
|
||||
- id: editorconfig-checker
|
||||
alias: ec
|
||||
exclude: uv\.lock
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: pyright
|
||||
|
||||
13
aeonview.py
13
aeonview.py
@@ -317,11 +317,12 @@ class AeonViewVideos:
|
||||
def _concatenate_videos(
|
||||
self, label: str, input_videos: list[Path], output_file: Path
|
||||
) -> None:
|
||||
"""Concatenate multiple video files into one using ffmpeg concat demuxer.
|
||||
"""Concatenate video files into one using ffmpeg concat.
|
||||
|
||||
:param label: Human-readable label for log messages (e.g. "monthly video for 2025-04").
|
||||
:param input_videos: List of input video file paths to concatenate.
|
||||
:param output_file: Path for the resulting concatenated video.
|
||||
:param label: Human-readable label for log messages
|
||||
(e.g. "monthly video for 2025-04").
|
||||
:param input_videos: Paths of input videos to concatenate.
|
||||
:param output_file: Path for the resulting video.
|
||||
"""
|
||||
logging.info("Generating %s", label)
|
||||
logging.info("Output file will be %s", output_file)
|
||||
@@ -350,7 +351,7 @@ class AeonViewVideos:
|
||||
|
||||
|
||||
class AeonViewHelpers:
|
||||
"""Utility methods for path manipulation, argument parsing, and ffmpeg commands."""
|
||||
"""Utility methods for paths, argument parsing, and ffmpeg."""
|
||||
|
||||
@staticmethod
|
||||
def check_date(year: int, month: int, day: int) -> bool:
|
||||
@@ -501,7 +502,7 @@ class AeonViewHelpers:
|
||||
|
||||
:param input_files: List of input video file paths.
|
||||
:param output_file: Path to the output video file.
|
||||
:return: Tuple of (ffmpeg command list, temporary concat list file path).
|
||||
:return: Tuple of (command list, temp concat file path).
|
||||
"""
|
||||
concat_list = tempfile.NamedTemporaryFile(
|
||||
mode="w", suffix=".txt", delete=False
|
||||
|
||||
@@ -47,13 +47,13 @@ def make_video_args(
|
||||
|
||||
@contextlib.contextmanager
|
||||
def expect_error_exit():
|
||||
"""Context manager that expects ``SystemExit`` and silences ``logging.error``."""
|
||||
"""Expect ``SystemExit`` and silence ``logging.error``."""
|
||||
with pytest.raises(SystemExit), mock.patch("aeonview.logging.error"):
|
||||
yield
|
||||
|
||||
|
||||
def make_app_with_project(tmp: str) -> tuple[AeonViewApp, Path]:
|
||||
"""Create an ``AeonViewApp`` whose base_path points at *tmp* with a 'proj' dir."""
|
||||
"""Create an ``AeonViewApp`` with base_path at *tmp*/'proj'."""
|
||||
app = AeonViewApp()
|
||||
app.base_path = Path(tmp).resolve()
|
||||
proj_path = app.base_path / "proj"
|
||||
@@ -456,7 +456,7 @@ def test_generate_monthly_video(mock_subprocess_run):
|
||||
|
||||
@mock.patch("subprocess.run")
|
||||
def test_generate_monthly_video_excludes_output_file(mock_subprocess_run):
|
||||
"""Verify that the monthly output file is excluded from the input list on re-runs."""
|
||||
"""Verify monthly output file is excluded from inputs on re-runs."""
|
||||
captured_content = {}
|
||||
|
||||
def capture_concat(cmd, **_kwargs):
|
||||
|
||||
Reference in New Issue
Block a user