From 1af4336cc69ce134af2f9bd76662c7c220282d10 Mon Sep 17 00:00:00 2001 From: Simon Jones Date: Sat, 11 Nov 2023 14:55:42 -0500 Subject: [PATCH] fix: typing of cli arguments --- analysis.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ chasten/main.py | 2 +- poetry.lock | 11 +++----- 3 files changed, 76 insertions(+), 8 deletions(-) create mode 100644 analysis.md diff --git a/analysis.md b/analysis.md new file mode 100644 index 00000000..19d06709 --- /dev/null +++ b/analysis.md @@ -0,0 +1,71 @@ + +# PASSED: **ID:** 'C001', **Name:** 'class-definition', **Pattern:** './/ClassDef', min=1, max=None + + - /_scratch/chasten/chasten/enumerations.py - 3 matches + - /_scratch/chasten/chasten/results.py - 6 matches + - /_scratch/chasten/chasten/server.py - 1 matches + - /_scratch/chasten/chasten/constants.py - 10 matches + - /_scratch/chasten/chasten/debug.py - 2 matches + +# PASSED: **ID:** 'F001', **Name:** 'all-function-definition', **Pattern:** './/FunctionDef', min=1, max=None + + - /_scratch/chasten/tests/test_filesystem.py - 16 matches + - /_scratch/chasten/tests/test_util.py - 5 matches + - /_scratch/chasten/tests/test_main.py - 18 matches + - /_scratch/chasten/tests/test_configuration.py - 3 matches + - /_scratch/chasten/tests/test_checks.py - 8 matches + - /_scratch/chasten/tests/test_validate.py - 4 matches + - /_scratch/chasten/tests/test_debug.py - 8 matches + - /_scratch/chasten/tests/test_process.py - 3 matches + - /_scratch/chasten/tests/test_constants.py - 5 matches + - /_scratch/chasten/chasten/database.py - 6 matches + - /_scratch/chasten/chasten/server.py - 2 matches + - /_scratch/chasten/chasten/util.py - 8 matches + - /_scratch/chasten/chasten/main.py - 10 matches + - /_scratch/chasten/chasten/process.py - 4 matches + - /_scratch/chasten/chasten/output.py - 12 matches + - /_scratch/chasten/chasten/checks.py - 9 matches + - /_scratch/chasten/chasten/validate.py - 4 matches + - /_scratch/chasten/chasten/configuration.py - 10 matches + - /_scratch/chasten/chasten/filesystem.py - 12 matches + +# PASSED: **ID:** 'F002', **Name:** 'dummy-test-non-test-function-definition', **Pattern:** './/FunctionDef\[not(contains(@name, "test_"))]', min=None, max=None + + - /_scratch/chasten/tests/test_main.py - 1 matches + - /_scratch/chasten/chasten/database.py - 6 matches + - /_scratch/chasten/chasten/server.py - 2 matches + - /_scratch/chasten/chasten/util.py - 8 matches + - /_scratch/chasten/chasten/main.py - 10 matches + - /_scratch/chasten/chasten/process.py - 4 matches + - /_scratch/chasten/chasten/output.py - 10 matches + - /_scratch/chasten/chasten/checks.py - 9 matches + - /_scratch/chasten/chasten/validate.py - 4 matches + - /_scratch/chasten/chasten/configuration.py - 10 matches + - /_scratch/chasten/chasten/filesystem.py - 12 matches + +# PASSED: **ID:** 'CL001', **Name:** 'dummy-test-single-nested-if', **Pattern:** './/FunctionDef/body//If', min=None, max=None + + - /_scratch/chasten/tests/test_filesystem.py - 1 matches + - /_scratch/chasten/tests/test_util.py - 1 matches + - /_scratch/chasten/tests/test_checks.py - 1 matches + - /_scratch/chasten/tests/test_process.py - 1 matches + - /_scratch/chasten/tests/test_constants.py - 1 matches + - /_scratch/chasten/chasten/database.py - 12 matches + - /_scratch/chasten/chasten/util.py - 4 matches + - /_scratch/chasten/chasten/main.py - 26 matches + - /_scratch/chasten/chasten/process.py - 5 matches + - /_scratch/chasten/chasten/output.py - 7 matches + - /_scratch/chasten/chasten/checks.py - 13 matches + - /_scratch/chasten/chasten/validate.py - 3 matches + - /_scratch/chasten/chasten/configuration.py - 15 matches + - /_scratch/chasten/chasten/filesystem.py - 11 matches + +# PASSED: **ID:** 'CL002', **Name:** 'dummy-test-double-nested-if', **Pattern:** './/FunctionDef/body//If\[ancestor::If and not(parent::orelse)]', min=None, max=None + + - /_scratch/chasten/chasten/database.py - 4 matches + - /_scratch/chasten/chasten/main.py - 8 matches + - /_scratch/chasten/chasten/output.py - 1 matches + - /_scratch/chasten/chasten/checks.py - 3 matches + - /_scratch/chasten/chasten/validate.py - 1 matches + - /_scratch/chasten/chasten/configuration.py - 3 matches + - /_scratch/chasten/chasten/filesystem.py - 3 matches diff --git a/chasten/main.py b/chasten/main.py index 782c0bec..b76557d5 100644 --- a/chasten/main.py +++ b/chasten/main.py @@ -261,7 +261,7 @@ def analyze( # noqa: PLR0912, PLR0913, PLR0915 writable=True, resolve_path=True, ), - config: Path = typer.Option( + config: str = typer.Option( None, "--config", "-c", diff --git a/poetry.lock b/poetry.lock index f5ace7d3..7aca1c61 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2855,13 +2855,13 @@ doc = ["reno", "sphinx", "tornado (>=4.5)"] [[package]] name = "textual" -version = "0.41.0" +version = "0.32.0" description = "Modern Text User Interface framework" optional = false python-versions = ">=3.7,<4.0" files = [ - {file = "textual-0.41.0-py3-none-any.whl", hash = "sha256:ebf5f04a96721adb8685aae32a98d4a4098dafbfef59b1fb43ca7ac2c1ed5049"}, - {file = "textual-0.41.0.tar.gz", hash = "sha256:73fb675a90ddded17d59ebd864dedaf82a3e7377e68ba1601581281dfd47ea86"}, + {file = "textual-0.32.0-py3-none-any.whl", hash = "sha256:81fc68406c8806bc864e2f035874a868b4ff0cf466289dce5f7b31869949383b"}, + {file = "textual-0.32.0.tar.gz", hash = "sha256:f7b6683bc18faee6fd3c47cfbad43fbf8273c5fecc12230d52ce5ee089021327"}, ] [package.dependencies] @@ -2870,9 +2870,6 @@ markdown-it-py = {version = ">=2.1.0", extras = ["linkify", "plugins"]} rich = ">=13.3.3" typing-extensions = ">=4.4.0,<5.0.0" -[package.extras] -syntax = ["tree-sitter (>=0.20.1,<0.21.0)", "tree_sitter_languages (>=1.7.0)"] - [[package]] name = "thefuzz" version = "0.19.0" @@ -3108,4 +3105,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "4b2b9c5b4e2e4178b32ba352e7beaf277af36412574ebd619002d4b33249f4f6" +content-hash = "ce0e4a4dad868f55f439e99ceb5f0cfb2dd084a928a401deaea4d5fdf3138bca"