diff --git a/gitignore_generator/cli/commands.py b/gitignore_generator/cli/commands.py index 2abe93e..c25b495 100644 --- a/gitignore_generator/cli/commands.py +++ b/gitignore_generator/cli/commands.py @@ -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())}")