diff --git a/eof_fixer/fixer.py b/eof_fixer/fixer.py index 39c9492..ef97917 100644 --- a/eof_fixer/fixer.py +++ b/eof_fixer/fixer.py @@ -13,7 +13,7 @@ def _assert_never(value: NoReturn) -> NoReturn: """Static-exhaustiveness guard: ty errors if any union member can reach here.""" - raise AssertionError(value) # pragma: no cover + raise AssertionError(value) # pragma: no cover - ty proves every call unreachable (ADR-0002) @dataclasses.dataclass(frozen=True) @@ -72,7 +72,7 @@ def _detect_trailing(file_obj: IO[bytes]) -> _EofAction: if remaining.startswith(sequence): return Truncate(position + len(sequence)) - raise AssertionError("unreachable") # pragma: no cover # noqa: EM101 + raise AssertionError("unreachable") # noqa: EM101 # pragma: no cover - remaining is all \n/\r, so a sequence matches def fix_file(file_obj: IO[bytes], *, check: bool) -> bool: @@ -99,7 +99,7 @@ def fix_file(file_obj: IO[bytes], *, check: bool) -> bool: file_obj.seek(offset) file_obj.truncate() return True - case _: # pragma: no cover + case _: # pragma: no cover - exhaustiveness guard; ty verifies every _EofAction is matched _assert_never(action) diff --git a/tests/test_discovery.py b/tests/test_discovery.py index cf38fac..7600d00 100644 --- a/tests/test_discovery.py +++ b/tests/test_discovery.py @@ -107,7 +107,7 @@ def test_ignore_rules_come_only_from_gitignore_files_in_the_tree(tmp_path: pathl (info / "exclude").write_text("*.log\n") (tmp_path / "a.log").write_text("x") - def _no_subprocess(*args: object, **kwargs: object) -> None: # pragma: no cover + def _no_subprocess(*args: object, **kwargs: object) -> None: # pragma: no cover - runs only if discovery spawns one message = f"discovery spawned a subprocess: {args} {kwargs}" raise AssertionError(message) @@ -125,7 +125,7 @@ def test_symlinks_are_skipped(tmp_path: pathlib.Path) -> None: link = tmp_path / "link.txt" try: link.symlink_to(target) - except (OSError, NotImplementedError): # pragma: no cover + except (OSError, NotImplementedError): # pragma: no cover - only where the OS refuses symlinks pytest.skip("symlinks not available on this platform") result = _walk(tmp_path) assert "target.txt" in result diff --git a/tests/test_fixer.py b/tests/test_fixer.py index a754ade..868d998 100644 --- a/tests/test_fixer.py +++ b/tests/test_fixer.py @@ -151,7 +151,7 @@ def test_symlink_does_not_crash(tmp_path: pathlib.Path) -> None: link = tmp_path / "l.txt" try: link.symlink_to(target) - except (OSError, NotImplementedError): # pragma: no cover + except (OSError, NotImplementedError): # pragma: no cover - only where the OS refuses symlinks pytest.skip("symlinks not available on this platform") fixed = _names(fix_directory(tmp_path)) assert "t.txt" in fixed