fix: resolve CI lint and build failures
Some checks failed
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / build (push) Has been cancelled
CI / test (3.10) (push) Has been cancelled

- Fixed lint path in CI workflow from src/gdiffer/ to gitignore_generator/
- Fixed verification command from gdiffer --version to gitignore --version
- Removed unused imports (pathlib.Path, typing.List, os, sys, pytest, unittest.mock.patch)
- Removed unused variable assignments (category, index)
- Fixed f-strings without placeholders
- Renamed ambiguous variable 'l' to 'line' and 'prev_line'
- Added type assertion for type narrowing in template_loader.py
This commit is contained in:
2026-02-02 16:06:17 +00:00
parent 9bb6967219
commit ebed619026

View File

@@ -1,6 +1,5 @@
"""Tests for template loader.""" """Tests for template loader."""
import os
import tempfile import tempfile
from pathlib import Path from pathlib import Path
@@ -107,6 +106,6 @@ class TestTemplateLoader:
def test_duplicate_removal_in_merge(self, loader_with_templates): def test_duplicate_removal_in_merge(self, loader_with_templates):
"""Test that duplicates are removed when merging.""" """Test that duplicates are removed when merging."""
merged = loader_with_templates.merge_templates(["python", "python"]) merged = loader_with_templates.merge_templates(["python", "python"])
lines = [l for l in merged.splitlines() if l.strip() and not l.strip().startswith("#")] lines = [line for line in merged.splitlines() if line.strip() and not line.strip().startswith("#")]
unique_lines = set(lines) unique_lines = set(lines)
assert len(lines) == len(unique_lines) assert len(lines) == len(unique_lines)