fix: resolve CI lint and build failures
Some checks failed
CI / test (3.10) (push) Has started running
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

- 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:15 +00:00
parent 8ea425560c
commit 431b21019d

View File

@@ -2,8 +2,7 @@
import os
import sys
from pathlib import Path
from typing import List, Optional
from typing import Optional
import click
@@ -67,11 +66,9 @@ def generate(
if template_ref.startswith("ide:"):
template_name = template_ref[4:]
content = template_loader.get_template_content(template_name)
category = "ides"
else:
template_name = template_ref
content = template_loader.get_template_content(template_name)
category = None
if content:
content_parts.append(f"# --- {template_name} ---\n")
@@ -94,14 +91,14 @@ def generate(
if validate:
summary = validator.get_summary(final_content)
if summary["errors"] > 0:
click.echo(f"\nValidation errors found:")
click.echo("\nValidation errors found:")
for issue in summary["issues"]:
if issue.severity == "error":
click.echo(f" Line {issue.line_number}: {issue.message}")
if not click.confirm("Generate anyway?"):
sys.exit(1)
if summary["warnings"] > 0:
click.echo(f"\nValidation warnings:")
click.echo("\nValidation warnings:")
for issue in summary["issues"]:
if issue.severity == "warning":
click.echo(f" Line {issue.line_number}: {issue.message}")
@@ -250,7 +247,7 @@ def template_info(template: str) -> None:
click.echo(f"Error: Template '{template}' not found.")
sys.exit(1)
lines = [l for l in content.splitlines() if l.strip() and not l.strip().startswith("#")]
lines = [line for line in content.splitlines() if line.strip() and not line.strip().startswith("#")]
click.echo(f"Template: {template}")
click.echo(f"Lines: {len(content.splitlines())}")