python-code-quality 0.1.9__tar.gz → 0.1.11__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.
Files changed (65) hide show
  1. python_code_quality-0.1.9/README.md → python_code_quality-0.1.11/PKG-INFO +68 -0
  2. python_code_quality-0.1.9/PKG-INFO → python_code_quality-0.1.11/README.md +39 -26
  3. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/pyproject.toml +10 -5
  4. python_code_quality-0.1.9/.gitea/workflows/python-multi-version-test.yaml +0 -65
  5. python_code_quality-0.1.9/.gitea/workflows/test.yaml +0 -11
  6. python_code_quality-0.1.9/.github/workflows/python-publish.yml +0 -70
  7. python_code_quality-0.1.9/.gitignore +0 -18
  8. python_code_quality-0.1.9/.python-version +0 -1
  9. python_code_quality-0.1.9/CLAUDE.md +0 -54
  10. python_code_quality-0.1.9/LICENSE +0 -21
  11. python_code_quality-0.1.9/tests/conftest.py +0 -7
  12. python_code_quality-0.1.9/tests/test_cli.py +0 -361
  13. python_code_quality-0.1.9/tests/test_common.py +0 -119
  14. python_code_quality-0.1.9/tests/test_config.py +0 -84
  15. python_code_quality-0.1.9/tests/test_context_hash.py +0 -81
  16. python_code_quality-0.1.9/tests/test_execution_engine.py +0 -293
  17. python_code_quality-0.1.9/tests/test_integration_user_tools.py +0 -152
  18. python_code_quality-0.1.9/tests/test_language_detector.py +0 -87
  19. python_code_quality-0.1.9/tests/test_llm_formatter.py +0 -237
  20. python_code_quality-0.1.9/tests/test_localtypes.py +0 -102
  21. python_code_quality-0.1.9/tests/test_parser_bandit.py +0 -66
  22. python_code_quality-0.1.9/tests/test_parser_compile.py +0 -61
  23. python_code_quality-0.1.9/tests/test_parser_complexity.py +0 -76
  24. python_code_quality-0.1.9/tests/test_parser_coverage.py +0 -59
  25. python_code_quality-0.1.9/tests/test_parser_exitcode.py +0 -39
  26. python_code_quality-0.1.9/tests/test_parser_halstead.py +0 -116
  27. python_code_quality-0.1.9/tests/test_parser_interrogate.py +0 -72
  28. python_code_quality-0.1.9/tests/test_parser_linecount.py +0 -42
  29. python_code_quality-0.1.9/tests/test_parser_maintainability.py +0 -74
  30. python_code_quality-0.1.9/tests/test_parser_pytest.py +0 -112
  31. python_code_quality-0.1.9/tests/test_parser_regexcount.py +0 -42
  32. python_code_quality-0.1.9/tests/test_parser_ruff.py +0 -33
  33. python_code_quality-0.1.9/tests/test_parser_ty.py +0 -33
  34. python_code_quality-0.1.9/tests/test_parser_vulture.py +0 -51
  35. python_code_quality-0.1.9/tests/test_tool_registry.py +0 -16
  36. python_code_quality-0.1.9/uv.lock +0 -519
  37. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/__init__.py +0 -0
  38. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/cli.py +0 -0
  39. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/config/__init__.py +0 -0
  40. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/config/config.yaml +0 -0
  41. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/context_hash.py +0 -0
  42. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/execution_engine.py +0 -0
  43. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/language_detector.py +0 -0
  44. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/llm_formatter.py +0 -0
  45. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/localtypes.py +0 -0
  46. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/main.py +0 -0
  47. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/metric_aggregator.py +0 -0
  48. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/__init__.py +0 -0
  49. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/banditparser.py +0 -0
  50. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/common.py +0 -0
  51. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/compileparser.py +0 -0
  52. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/complexityparser.py +0 -0
  53. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/coverageparser.py +0 -0
  54. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/exitcodeparser.py +0 -0
  55. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/halsteadparser.py +0 -0
  56. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/interrogateparser.py +0 -0
  57. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/linecountparser.py +0 -0
  58. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/maintainabilityparser.py +0 -0
  59. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/pytestparser.py +0 -0
  60. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/regexcountparser.py +0 -0
  61. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/ruffparser.py +0 -0
  62. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/typarser.py +0 -0
  63. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/parsers/vultureparser.py +0 -0
  64. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/py.typed +0 -0
  65. {python_code_quality-0.1.9 → python_code_quality-0.1.11}/src/py_cq/tool_registry.py +0 -0
@@ -1,5 +1,40 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-code-quality
3
+ Version: 0.1.11
4
+ Summary: Python Code Quality Analysis Tool - feed the results from 11 CQ tools straight into an LLM. Minimal tokens.
5
+ Author: Chris Kilner
6
+ Author-email: Chris Kilner <chris@rhiza.fr>
7
+ License-Expression: MIT
8
+ Classifier: Programming Language :: Python :: 3.12
9
+ Classifier: Programming Language :: Python :: 3.13
10
+ Classifier: Programming Language :: Python :: 3.14
11
+ Requires-Dist: bandit>=1.8.0
12
+ Requires-Dist: coverage>=7.8.2
13
+ Requires-Dist: diskcache>=5.6.3
14
+ Requires-Dist: interrogate>=1.7.0
15
+ Requires-Dist: pytest>=8.4.0
16
+ Requires-Dist: pytest-cov>=6.1.1
17
+ Requires-Dist: pytest-json-report>=1.5.0
18
+ Requires-Dist: pyyaml>=6.0.2
19
+ Requires-Dist: radon>=6.0.1
20
+ Requires-Dist: rich>=14.0.0
21
+ Requires-Dist: ruff>=0.14.1
22
+ Requires-Dist: ty>=0.0.17
23
+ Requires-Dist: typer>=0.16.0
24
+ Requires-Dist: vulture>=2.14
25
+ Requires-Python: >=3.12
26
+ Project-URL: Homepage, https://github.com/rhiza-fr/py-cq
27
+ Project-URL: Repository, https://github.com/rhiza-fr/py-cq
28
+ Description-Content-Type: text/markdown
29
+
1
30
  # CQ - Python Code Quality Analysis Tool
2
31
 
32
+ [![CI](https://img.shields.io/github/actions/workflow/status/rhiza-fr/py-cq/ci.yml?label=CI)](https://github.com/rhiza-fr/py-cq/actions/workflows/ci.yml)
33
+ [![codecov](https://codecov.io/gh/rhiza-fr/py-cq/graph/badge.svg)](https://codecov.io/gh/rhiza-fr/py-cq)
34
+ [![PyPI version](https://img.shields.io/pypi/v/python-code-quality)](https://pypi.org/project/python-code-quality/)
35
+ [![Python versions](https://img.shields.io/pypi/pyversions/python-code-quality)](https://pypi.org/project/python-code-quality/)
36
+ [![License](https://img.shields.io/github/license/rhiza-fr/py-cq)](LICENSE)
37
+
3
38
  Feed the results from 11+ code quality tools to an LLM. Minimal tokens.
4
39
 
5
40
  Why? It removes the mental burden of understanding all these tools and parsing their results.
@@ -89,6 +124,39 @@ cq check . && deploy # block deploy on errors
89
124
  cq check . -o score # print score, exit 1 on errors
90
125
  ```
91
126
 
127
+ ## Claude Code Integration
128
+
129
+ Add a stop hook to your project's `.claude/settings.json` so Claude automatically checks quality after each session and loops until clean:
130
+
131
+ ```json
132
+ {
133
+ "hooks": {
134
+ "Stop": [{
135
+ "matcher": "",
136
+ "hooks": [{"type": "command", "command": "cq check . -o score && echo 'CQ: all clear' || cq check . -o llm"}]
137
+ }]
138
+ }
139
+ }
140
+ ```
141
+
142
+ When the score passes, Claude sees `CQ: all clear` (~5 tokens). When it fails, Claude receives the targeted fix prompt and continues working. This automates the `cq check . -o llm | claude -p "fix this"` loop.
143
+
144
+ > **Note:** Use project-level `.claude/settings.json`, not global settings — this hook only makes sense in Python projects.
145
+
146
+ ### As a slash command (skill)
147
+
148
+ For manual invocation, create `.claude/commands/cq-fix.md`:
149
+
150
+ ```markdown
151
+ $(cq check . -o llm)
152
+ ```
153
+
154
+ Then invoke it with `/cq-fix` in Claude Code. The `$(...)` embeds the live `cq` output directly into the prompt before Claude starts, so it sees the issue immediately without an extra tool call.
155
+
156
+ **Hook vs skill:**
157
+ - **Stop hook** — automatic, runs after every session, best for unattended loops
158
+ - **Skill** — manual `/cq-fix`, gives you explicit control over when to check
159
+
92
160
  ## Table output
93
161
 
94
162
  ```bash
@@ -1,31 +1,11 @@
1
- Metadata-Version: 2.4
2
- Name: python-code-quality
3
- Version: 0.1.9
4
- Summary: Python Code Quality Analysis Tool - feed the results from 11 CQ tools straight into an LLM. Minimal tokens.
5
- Project-URL: Homepage, https://github.com/rhiza-fr/py-cq
6
- Project-URL: Repository, https://github.com/rhiza-fr/py-cq
7
- Author-email: Chris Kilner <chris@rhiza.fr>
8
- License-Expression: MIT
9
- License-File: LICENSE
10
- Requires-Python: >=3.12
11
- Requires-Dist: bandit>=1.8.0
12
- Requires-Dist: coverage>=7.8.2
13
- Requires-Dist: diskcache>=5.6.3
14
- Requires-Dist: interrogate>=1.7.0
15
- Requires-Dist: pytest-cov>=6.1.1
16
- Requires-Dist: pytest-json-report>=1.5.0
17
- Requires-Dist: pytest>=8.4.0
18
- Requires-Dist: pyyaml>=6.0.2
19
- Requires-Dist: radon>=6.0.1
20
- Requires-Dist: rich>=14.0.0
21
- Requires-Dist: ruff>=0.14.1
22
- Requires-Dist: ty>=0.0.17
23
- Requires-Dist: typer>=0.16.0
24
- Requires-Dist: vulture>=2.14
25
- Description-Content-Type: text/markdown
26
-
27
1
  # CQ - Python Code Quality Analysis Tool
28
2
 
3
+ [![CI](https://img.shields.io/github/actions/workflow/status/rhiza-fr/py-cq/ci.yml?label=CI)](https://github.com/rhiza-fr/py-cq/actions/workflows/ci.yml)
4
+ [![codecov](https://codecov.io/gh/rhiza-fr/py-cq/graph/badge.svg)](https://codecov.io/gh/rhiza-fr/py-cq)
5
+ [![PyPI version](https://img.shields.io/pypi/v/python-code-quality)](https://pypi.org/project/python-code-quality/)
6
+ [![Python versions](https://img.shields.io/pypi/pyversions/python-code-quality)](https://pypi.org/project/python-code-quality/)
7
+ [![License](https://img.shields.io/github/license/rhiza-fr/py-cq)](LICENSE)
8
+
29
9
  Feed the results from 11+ code quality tools to an LLM. Minimal tokens.
30
10
 
31
11
  Why? It removes the mental burden of understanding all these tools and parsing their results.
@@ -115,6 +95,39 @@ cq check . && deploy # block deploy on errors
115
95
  cq check . -o score # print score, exit 1 on errors
116
96
  ```
117
97
 
98
+ ## Claude Code Integration
99
+
100
+ Add a stop hook to your project's `.claude/settings.json` so Claude automatically checks quality after each session and loops until clean:
101
+
102
+ ```json
103
+ {
104
+ "hooks": {
105
+ "Stop": [{
106
+ "matcher": "",
107
+ "hooks": [{"type": "command", "command": "cq check . -o score && echo 'CQ: all clear' || cq check . -o llm"}]
108
+ }]
109
+ }
110
+ }
111
+ ```
112
+
113
+ When the score passes, Claude sees `CQ: all clear` (~5 tokens). When it fails, Claude receives the targeted fix prompt and continues working. This automates the `cq check . -o llm | claude -p "fix this"` loop.
114
+
115
+ > **Note:** Use project-level `.claude/settings.json`, not global settings — this hook only makes sense in Python projects.
116
+
117
+ ### As a slash command (skill)
118
+
119
+ For manual invocation, create `.claude/commands/cq-fix.md`:
120
+
121
+ ```markdown
122
+ $(cq check . -o llm)
123
+ ```
124
+
125
+ Then invoke it with `/cq-fix` in Claude Code. The `$(...)` embeds the live `cq` output directly into the prompt before Claude starts, so it sees the issue immediately without an extra tool call.
126
+
127
+ **Hook vs skill:**
128
+ - **Stop hook** — automatic, runs after every session, best for unattended loops
129
+ - **Skill** — manual `/cq-fix`, gives you explicit control over when to check
130
+
118
131
  ## Table output
119
132
 
120
133
  ```bash
@@ -1,11 +1,16 @@
1
1
  [project]
2
2
  name = "python-code-quality"
3
- version = "0.1.9"
3
+ version = "0.1.11"
4
4
  description = "Python Code Quality Analysis Tool - feed the results from 11 CQ tools straight into an LLM. Minimal tokens."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
7
7
  license = "MIT"
8
8
  authors = [{name = "Chris Kilner", email = "chris@rhiza.fr"}]
9
+ classifiers = [
10
+ "Programming Language :: Python :: 3.12",
11
+ "Programming Language :: Python :: 3.13",
12
+ "Programming Language :: Python :: 3.14",
13
+ ]
9
14
 
10
15
  dependencies = [
11
16
  "bandit>=1.8.0",
@@ -29,11 +34,11 @@ Homepage = "https://github.com/rhiza-fr/py-cq"
29
34
  Repository = "https://github.com/rhiza-fr/py-cq"
30
35
 
31
36
  [build-system]
32
- requires = ["hatchling"]
33
- build-backend = "hatchling.build"
37
+ requires = ["uv_build"]
38
+ build-backend = "uv_build"
34
39
 
35
- [tool.hatch.build.targets.wheel]
36
- packages = ["src/py_cq"]
40
+ [tool.uv.build-backend]
41
+ module-name = "py_cq"
37
42
 
38
43
  [project.scripts]
39
44
  cq = "py_cq.main:main"
@@ -1,65 +0,0 @@
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
@@ -1,11 +0,0 @@
1
- name: Tests
2
-
3
- on: [push, pull_request]
4
-
5
- jobs:
6
- test:
7
- runs-on: python-test-image
8
- steps:
9
- - uses: actions/checkout@v4
10
- - run: uv sync --all-extras
11
- - run: uv run pytest
@@ -1,70 +0,0 @@
1
- # This workflow will upload a Python Package to PyPI when a release is created
2
- # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
-
4
- # This workflow uses actions that are not certified by GitHub.
5
- # They are provided by a third-party and are governed by
6
- # separate terms of service, privacy policy, and support
7
- # documentation.
8
-
9
- name: Upload Python Package
10
-
11
- on:
12
- release:
13
- types: [published]
14
-
15
- permissions:
16
- contents: read
17
-
18
- jobs:
19
- release-build:
20
- runs-on: ubuntu-latest
21
-
22
- steps:
23
- - uses: actions/checkout@v4
24
-
25
- - name: Install uv
26
- uses: astral-sh/setup-uv@v5
27
-
28
- - name: Set up Python
29
- run: uv python install
30
-
31
- - name: Build release distributions
32
- run: |
33
- uv build
34
-
35
- - name: Upload distributions
36
- uses: actions/upload-artifact@v4
37
- with:
38
- name: release-dists
39
- path: dist/
40
-
41
- pypi-publish:
42
- runs-on: ubuntu-latest
43
- needs:
44
- - release-build
45
- permissions:
46
- # IMPORTANT: this permission is mandatory for trusted publishing
47
- id-token: write
48
-
49
- # Dedicated environments with protections for publishing are strongly recommended.
50
- # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51
- environment:
52
- name: pypi
53
- # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54
- # url: https://pypi.org/p/YOURPROJECT
55
- #
56
- # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57
- # ALTERNATIVE: exactly, uncomment the following line instead:
58
- url: https://pypi.org/project/python-code-quality/${{ github.event.release.name }}
59
-
60
- steps:
61
- - name: Retrieve release distributions
62
- uses: actions/download-artifact@v4
63
- with:
64
- name: release-dists
65
- path: dist/
66
-
67
- - name: Publish release distributions to PyPI
68
- uses: pypa/gh-action-pypi-publish@release/v1
69
- with:
70
- packages-dir: dist/
@@ -1,18 +0,0 @@
1
- # Python-generated files
2
- __pycache__/
3
- *.py[oc]
4
- build/
5
- dist/
6
- wheels/
7
- *.egg-info
8
- .*_cache/
9
- # Virtual environments
10
- .venv
11
- profile.prof
12
- analysis_results.json
13
- .coverage
14
- .aider*
15
- .claude
16
- .cq.json
17
-
18
- docs/plans/*
@@ -1 +0,0 @@
1
- 3.14
@@ -1,54 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## Project Overview
6
-
7
- CQ is a Python CLI tool for iterative, LLM-assisted code improvement. The primary use case is:
8
-
9
- ```bash
10
- cq check -o llm # returns the single most critical defect as markdown
11
- ```
12
-
13
- The LLM fixes it, the user re-runs, and repeats until all tools pass. CQ runs
14
- 11 static analysis tools in execution order (compile → security → lint → types →
15
- tests → coverage → complexity → dead code → style) and aggregates results into
16
- a single score.
17
-
18
- ## Commands
19
-
20
- ```bash
21
- # Run tests
22
- uv run pytest
23
-
24
- # Run a single test
25
- uv run pytest tests/test_common.py::test_score_logistic_variant
26
-
27
- # Run the CLI
28
- uv run cq check # table output, current directory
29
- uv run cq check -o llm # LLM markdown, primary use case
30
- uv run cq check -o score # numeric score
31
- uv run cq check path/to/project/
32
-
33
- # Lint
34
- uv run ruff check src/
35
- ```
36
-
37
- ## Architecture
38
-
39
- **Pipeline flow:** CLI (`cli.py`) → tool registry → execution engine → parsers → metric aggregator → output
40
-
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/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
- - **`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
- - **`localtypes.py`**: Core dataclasses — `ToolConfig`, `RawResult`, `ToolResult`, `CombinedToolResults`, and `AbstractParser` ABC.
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 order, formats its top defect as markdown for LLM consumption.
49
-
50
- ## Adding a New Analysis Tool
51
-
52
- 1. Add tool entry in `config/config.yaml` with command template, parser name, order, and thresholds.
53
- 2. Create `src/cq/parsers/<parsername>.py` with a class matching the `parser` field in YAML.
54
- 3. The parser must subclass `AbstractParser` and implement `parse(RawResult) -> ToolResult`.
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Chris Kilner <chris@rhiza.fr>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,7 +0,0 @@
1
- """Shared test helpers."""
2
-
3
- from py_cq.localtypes import RawResult
4
-
5
-
6
- def raw(stdout="", return_code=0):
7
- return RawResult(tool_name="test", command="cmd", stdout=stdout, return_code=return_code)