mirror of
https://github.com/ivuorinen/aeonview.git
synced 2026-03-14 21:59:00 +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: name-tests-test
|
||||||
- id: no-commit-to-branch
|
- id: no-commit-to-branch
|
||||||
- id: trailing-whitespace
|
- 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
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyright
|
- id: pyright
|
||||||
|
|||||||
13
aeonview.py
13
aeonview.py
@@ -317,11 +317,12 @@ class AeonViewVideos:
|
|||||||
def _concatenate_videos(
|
def _concatenate_videos(
|
||||||
self, label: str, input_videos: list[Path], output_file: Path
|
self, label: str, input_videos: list[Path], output_file: Path
|
||||||
) -> None:
|
) -> 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 label: Human-readable label for log messages
|
||||||
:param input_videos: List of input video file paths to concatenate.
|
(e.g. "monthly video for 2025-04").
|
||||||
:param output_file: Path for the resulting concatenated video.
|
:param input_videos: Paths of input videos to concatenate.
|
||||||
|
:param output_file: Path for the resulting video.
|
||||||
"""
|
"""
|
||||||
logging.info("Generating %s", label)
|
logging.info("Generating %s", label)
|
||||||
logging.info("Output file will be %s", output_file)
|
logging.info("Output file will be %s", output_file)
|
||||||
@@ -350,7 +351,7 @@ class AeonViewVideos:
|
|||||||
|
|
||||||
|
|
||||||
class AeonViewHelpers:
|
class AeonViewHelpers:
|
||||||
"""Utility methods for path manipulation, argument parsing, and ffmpeg commands."""
|
"""Utility methods for paths, argument parsing, and ffmpeg."""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_date(year: int, month: int, day: int) -> bool:
|
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 input_files: List of input video file paths.
|
||||||
:param output_file: Path to the output video file.
|
: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(
|
concat_list = tempfile.NamedTemporaryFile(
|
||||||
mode="w", suffix=".txt", delete=False
|
mode="w", suffix=".txt", delete=False
|
||||||
|
|||||||
@@ -47,13 +47,13 @@ def make_video_args(
|
|||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def expect_error_exit():
|
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"):
|
with pytest.raises(SystemExit), mock.patch("aeonview.logging.error"):
|
||||||
yield
|
yield
|
||||||
|
|
||||||
|
|
||||||
def make_app_with_project(tmp: str) -> tuple[AeonViewApp, Path]:
|
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 = AeonViewApp()
|
||||||
app.base_path = Path(tmp).resolve()
|
app.base_path = Path(tmp).resolve()
|
||||||
proj_path = app.base_path / "proj"
|
proj_path = app.base_path / "proj"
|
||||||
@@ -456,7 +456,7 @@ def test_generate_monthly_video(mock_subprocess_run):
|
|||||||
|
|
||||||
@mock.patch("subprocess.run")
|
@mock.patch("subprocess.run")
|
||||||
def test_generate_monthly_video_excludes_output_file(mock_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 = {}
|
captured_content = {}
|
||||||
|
|
||||||
def capture_concat(cmd, **_kwargs):
|
def capture_concat(cmd, **_kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user