ignore .gitignore
This commit is contained in:
parent
72672d6709
commit
6950680ee9
3 changed files with 15 additions and 5 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -496,6 +496,9 @@ poetry.toml
|
|||
# ruff
|
||||
.ruff_cache/
|
||||
|
||||
# LSP config files
|
||||
pyrightconfig.json
|
||||
|
||||
### SublimeText ###
|
||||
# Cache files for Sublime Text
|
||||
*.tmlanguage.cache
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from pathlib import Path
|
||||
|
||||
import more_itertools
|
||||
import pathspec
|
||||
import typer
|
||||
|
||||
from pyflybygen.cli.common import verbose_callback
|
||||
|
|
@ -49,9 +50,14 @@ def main(
|
|||
help="show the log messages",
|
||||
),
|
||||
) -> None:
|
||||
imports = more_itertools.flatten(
|
||||
[get_imports(p.read_text()) for p in Path(".").glob("**/*.py")]
|
||||
)
|
||||
|
||||
lines = []
|
||||
if Path(".gitignore").exists():
|
||||
lines.extend(Path(".gitignore").read_text().splitlines())
|
||||
spec = pathspec.PathSpec.from_lines("gitwildmatch", lines)
|
||||
files = Path(".").glob("**/*.py")
|
||||
files = [file for file in files if not spec.match_file(str(file))]
|
||||
imports = more_itertools.flatten([get_imports(p.read_text()) for p in files])
|
||||
print("\n".join(set(imports)))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@ dependencies = [
|
|||
"anyconfig",
|
||||
"tree_sitter_languages",
|
||||
'more_itertools',
|
||||
'coverage',
|
||||
'coverage-rich',
|
||||
'pathspec',
|
||||
]
|
||||
dynamic = ["version"]
|
||||
|
||||
|
|
@ -58,6 +57,8 @@ dependencies = [
|
|||
"pytest-rich",
|
||||
"ruff",
|
||||
"black",
|
||||
'coverage',
|
||||
'coverage-rich',
|
||||
]
|
||||
[tool.hatch.envs.default.scripts]
|
||||
test = "coverage run -m pytest"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue