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
|
||||||
.ruff_cache/
|
.ruff_cache/
|
||||||
|
|
||||||
|
# LSP config files
|
||||||
|
pyrightconfig.json
|
||||||
|
|
||||||
### SublimeText ###
|
### SublimeText ###
|
||||||
# Cache files for Sublime Text
|
# Cache files for Sublime Text
|
||||||
*.tmlanguage.cache
|
*.tmlanguage.cache
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import more_itertools
|
import more_itertools
|
||||||
|
import pathspec
|
||||||
import typer
|
import typer
|
||||||
|
|
||||||
from pyflybygen.cli.common import verbose_callback
|
from pyflybygen.cli.common import verbose_callback
|
||||||
|
|
@ -49,9 +50,14 @@ def main(
|
||||||
help="show the log messages",
|
help="show the log messages",
|
||||||
),
|
),
|
||||||
) -> None:
|
) -> 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)))
|
print("\n".join(set(imports)))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,7 @@ dependencies = [
|
||||||
"anyconfig",
|
"anyconfig",
|
||||||
"tree_sitter_languages",
|
"tree_sitter_languages",
|
||||||
'more_itertools',
|
'more_itertools',
|
||||||
'coverage',
|
'pathspec',
|
||||||
'coverage-rich',
|
|
||||||
]
|
]
|
||||||
dynamic = ["version"]
|
dynamic = ["version"]
|
||||||
|
|
||||||
|
|
@ -58,6 +57,8 @@ dependencies = [
|
||||||
"pytest-rich",
|
"pytest-rich",
|
||||||
"ruff",
|
"ruff",
|
||||||
"black",
|
"black",
|
||||||
|
'coverage',
|
||||||
|
'coverage-rich',
|
||||||
]
|
]
|
||||||
[tool.hatch.envs.default.scripts]
|
[tool.hatch.envs.default.scripts]
|
||||||
test = "coverage run -m pytest"
|
test = "coverage run -m pytest"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue