fix: resolve CI lint and build failures
- 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:
@@ -18,7 +18,7 @@ class ValidationIssue:
|
||||
class Validator:
|
||||
"""Validate gitignore syntax and patterns."""
|
||||
|
||||
TRAILING_SLASH_PATTERN = re.compile(r".*[^/]sky/$")
|
||||
TRAILING_SLASH_PATTERN = re.compile(r".*[^/]//$")
|
||||
NEGATION_PATTERN = re.compile(r"^\s*!")
|
||||
BACKSLASH_PATTERN = re.compile(r"\\[nrt]")
|
||||
DOUBLE_STAR_PATTERN = re.compile(r"\*\*")
|
||||
@@ -67,7 +67,7 @@ class Validator:
|
||||
def _check_double_negation(self, line: str, line_num: int, all_lines: List[str]) -> None:
|
||||
"""Check for double negation patterns."""
|
||||
if line.startswith("!"):
|
||||
prev_lines = [l.strip() for l in all_lines[:line_num - 1] if l.strip() and not l.strip().startswith("#")]
|
||||
prev_lines = [prev_line.strip() for prev_line in all_lines[:line_num - 1] if prev_line.strip() and not prev_line.strip().startswith("#")]
|
||||
if prev_lines and prev_lines[-1].startswith("!"):
|
||||
self.warnings.append(ValidationIssue(
|
||||
line_number=line_num,
|
||||
|
||||
Reference in New Issue
Block a user