From 87b48031a0c7e3d321c2e432642ee1e902b1043d Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 21 Dec 2022 12:30:53 +0000 Subject: [PATCH] development: Also exclude `.venv/` as that's VSCode default --- .flake8 | 2 +- .gitignore | 3 ++- pyproject.toml | 2 +- scripts/find_localised_strings.py | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.flake8 b/.flake8 index bf632685..c8dc0cc6 100644 --- a/.flake8 +++ b/.flake8 @@ -6,7 +6,7 @@ exclude = dist.win32/ FDevIDs/ venv/ - venv-py39/ + .venv/ wix/ # Show exactly where in a line the error happened diff --git a/.gitignore b/.gitignore index 9bea3d5a..4b13d5c3 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,8 @@ EDMarketConnector.VisualElementsManifest.xml .idea .vscode -venv +.venv/ +venv/ *.code-workspace htmlcov/ .ignored diff --git a/pyproject.toml b/pyproject.toml index 91c6e7e3..16f8d6dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ addopts = "--cov . --cov plugins --cov-report=term-missing --no-cov-on-fail" # --cov-fail-under 80" [tool.coverage.run] -omit = [ "tests/*", "venv/*", "dist.win32/*" ] +omit = [ "tests/*", "venv/*", ".venv/*", "dist.win32/*" ] plugins = [ "coverage_conditional_plugin" ] [tool.coverage.coverage_conditional_plugin.rules] diff --git a/scripts/find_localised_strings.py b/scripts/find_localised_strings.py index ff5dc693..74cfe1b4 100644 --- a/scripts/find_localised_strings.py +++ b/scripts/find_localised_strings.py @@ -139,7 +139,7 @@ def scan_file(path: pathlib.Path) -> list[ast.Call]: return out -def scan_directory(path: pathlib.Path, skip: list[pathlib.Path] = None) -> dict[pathlib.Path, list[ast.Call]]: +def scan_directory(path: pathlib.Path, skip: list[pathlib.Path] | None = None) -> dict[pathlib.Path, list[ast.Call]]: """ Scan a directory for expected callsites. @@ -293,7 +293,7 @@ def generate_lang_template(data: dict[pathlib.Path, list[ast.Call]]) -> str: if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--directory', help='Directory to search from', default='.') - parser.add_argument('--ignore', action='append', help='directories to ignore', default=['venv', '.git']) + parser.add_argument('--ignore', action='append', help='directories to ignore', default=['venv', '.venv', '.git']) group = parser.add_mutually_exclusive_group() group.add_argument('--json', action='store_true', help='JSON output') group.add_argument('--lang', help='en.template "strings" output to specified file, "-" for stdout')