python-code-quality 0.1.7__tar.gz → 0.1.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- python_code_quality-0.1.9/.gitea/workflows/python-multi-version-test.yaml +65 -0
- python_code_quality-0.1.9/.gitea/workflows/test.yaml +11 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/.gitignore +1 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/CLAUDE.md +6 -6
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/PKG-INFO +90 -95
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/README.md +89 -94
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/pyproject.toml +1 -1
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/cli.py +66 -13
- python_code_quality-0.1.9/src/py_cq/config/config.yaml +88 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/execution_engine.py +16 -4
- python_code_quality-0.1.9/src/py_cq/language_detector.py +29 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/llm_formatter.py +3 -2
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/localtypes.py +9 -5
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/parsers/banditparser.py +2 -2
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/parsers/common.py +31 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/parsers/compileparser.py +2 -2
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/parsers/coverageparser.py +1 -1
- python_code_quality-0.1.9/src/py_cq/parsers/exitcodeparser.py +16 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/parsers/halsteadparser.py +2 -2
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/parsers/interrogateparser.py +1 -1
- python_code_quality-0.1.9/src/py_cq/parsers/linecountparser.py +26 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/parsers/pytestparser.py +60 -9
- python_code_quality-0.1.9/src/py_cq/parsers/regexcountparser.py +35 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/parsers/ruffparser.py +2 -2
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/parsers/typarser.py +2 -2
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/parsers/vultureparser.py +2 -2
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/tool_registry.py +6 -5
- python_code_quality-0.1.9/tests/test_cli.py +361 -0
- python_code_quality-0.1.9/tests/test_common.py +119 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/tests/test_config.py +2 -2
- python_code_quality-0.1.9/tests/test_execution_engine.py +293 -0
- python_code_quality-0.1.9/tests/test_integration_user_tools.py +152 -0
- python_code_quality-0.1.9/tests/test_language_detector.py +87 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/tests/test_llm_formatter.py +14 -14
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/tests/test_localtypes.py +45 -2
- python_code_quality-0.1.9/tests/test_parser_exitcode.py +39 -0
- python_code_quality-0.1.9/tests/test_parser_halstead.py +116 -0
- python_code_quality-0.1.9/tests/test_parser_linecount.py +42 -0
- python_code_quality-0.1.9/tests/test_parser_pytest.py +112 -0
- python_code_quality-0.1.9/tests/test_parser_regexcount.py +42 -0
- python_code_quality-0.1.9/tests/test_tool_registry.py +16 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/uv.lock +56 -56
- python_code_quality-0.1.7/data/problems/travelling_salesman/ts_bad.py +0 -65
- python_code_quality-0.1.7/data/problems/travelling_salesman/ts_good.py +0 -61
- python_code_quality-0.1.7/src/py_cq/config/tools.yaml +0 -97
- python_code_quality-0.1.7/tests/test_common.py +0 -55
- python_code_quality-0.1.7/tests/test_execution_engine.py +0 -131
- python_code_quality-0.1.7/tests/test_parser_pytest.py +0 -35
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/.github/workflows/python-publish.yml +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/.python-version +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/LICENSE +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/__init__.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/config/__init__.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/context_hash.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/main.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/metric_aggregator.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/parsers/__init__.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/parsers/complexityparser.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/parsers/maintainabilityparser.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/src/py_cq/py.typed +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/tests/conftest.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/tests/test_context_hash.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/tests/test_parser_bandit.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/tests/test_parser_compile.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/tests/test_parser_complexity.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/tests/test_parser_coverage.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/tests/test_parser_interrogate.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/tests/test_parser_maintainability.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/tests/test_parser_ruff.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/tests/test_parser_ty.py +0 -0
- {python_code_quality-0.1.7 → python_code_quality-0.1.9}/tests/test_parser_vulture.py +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Template: Multi-version Python testing workflow for Gitea Actions
|
|
2
|
+
# Copy this file to your project's .gitea/workflows/ directory
|
|
3
|
+
#
|
|
4
|
+
# Runs tests against multiple Python versions using generic ubuntu runners.
|
|
5
|
+
# Includes optional dependency upgrade testing.
|
|
6
|
+
|
|
7
|
+
name: Python Tests
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
push:
|
|
11
|
+
branches: [main]
|
|
12
|
+
pull_request:
|
|
13
|
+
branches: [main]
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
test:
|
|
17
|
+
name: Python ${{ matrix.python-version }}
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
strategy:
|
|
20
|
+
fail-fast: false
|
|
21
|
+
matrix:
|
|
22
|
+
python-version: ['3.12', '3.13']
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
28
|
+
uses: actions/setup-python@v5
|
|
29
|
+
with:
|
|
30
|
+
python-version: ${{ matrix.python-version }}
|
|
31
|
+
|
|
32
|
+
- name: Install uv
|
|
33
|
+
uses: astral-sh/setup-uv@v7
|
|
34
|
+
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: uv sync --all-extras
|
|
37
|
+
|
|
38
|
+
- name: Run tests
|
|
39
|
+
run: uv run pytest
|
|
40
|
+
|
|
41
|
+
# Optional: Test if dependencies can be upgraded
|
|
42
|
+
upgrade-test:
|
|
43
|
+
name: Dependency Upgrade Test
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
continue-on-error: true # Don't fail the whole workflow if upgrades break
|
|
46
|
+
|
|
47
|
+
steps:
|
|
48
|
+
- uses: actions/checkout@v4
|
|
49
|
+
|
|
50
|
+
- name: Set up Python
|
|
51
|
+
uses: actions/setup-python@v5
|
|
52
|
+
with:
|
|
53
|
+
python-version: '3.14' # Test upgrades on latest Python
|
|
54
|
+
|
|
55
|
+
- name: Install uv
|
|
56
|
+
uses: astral-sh/setup-uv@v7
|
|
57
|
+
|
|
58
|
+
- name: Upgrade all dependencies
|
|
59
|
+
run: uv lock --upgrade
|
|
60
|
+
|
|
61
|
+
- name: Install upgraded dependencies
|
|
62
|
+
run: uv sync --all-extras
|
|
63
|
+
|
|
64
|
+
- name: Run tests with upgraded dependencies
|
|
65
|
+
run: uv run pytest
|
|
@@ -11,7 +11,7 @@ cq check -o llm # returns the single most critical defect as markdown
|
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
The LLM fixes it, the user re-runs, and repeats until all tools pass. CQ runs
|
|
14
|
-
11 static analysis tools in
|
|
14
|
+
11 static analysis tools in execution order (compile → security → lint → types →
|
|
15
15
|
tests → coverage → complexity → dead code → style) and aggregates results into
|
|
16
16
|
a single score.
|
|
17
17
|
|
|
@@ -39,16 +39,16 @@ uv run ruff check src/
|
|
|
39
39
|
**Pipeline flow:** CLI (`cli.py`) → tool registry → execution engine → parsers → metric aggregator → output
|
|
40
40
|
|
|
41
41
|
- **`cli.py`**: Typer app with a single `check` command. Output mode selected via `--output`/`-o` enum (`table`, `score`, `json`, `llm`). Runs tools in parallel by default. Reads `[tool.cq]` from the target project's `pyproject.toml` and applies overrides before running.
|
|
42
|
-
- **`tool_registry.py`**: Loads `src/cq/config/
|
|
43
|
-
- **`config/
|
|
44
|
-
- **`execution_engine.py`**: Runs shell commands via `subprocess.run`, caches results with `diskcache` using a content-based hash. Parallel execution via `ThreadPoolExecutor`; results are sorted by
|
|
42
|
+
- **`tool_registry.py`**: Loads `src/cq/config/config.yaml` at import time via `importlib.resources`, dynamically imports parser classes, builds a `dict[str, ToolConfig]` registry.
|
|
43
|
+
- **`config/config.yaml`** (at `src/cq/config/config.yaml`): Declares each analysis tool: shell command template (with `{context_path}` placeholder), parser class name, order, warning/error thresholds. Tools are listed and executed in order.
|
|
44
|
+
- **`execution_engine.py`**: Runs shell commands via `subprocess.run`, caches results with `diskcache` using a content-based hash. Parallel execution via `ThreadPoolExecutor`; results are sorted by order before returning.
|
|
45
45
|
- **`parsers/`**: Each parser subclasses `AbstractParser` (from `localtypes.py`), implementing `parse(RawResult) -> ToolResult` and optionally `format_llm_message(ToolResult) -> str`. Parser module names must match the lowercase parser class name (e.g., `PytestParser` → `pytestparser.py`).
|
|
46
46
|
- **`localtypes.py`**: Core dataclasses — `ToolConfig`, `RawResult`, `ToolResult`, `CombinedToolResults`, and `AbstractParser` ABC.
|
|
47
47
|
- **`metric_aggregator.py`**: Wraps results into `CombinedToolResults`, which computes an overall score as the average of per-tool mean metrics.
|
|
48
|
-
- **`llm_formatter.py`**: Selects the worst-scoring tool by severity tier then
|
|
48
|
+
- **`llm_formatter.py`**: Selects the worst-scoring tool by severity tier then order, formats its top defect as markdown for LLM consumption.
|
|
49
49
|
|
|
50
50
|
## Adding a New Analysis Tool
|
|
51
51
|
|
|
52
|
-
1. Add tool entry in `config/
|
|
52
|
+
1. Add tool entry in `config/config.yaml` with command template, parser name, order, and thresholds.
|
|
53
53
|
2. Create `src/cq/parsers/<parsername>.py` with a class matching the `parser` field in YAML.
|
|
54
54
|
3. The parser must subclass `AbstractParser` and implement `parse(RawResult) -> ToolResult`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-code-quality
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9
|
|
4
4
|
Summary: Python Code Quality Analysis Tool - feed the results from 11 CQ tools straight into an LLM. Minimal tokens.
|
|
5
5
|
Project-URL: Homepage, https://github.com/rhiza-fr/py-cq
|
|
6
6
|
Project-URL: Repository, https://github.com/rhiza-fr/py-cq
|
|
@@ -28,14 +28,16 @@ Description-Content-Type: text/markdown
|
|
|
28
28
|
|
|
29
29
|
Feed the results from 11+ code quality tools to an LLM. Minimal tokens.
|
|
30
30
|
|
|
31
|
+
Why? It removes the mental burden of understanding all these tools and parsing their results.
|
|
32
|
+
|
|
31
33
|
The primary workflow is:
|
|
32
34
|
|
|
33
35
|
```bash
|
|
34
36
|
# get the single most critical defect as markdown
|
|
35
37
|
cq check . -o llm
|
|
36
38
|
```
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
+
|
|
40
|
+
```python
|
|
39
41
|
`data/problems/travelling_salesman/ts_bad.py:21` — **F841**: Local variable `unused_variable` is assigned to but never used
|
|
40
42
|
|
|
41
43
|
18: min_dist = float("inf")
|
|
@@ -51,10 +53,13 @@ Please fix only this issue. After fixing, run `cq check . -o llm` to verify.
|
|
|
51
53
|
```
|
|
52
54
|
Feed to an LLM with edit tools and repeat until there are no issues, e.g.
|
|
53
55
|
|
|
54
|
-
```
|
|
56
|
+
```python
|
|
55
57
|
cq check . -o llm | claude -p "fix this"
|
|
58
|
+
# or
|
|
59
|
+
cq check . -o llm | ollama run gpt-oss:20b "Explain how to fix this"
|
|
56
60
|
```
|
|
57
61
|
|
|
62
|
+
|
|
58
63
|
## Install
|
|
59
64
|
|
|
60
65
|
```bash
|
|
@@ -62,21 +67,22 @@ cq check . -o llm | claude -p "fix this"
|
|
|
62
67
|
uv tool install python-code-quality
|
|
63
68
|
|
|
64
69
|
# or, clone it then install
|
|
65
|
-
git
|
|
70
|
+
git clone https://github.com/rhiza-fr/py-cq.git
|
|
66
71
|
cd py-cq
|
|
67
72
|
uv tool install .
|
|
68
73
|
```
|
|
69
74
|
|
|
70
75
|
## Tools
|
|
71
76
|
|
|
72
|
-
These tools are run in **parallel
|
|
77
|
+
These tools are run in **parallel** except:
|
|
78
|
+
When running '-o llm', we run sequentially and exit early at the first error.
|
|
73
79
|
|
|
74
|
-
|
|
|
80
|
+
| Order | Tool | Measures |
|
|
75
81
|
|----------|------|----------|
|
|
76
82
|
| 1 | compileall | Syntax errors |
|
|
77
|
-
| 2 |
|
|
78
|
-
| 3 |
|
|
79
|
-
| 4 |
|
|
83
|
+
| 2 | ruff | Lint / style |
|
|
84
|
+
| 3 | ty | Type errors |
|
|
85
|
+
| 4 | bandit | Security vulnerabilities |
|
|
80
86
|
| 5 | pytest | Test pass rate |
|
|
81
87
|
| 6 | coverage | Test coverage |
|
|
82
88
|
| 7 | radon cc | Cyclomatic complexity |
|
|
@@ -85,37 +91,28 @@ These tools are run in **parallel**:
|
|
|
85
91
|
| 10 | vulture | Dead code |
|
|
86
92
|
| 11 | interrogate | Docstring coverage |
|
|
87
93
|
|
|
88
|
-
Diskcache is used to cache tool output for lightning fast re-runs. Sane defaults: <100 Mb, <5 days, No pickle
|
|
94
|
+
Diskcache is used to cache tool output for lightning fast re-runs. Sane defaults: <100 Mb, <5 days, No pickle risk.
|
|
89
95
|
|
|
90
96
|
|
|
91
97
|
## Usage
|
|
92
98
|
|
|
93
99
|
```bash
|
|
94
|
-
|
|
95
|
-
cq check -o llm
|
|
96
|
-
|
|
97
|
-
#
|
|
98
|
-
cq check .
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
cq check . -
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
cq check . -o json
|
|
105
|
-
|
|
106
|
-
# Explicit path
|
|
107
|
-
cq check path/to/project/
|
|
108
|
-
cq check path/to/file.py
|
|
109
|
-
|
|
110
|
-
# Run sequentially if you like things slow
|
|
111
|
-
cq check . --workers 1
|
|
100
|
+
cq check . # Table overview of scores for humans
|
|
101
|
+
cq check . -o llm # Top defect as markdown for LLMs
|
|
102
|
+
cq check . -o score # Numeric score only for CI
|
|
103
|
+
cq check . -o json # Detailed parsed JSON output for jq
|
|
104
|
+
cq check . -o raw # Raw tool output for debug
|
|
105
|
+
cq check path/to/file.py # Just one file (skips pytest and coverage)
|
|
106
|
+
cq check . --workers 1 # Run sequentially if you like things slow
|
|
107
|
+
cq check . --clear-cache # Clear cached results before running (rarely needed)
|
|
108
|
+
cq config path/to/project/ # Show effective tool configuration
|
|
109
|
+
```
|
|
112
110
|
|
|
113
|
-
|
|
114
|
-
cq check . --clear-cache
|
|
111
|
+
**Exit codes:** `cq check` exits with code `1` if any tool metric falls below its `error_threshold`, making it suitable as a CI gate:
|
|
115
112
|
|
|
116
|
-
|
|
117
|
-
cq
|
|
118
|
-
cq
|
|
113
|
+
```bash
|
|
114
|
+
cq check . && deploy # block deploy on errors
|
|
115
|
+
cq check . -o score # print score, exit 1 on errors
|
|
119
116
|
```
|
|
120
117
|
|
|
121
118
|
## Table output
|
|
@@ -129,9 +126,9 @@ cq config path/to/project/
|
|
|
129
126
|
┃ Tool ┃ Time ┃ Metric ┃ Score ┃ Status ┃
|
|
130
127
|
┡━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━┩
|
|
131
128
|
│ compile │ 0.42s │ compile │ 1.000 │ OK │
|
|
132
|
-
│ bandit │ 0.56s │ security │ 1.000 │ OK │
|
|
133
129
|
│ ruff │ 0.17s │ lint │ 1.000 │ OK │
|
|
134
130
|
│ ty │ 0.33s │ type_check │ 1.000 │ OK │
|
|
131
|
+
│ bandit │ 0.56s │ security │ 1.000 │ OK │
|
|
135
132
|
│ pytest │ 0.91s │ tests │ 1.000 │ OK │
|
|
136
133
|
│ coverage │ 1.26s │ coverage │ 0.910 │ OK │
|
|
137
134
|
│ radon cc │ 0.32s │ simplicity │ 0.982 │ OK │
|
|
@@ -160,30 +157,36 @@ cq config path/to/project/
|
|
|
160
157
|
```
|
|
161
158
|
|
|
162
159
|
```json
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
"details": {},
|
|
170
|
-
"raw": {
|
|
171
|
-
"tool_name": "compile",
|
|
172
|
-
"command": ".venv\\Scripts\\python.exe -m compileall -r 10 -j 8 . -x .*venv",
|
|
173
|
-
"stdout": "Compiling './src/project/file.py'...",
|
|
174
|
-
"stderr": "",
|
|
175
|
-
"return_code": 0,
|
|
176
|
-
"timestamp": "2026-02-19 05:03:11"
|
|
177
|
-
},
|
|
178
|
-
"duration_s": 0.08294440002646297
|
|
160
|
+
[
|
|
161
|
+
{
|
|
162
|
+
"tool_name": "compile",
|
|
163
|
+
"metrics": {
|
|
164
|
+
"compile": 1.0
|
|
179
165
|
},
|
|
180
|
-
{
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
166
|
+
"details": {},
|
|
167
|
+
"duration_s": 0.05611889995634556
|
|
168
|
+
}
|
|
169
|
+
...
|
|
170
|
+
]
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Raw output
|
|
174
|
+
```bash
|
|
175
|
+
> cq check . -o raw
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
[
|
|
180
|
+
{
|
|
181
|
+
"tool_name": "compile",
|
|
182
|
+
"command": "D:\\ai\\py-cq\\.venv\\Scripts\\python.exe -m compileall -r 10 -j 8 . -x .*venv",
|
|
183
|
+
"stdout": "",
|
|
184
|
+
"stderr": "",
|
|
185
|
+
"return_code": 0,
|
|
186
|
+
"timestamp": "2026-02-20 10:01:22"
|
|
187
|
+
}
|
|
188
|
+
...
|
|
189
|
+
]
|
|
187
190
|
```
|
|
188
191
|
|
|
189
192
|
## Configuration
|
|
@@ -195,69 +198,66 @@ Add a `[tool.cq]` section to your project's `pyproject.toml`:
|
|
|
195
198
|
# Skip tools that are slow or not relevant to your project
|
|
196
199
|
disable = ["coverage", "interrogate"]
|
|
197
200
|
|
|
201
|
+
# Lines of source context shown around each defect in LLM output (default: 15)
|
|
202
|
+
context_lines = 15
|
|
203
|
+
|
|
198
204
|
# Override warning/error thresholds per tool
|
|
199
205
|
[tool.cq.thresholds.coverage]
|
|
200
206
|
warning = 0.9
|
|
201
207
|
error = 0.7
|
|
202
208
|
```
|
|
203
209
|
|
|
204
|
-
Tool IDs match the keys in `config/
|
|
210
|
+
Tool IDs match the keys in `config/config.yaml`: `compile`, `ruff`, `ty`, `bandit`, `pytest`, `coverage`, `radon-cc`, `radon-mi`, `radon-hal`, `vulture`, `interrogate`.
|
|
205
211
|
|
|
206
212
|
|
|
207
213
|
### Default config
|
|
208
214
|
|
|
209
215
|
```yaml
|
|
210
|
-
|
|
216
|
+
python:
|
|
211
217
|
|
|
212
|
-
|
|
213
|
-
name: "compile"
|
|
218
|
+
compile:
|
|
214
219
|
command: "{python} -m compileall -r 10 -j 8 {context_path} -x .*venv"
|
|
215
220
|
parser: "CompileParser"
|
|
216
|
-
|
|
221
|
+
order: 1
|
|
217
222
|
warning_threshold: 0.9999
|
|
218
223
|
error_threshold: 0.9999
|
|
219
224
|
|
|
220
|
-
bandit:
|
|
221
|
-
name: "bandit"
|
|
222
|
-
command: "{python} -m bandit -r {context_path} -f json -q -s B101 --severity-level medium --exclude {input_path_posix}/.venv,{input_path_posix}/tests"
|
|
223
|
-
parser: "BanditParser"
|
|
224
|
-
priority: 2
|
|
225
|
-
warning_threshold: 0.9999
|
|
226
|
-
error_threshold: 0.8
|
|
227
|
-
|
|
228
225
|
ruff:
|
|
229
|
-
name: "ruff"
|
|
230
226
|
command: "{python} -m ruff check --output-format concise --no-cache {context_path}"
|
|
231
227
|
parser: "RuffParser"
|
|
232
|
-
|
|
228
|
+
order: 2
|
|
233
229
|
warning_threshold: 0.9999
|
|
234
230
|
error_threshold: 0.9
|
|
235
231
|
|
|
236
232
|
ty:
|
|
237
|
-
name: "ty"
|
|
238
233
|
command: "{python} -m ty check --output-format concise --color never {context_path}"
|
|
239
234
|
parser: "TyParser"
|
|
240
|
-
|
|
235
|
+
order: 3
|
|
241
236
|
warning_threshold: 0.9999
|
|
242
237
|
error_threshold: 0.8
|
|
243
238
|
run_in_target_env: true
|
|
244
239
|
extra_deps:
|
|
245
240
|
- ty
|
|
246
241
|
|
|
242
|
+
bandit:
|
|
243
|
+
command: "{python} -m bandit -r {context_path} -f json -q -s B101 --severity-level medium --exclude {input_path_posix}/.venv,{input_path_posix}/tests"
|
|
244
|
+
parser: "BanditParser"
|
|
245
|
+
order: 4
|
|
246
|
+
warning_threshold: 0.9999
|
|
247
|
+
error_threshold: 0.8
|
|
248
|
+
|
|
247
249
|
pytest:
|
|
248
|
-
name: "pytest"
|
|
249
250
|
command: "{python} -m pytest -v {context_path}"
|
|
250
251
|
parser: "PytestParser"
|
|
251
|
-
|
|
252
|
-
warning_threshold: 0
|
|
253
|
-
error_threshold: 0
|
|
252
|
+
order: 5
|
|
253
|
+
warning_threshold: 1.0
|
|
254
|
+
error_threshold: 1.0
|
|
254
255
|
run_in_target_env: true
|
|
255
256
|
|
|
256
257
|
coverage:
|
|
257
|
-
|
|
258
|
-
command: "{python} -m coverage run -m pytest {context_path} && {python} -m coverage report"
|
|
258
|
+
command: "{python} -m coverage run --omit=*/tests/*,*/test_*.py -m pytest {context_path} && {python} -m coverage report --omit=*/tests/*,*/test_*.py"
|
|
259
259
|
parser: "CoverageParser"
|
|
260
|
-
|
|
260
|
+
order: 6
|
|
261
261
|
warning_threshold: 0.9
|
|
262
262
|
error_threshold: 0.5
|
|
263
263
|
run_in_target_env: true
|
|
@@ -265,43 +265,38 @@ tools:
|
|
|
265
265
|
- coverage
|
|
266
266
|
- pytest
|
|
267
267
|
|
|
268
|
-
|
|
269
|
-
name: "radon cc"
|
|
268
|
+
radon-cc:
|
|
270
269
|
command: "{python} -m radon cc --json {context_path}"
|
|
271
270
|
parser: "ComplexityParser"
|
|
272
|
-
|
|
271
|
+
order: 7
|
|
273
272
|
warning_threshold: 0.6
|
|
274
273
|
error_threshold: 0.4
|
|
275
274
|
|
|
276
|
-
|
|
277
|
-
name: "radon mi"
|
|
275
|
+
radon-mi:
|
|
278
276
|
command: "{python} -m radon mi -s --json {context_path}"
|
|
279
277
|
parser: "MaintainabilityParser"
|
|
280
|
-
|
|
278
|
+
order: 8
|
|
281
279
|
warning_threshold: 0.6
|
|
282
280
|
error_threshold: 0.4
|
|
283
281
|
|
|
284
|
-
|
|
285
|
-
name: "radon hal"
|
|
282
|
+
radon-hal:
|
|
286
283
|
command: "{python} -m radon hal -f --json {context_path}"
|
|
287
284
|
parser: "HalsteadParser"
|
|
288
|
-
|
|
285
|
+
order: 9
|
|
289
286
|
warning_threshold: 0.5
|
|
290
287
|
error_threshold: 0.3
|
|
291
288
|
|
|
292
289
|
vulture:
|
|
293
|
-
name: "vulture"
|
|
294
290
|
command: "{python} -m vulture {context_path} --min-confidence 80 --exclude .venv,dist,.*_cache,docs,.git"
|
|
295
291
|
parser: "VultureParser"
|
|
296
|
-
|
|
292
|
+
order: 10
|
|
297
293
|
warning_threshold: 0.9999
|
|
298
294
|
error_threshold: 0.8
|
|
299
295
|
|
|
300
296
|
interrogate:
|
|
301
|
-
name: "interrogate"
|
|
302
297
|
command: "{python} -m interrogate {context_path} -v --fail-under 0"
|
|
303
298
|
parser: "InterrogateParser"
|
|
304
|
-
|
|
299
|
+
order: 11
|
|
305
300
|
warning_threshold: 0.8
|
|
306
301
|
error_threshold: 0.3
|
|
307
302
|
|