mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 16:25:00 +00:00
style: fix linting issues in watch.py
This commit is contained in:
parent
f33cd4e419
commit
c08dcff56d
1 changed files with 4 additions and 2 deletions
|
@ -4,8 +4,10 @@ from typing import Optional, Set
|
||||||
from pathspec import PathSpec
|
from pathspec import PathSpec
|
||||||
from pathspec.patterns import GitWildMatchPattern
|
from pathspec.patterns import GitWildMatchPattern
|
||||||
from watchfiles import watch
|
from watchfiles import watch
|
||||||
|
|
||||||
from aider.dump import dump
|
from aider.dump import dump
|
||||||
|
|
||||||
|
|
||||||
def is_source_file(path: Path) -> bool:
|
def is_source_file(path: Path) -> bool:
|
||||||
"""
|
"""
|
||||||
Check if a file is a source file that uses # or // style comments.
|
Check if a file is a source file that uses # or // style comments.
|
||||||
|
@ -78,10 +80,10 @@ def watch_source_files(directory: str, gitignores: list[str] = None, ignore_func
|
||||||
path_obj = Path(path)
|
path_obj = Path(path)
|
||||||
root_abs = root.resolve()
|
root_abs = root.resolve()
|
||||||
path_abs = path_obj.resolve()
|
path_abs = path_obj.resolve()
|
||||||
|
|
||||||
if not path_abs.is_relative_to(root_abs):
|
if not path_abs.is_relative_to(root_abs):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
rel_path = path_abs.relative_to(root_abs)
|
rel_path = path_abs.relative_to(root_abs)
|
||||||
if gitignore_spec and gitignore_spec.match_file(str(rel_path)):
|
if gitignore_spec and gitignore_spec.match_file(str(rel_path)):
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue