pycodecommenter 2.1.0__tar.gz → 2.3.0__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 (80) hide show
  1. pycodecommenter-2.3.0/.github/workflows/docs.yml +66 -0
  2. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/.github/workflows/publish.yml +32 -32
  3. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/.gitignore +56 -56
  4. pycodecommenter-2.3.0/.well-known/ai-plugin.json +23 -0
  5. pycodecommenter-2.3.0/CHANGELOG.md +167 -0
  6. pycodecommenter-2.3.0/CITATION.cff +32 -0
  7. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/CONTRIBUTING.md +29 -29
  8. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/Future Work/Future Release WorkPlan.txt +14 -14
  9. pycodecommenter-2.3.0/Future Work/More future work prompt.md +82 -0
  10. pycodecommenter-2.3.0/Future Work/More future work.md +208 -0
  11. pycodecommenter-2.3.0/Future Work/Vulnerabilties.md +301 -0
  12. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/Future Work/v2.1.0 /342/200/224 Remaining Items (dry-run, backup, config loader, test rewrite).txt" +142 -142
  13. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/Future Work/v2.2.0 /342/200/224 Accuracy & Output.txt" +125 -125
  14. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/Future Work/v3.0.0 /342/200/224 Safe, Configurable, Extensible.txt" +131 -131
  15. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/Future Work/v3.1.0 /342/200/224 Integrations.txt" +139 -138
  16. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/LICENSE +21 -21
  17. pycodecommenter-2.3.0/PKG-INFO +404 -0
  18. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/PyCodeCommenter/__init__.py +28 -27
  19. pycodecommenter-2.3.0/PyCodeCommenter/cli.py +297 -0
  20. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/PyCodeCommenter/commenter.py +555 -477
  21. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/PyCodeCommenter/coverage.py +156 -124
  22. pycodecommenter-2.3.0/PyCodeCommenter/docstring_parser.py +215 -0
  23. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/PyCodeCommenter/inference.py +20 -4
  24. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/PyCodeCommenter/parameter_descriptions.py +76 -76
  25. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/PyCodeCommenter/templates.py +95 -95
  26. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/PyCodeCommenter/type_analyzer.py +203 -203
  27. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/PyCodeCommenter/validator.py +672 -563
  28. pycodecommenter-2.3.0/README.md +364 -0
  29. pycodecommenter-2.3.0/docs/assets/.gitkeep +12 -0
  30. pycodecommenter-2.3.0/docs/changelog.md +76 -0
  31. pycodecommenter-2.3.0/docs/cli-reference.md +270 -0
  32. pycodecommenter-2.3.0/docs/configuration.md +124 -0
  33. pycodecommenter-2.3.0/docs/contributing.md +114 -0
  34. pycodecommenter-2.3.0/docs/docstring-styles.md +148 -0
  35. pycodecommenter-2.3.0/docs/faq.md +249 -0
  36. pycodecommenter-2.3.0/docs/getting-started.md +120 -0
  37. pycodecommenter-2.3.0/docs/index.md +185 -0
  38. pycodecommenter-2.3.0/docs/javascripts/custom.js +61 -0
  39. pycodecommenter-2.3.0/docs/python-api.md +626 -0
  40. pycodecommenter-2.3.0/docs/recipes.md +294 -0
  41. pycodecommenter-2.3.0/docs/robots.txt +20 -0
  42. pycodecommenter-2.3.0/docs/stylesheets/extra.css +157 -0
  43. pycodecommenter-2.3.0/docs/validation-checks.md +491 -0
  44. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/examples/basic_usage.py +35 -35
  45. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/examples/ci_integration.py +29 -29
  46. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/examples/coverage_example.py +18 -18
  47. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/examples/validation_example.py +26 -26
  48. pycodecommenter-2.3.0/llms.txt +71 -0
  49. pycodecommenter-2.3.0/mkdocs.yml +90 -0
  50. pycodecommenter-2.3.0/pycodecommenter.egg-info/PKG-INFO +404 -0
  51. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/pycodecommenter.egg-info/SOURCES.txt +27 -1
  52. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/pycodecommenter.egg-info/requires.txt +1 -0
  53. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/pyproject.toml +77 -49
  54. pycodecommenter-2.3.0/scratch/test_mixed_returns.py +31 -0
  55. pycodecommenter-2.3.0/scratch/test_unicode.py +13 -0
  56. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/test_backwards_compatibility.py +38 -38
  57. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/test_basic_validation.py +1 -1
  58. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/test_coverage.py +30 -30
  59. pycodecommenter-2.3.0/test_docstring_parser.py +120 -0
  60. pycodecommenter-2.3.0/test_edge_cases.py +334 -0
  61. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/test_modern.py +37 -37
  62. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/test_type_analyzer.py +1 -0
  63. pycodecommenter-2.3.0/test_validation.py +373 -0
  64. pycodecommenter-2.1.0/CHANGELOG.md +0 -40
  65. pycodecommenter-2.1.0/PKG-INFO +0 -322
  66. pycodecommenter-2.1.0/PyCodeCommenter/cli.py +0 -101
  67. pycodecommenter-2.1.0/PyCodeCommenter/docstring_parser.py +0 -121
  68. pycodecommenter-2.1.0/README.md +0 -289
  69. pycodecommenter-2.1.0/pycodecommenter.egg-info/PKG-INFO +0 -322
  70. pycodecommenter-2.1.0/test_edge_cases.py +0 -58
  71. pycodecommenter-2.1.0/test_validation.py +0 -170
  72. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/PyCodeCommenter/config.py +0 -0
  73. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/conftest.py +0 -0
  74. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/main.py +0 -0
  75. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/pycodecommenter.egg-info/dependency_links.txt +0 -0
  76. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/pycodecommenter.egg-info/entry_points.txt +0 -0
  77. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/pycodecommenter.egg-info/top_level.txt +0 -0
  78. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/scratch/test_infer.py +0 -0
  79. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/setup.cfg +0 -0
  80. {pycodecommenter-2.1.0 → pycodecommenter-2.3.0}/test_integration.py +0 -0
@@ -0,0 +1,66 @@
1
+ # .github/workflows/docs.yml
2
+ # Builds and deploys the MkDocs documentation site to GitHub Pages.
3
+ #
4
+ # Trigger: any push to `main` that touches docs/ or this workflow file.
5
+ # Manual trigger: workflow_dispatch (run from the Actions tab at any time).
6
+ #
7
+ # REQUIRED ONE-TIME SETUP:
8
+ # GitHub repo → Settings → Pages → Source → select "GitHub Actions"
9
+ # Without that change the deploy job runs but the site never goes live.
10
+
11
+ name: Deploy Documentation
12
+
13
+ on:
14
+ push:
15
+ branches:
16
+ - main
17
+ paths:
18
+ - 'docs/**'
19
+ - 'mkdocs.yml'
20
+ - '.github/workflows/docs.yml'
21
+ workflow_dispatch:
22
+
23
+ permissions:
24
+ contents: read
25
+ pages: write
26
+ id-token: write
27
+
28
+ concurrency:
29
+ group: "pages"
30
+ cancel-in-progress: false
31
+
32
+ jobs:
33
+ build:
34
+ name: Build Documentation Site
35
+ runs-on: ubuntu-latest
36
+ steps:
37
+ - name: Checkout repository
38
+ uses: actions/checkout@v4
39
+
40
+ - name: Set up Python
41
+ uses: actions/setup-python@v5
42
+ with:
43
+ python-version: '3.x'
44
+
45
+ - name: Install MkDocs and theme
46
+ run: pip install mkdocs mkdocs-material
47
+
48
+ - name: Build site
49
+ run: mkdocs build --strict --site-dir _site
50
+
51
+ - name: Upload Pages artifact
52
+ uses: actions/upload-pages-artifact@v3
53
+ with:
54
+ path: _site
55
+
56
+ deploy:
57
+ name: Deploy to GitHub Pages
58
+ needs: build
59
+ runs-on: ubuntu-latest
60
+ environment:
61
+ name: github-pages
62
+ url: ${{ steps.deployment.outputs.page_url }}
63
+ steps:
64
+ - name: Deploy to GitHub Pages
65
+ id: deployment
66
+ uses: actions/deploy-pages@v4
@@ -1,33 +1,33 @@
1
- name: Publish to PyPI
2
-
3
- on:
4
- release:
5
- types: [published]
6
-
7
- jobs:
8
- pypi-publish:
9
- name: Upload release to PyPI
10
- runs-on: ubuntu-latest
11
- environment:
12
- name: pypi
13
- url: https://pypi.org/p/pycodecommenter
14
- permissions:
15
- id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
16
- steps:
17
- - uses: actions/checkout@v4
18
-
19
- - name: Set up Python
20
- uses: actions/setup-python@v5
21
- with:
22
- python-version: '3.x'
23
-
24
- - name: Install dependencies
25
- run: |
26
- python -m pip install --upgrade pip
27
- pip install build
28
-
29
- - name: Build package
30
- run: python -m build
31
-
32
- - name: Publish package distributions to PyPI
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ pypi-publish:
9
+ name: Upload release to PyPI
10
+ runs-on: ubuntu-latest
11
+ environment:
12
+ name: pypi
13
+ url: https://pypi.org/p/pycodecommenter
14
+ permissions:
15
+ id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: '3.x'
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install build
28
+
29
+ - name: Build package
30
+ run: python -m build
31
+
32
+ - name: Publish package distributions to PyPI
33
33
  uses: pypa/gh-action-pypi-publish@release/v1
@@ -1,56 +1,56 @@
1
- # Python
2
- __pycache__/
3
- *.py[cod]
4
- *$py.class
5
- *.so
6
- .Python
7
- build/
8
- develop-eggs/
9
- dist/
10
- downloads/
11
- eggs/
12
- .eggs/
13
- lib/
14
- lib64/
15
- parts/
16
- sdist/
17
- var/
18
- wheels/
19
- share/python-wheels/
20
- *.egg-info/
21
- .installed.cfg
22
- *.egg
23
- MANIFEST
24
-
25
- # Environments
26
- .env
27
- .venv
28
- env/
29
- venv/
30
- ENV/
31
- env.bak/
32
- venv.bak/
33
-
34
- # Pytest
35
- .pytest_cache/
36
- .coverage
37
- htmlcov/
38
-
39
- # Local/Temp Files for PyCodeCommenter
40
- env_info.txt
41
- out.txt
42
- output.txt
43
- modern_output.txt
44
- modern_results.txt
45
- test_output.txt
46
- reproduction.py
47
- test_cst.txt
48
- main_output.txt
49
- out_*.txt
50
- verify_*.py
51
- verify_*.txt
52
- error.txt
53
- version_info.txt
54
-
55
- # VS Code
56
- .vscode/
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ share/python-wheels/
20
+ *.egg-info/
21
+ .installed.cfg
22
+ *.egg
23
+ MANIFEST
24
+
25
+ # Environments
26
+ .env
27
+ .venv
28
+ env/
29
+ venv/
30
+ ENV/
31
+ env.bak/
32
+ venv.bak/
33
+
34
+ # Pytest
35
+ .pytest_cache/
36
+ .coverage
37
+ htmlcov/
38
+
39
+ # Local/Temp Files for PyCodeCommenter
40
+ env_info.txt
41
+ out.txt
42
+ output.txt
43
+ modern_output.txt
44
+ modern_results.txt
45
+ test_output.txt
46
+ reproduction.py
47
+ test_cst.txt
48
+ main_output.txt
49
+ out_*.txt
50
+ verify_*.py
51
+ verify_*.txt
52
+ error.txt
53
+ version_info.txt
54
+
55
+ # VS Code
56
+ .vscode/
@@ -0,0 +1,23 @@
1
+ {
2
+ "schema_version": "v1",
3
+ "name_for_human": "PyCodeCommenter",
4
+ "name_for_model": "pycodecommenter",
5
+ "description_for_human": "Python docstring generator and validator. Generates Google-style docstrings from AST, validates them against real function signatures, and measures documentation coverage.",
6
+ "description_for_model": "PyCodeCommenter is a deterministic, AST-based Python tool. It can: (1) generate Google-style docstrings for undocumented Python functions and classes from their AST, (2) validate existing docstrings against real function signatures across six check categories, (3) measure documentation coverage per file or project, and (4) export structured JSON reports. It requires no AI, no network access, and no API keys. Install with 'pip install pycodecommenter'. Main classes: PyCodeCommenter (generation), DocstringValidator (validation), CoverageAnalyzer (coverage).",
7
+ "auth": {
8
+ "type": "none"
9
+ },
10
+ "api": {
11
+ "type": "none"
12
+ },
13
+ "logo_url": "https://amosquety.github.io/PyCodeCommenter/assets/logo.png",
14
+ "contact_email": "amosnabasa4@gmail.com",
15
+ "legal_info_url": "https://github.com/AmosQuety/PyCodeCommenter/blob/main/LICENSE",
16
+ "homepage": "https://amosquety.github.io/PyCodeCommenter/",
17
+ "repository": "https://github.com/AmosQuety/PyCodeCommenter",
18
+ "pypi": "https://pypi.org/project/pycodecommenter/",
19
+ "install_command": "pip install pycodecommenter",
20
+ "version": "2.3.0",
21
+ "license": "MIT",
22
+ "author": "Nabasa Amos (Amos Quety)"
23
+ }
@@ -0,0 +1,167 @@
1
+ # Changelog
2
+
3
+ All notable changes to PyCodeCommenter will be documented in this file.
4
+ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5
+
6
+ ## [2.3.0] - 2026-08-22
7
+
8
+ Follow-up work from an internal engineering audit (`Future Work/Vulnerabilties.md`),
9
+ plus a documentation-fidelity pass (Phase 6) found during pre-release review.
10
+
11
+ ### Breaking Changes
12
+ - **Minimum Python version raised from 3.8 to 3.9.** `pyproject.toml`'s
13
+ `requires-python` is now `>=3.9`; the `Programming Language :: Python :: 3.8`
14
+ classifier was removed. This was forced by the new `libcst` dependency (see
15
+ below), whose current release requires Python >=3.9. **Any user still on
16
+ Python 3.8 will no longer be able to install new releases of this package.**
17
+
18
+ ### Added
19
+ - **New runtime dependency: `libcst>=1.1`.** `get_patched_code()` (the code
20
+ that inserts/updates generated docstrings) was rewritten to apply edits via
21
+ libcst's concrete syntax tree instead of line-number arithmetic on raw
22
+ source text. This is a hard dependency, not optional — installing
23
+ `pycodecommenter` now also installs `libcst`.
24
+ - `generate` and `validate` CLI commands now accept a directory as well as a
25
+ single file, recursively collecting `.py` files (mirroring `coverage`'s
26
+ existing directory support).
27
+ - `--fail-below THRESHOLD` flag on the `coverage` CLI command; exits 1 when
28
+ coverage is below the threshold.
29
+ - `.pycodecommenter.yaml` config is now actually read by the CLI: its
30
+ top-level `exclude` list defaults `-e/--exclude` on all three subcommands,
31
+ and `coverage.threshold` defaults `--fail-below`. Both remain overridable
32
+ by explicit CLI flags. (Previously `config.py` existed but nothing called it.)
33
+ - NumPy-style docstrings (`Parameters`/`Returns`/`Raises` with dash-underlined
34
+ headers) are now parsed as input, alongside Google and Sphinx style.
35
+ Sphinx-style input also gained `:type name: TYPE` support.
36
+
37
+ ### Fixed
38
+ - **One-line function/class definitions could corrupt the file when patched.**
39
+ `def foo(): return 1` (body on the same physical line as the `def`) would
40
+ have its generated docstring inserted *before* the `def` line instead of
41
+ inside the function, producing a `SyntaxError`. Every one-liner shape
42
+ reproduced this: `pass`, `return`, multiple `;`-separated statements,
43
+ `async def`, and one-line `class` bodies. Fixed by the libcst rewrite above,
44
+ which converts a one-liner body to a proper indented block before inserting.
45
+ (This is a different, narrower bug than the "multi-line signature
46
+ corruption" originally suspected from the audit — see Notes below.)
47
+ - `PyCodeCommenter.validate()` now passes the real file path to the validator
48
+ instead of a hardcoded `None`, so validation report locations show the
49
+ actual file (e.g. `src/api.py:12:my_func`) instead of `code:12:my_func`.
50
+ - `PyCodeCommenter.check_coverage()` now uses the real file path instead of
51
+ the leaked `"<string>"` placeholder.
52
+ - `docstring_parser.py`: multi-line `Args:` parameter descriptions in an
53
+ *existing* docstring being re-parsed were silently truncated unless the
54
+ continuation line was indented by exactly 8 spaces. Any other indentation
55
+ (including 4 spaces — the same indent this project's own generator uses)
56
+ lost the continuation text on merge. Now any non-blank continuation line is
57
+ recognized regardless of indentation depth.
58
+ - `generate`/`validate` directory mode's default exclude list
59
+ (`__pycache__`, `.git`, `.venv`, `venv`, `env`, `.eggs`) missed common
60
+ vendor/build directories and used raw substring matching, causing two real
61
+ problems: `environment_config.py` was silently skipped (`"env"` is a
62
+ substring of `"environment"`), and files inside `.tox/.../site-packages/`
63
+ were *not* skipped — with `generate --inplace`, writing generated
64
+ docstrings into vendored third-party source. Expanded the default list
65
+ (added `.tox`, `.nox`, `__pypackages__`, `site-packages`, `build`, `dist`,
66
+ `.egg-info`, `.mypy_cache`, `.pytest_cache`, `node_modules`) and switched
67
+ to exact-path-component matching. `coverage`'s directory mode had the same
68
+ two problems independently (a separate, duplicated exclude list) and is
69
+ fixed the same way, plus a related bug: passing any custom `--exclude`
70
+ pattern previously replaced its default list entirely rather than adding
71
+ to it, silently losing `.venv`/`.git` protection.
72
+ - A parameter's documented type (e.g. `x (int):`) was silently downgraded to
73
+ `x (any):` on regeneration whenever static type inference had nothing to
74
+ work with (no annotation on the parameter) — the type was parsed out of
75
+ the existing docstring but never stored or consulted. A real static
76
+ annotation still always wins; the docstring-parsed type is now used as a
77
+ fallback instead of being discarded.
78
+ - An existing NumPy-style docstring was not recognized as such, so its
79
+ entire body was treated as free-text and a fresh, auto-generated
80
+ Google-style `Args:`/`Returns:` section was appended underneath it —
81
+ documenting the same parameter twice, in two styles, in one docstring.
82
+ - Generated filler text for dunder methods (e.g. `__init__`) rendered with
83
+ broken spacing — `"Original of the init ."` — because
84
+ `name.replace('_', ' ')` turns every underscore into a space, including
85
+ the leading/trailing pair(s) dunder names have.
86
+
87
+ ### Changed
88
+ - `ValidationStats.infos` renamed to `.info` (matches the existing `"info"`
89
+ key in JSON/markdown output). `.infos` remains available as a
90
+ backward-compatible property alias.
91
+
92
+ ### Notes
93
+ - Two "CRITICAL" bugs originally suspected from the audit — corruption on
94
+ multi-line function signatures, and a line-shift bug when patching multiple
95
+ functions in one file — were investigated and do not reproduce against this
96
+ version or the pre-libcst version; both were verified directly against the
97
+ audit's own examples plus additional stress tests. No code changes were
98
+ made for either.
99
+ - A third suspected bug — `ast.walk()` double-counting nested
100
+ functions/classes in `validate_all()`'s stats — also does not reproduce;
101
+ `ast.walk()` visits every node exactly once regardless of nesting depth.
102
+ `validator.py`'s counting logic is unchanged.
103
+ - PEP 604 union rendering (`int | str` currently renders as `Union[int, str]`
104
+ in generated docstrings, per `type_analyzer.py`) was identified as a real,
105
+ minor issue but deliberately deferred: fixing it breaks
106
+ `test_type_analyzer.py::test_union_annotation`, which asserts the old
107
+ `Union[...]` output, and no test-file changes were in scope for that part
108
+ of the work.
109
+
110
+ ## [2.2.0] - 2026-07-12
111
+
112
+ ### Added
113
+ - **Decorator-aware validation** — `@property` setter and deleter variants no longer produce false-positive
114
+ "missing Returns section" warnings. `@classmethod` (`cls`) and `@staticmethod` were verified already correct.
115
+ - **`--output-format json`** flag on both `validate` and `coverage` subcommands. Prints machine-readable
116
+ JSON to stdout; text output is completely unchanged.
117
+ - **`ValidationReport.to_dict()`** updated to spec-compliant shape: `stats.total`, `stats.info`,
118
+ `stats.coverage_percentage`; issues now include `line` (integer), `severity` (uppercase), `check`, `message`.
119
+ - **`_has_raises_section()` helper** in `validator.py` — recognises `Raises:` (Google), `Raises\n`
120
+ (bare header), and `:raises ` (Sphinx, trailing space prevents false matches).
121
+ - **`llms.txt`** file at repo root — AI agent and LLM crawler discovery file.
122
+ - **SEO/AEO optimisation** — keyword-rich README, PyPI classifiers/keywords, per-page meta tags on all
123
+ doc pages, JSON-LD `SoftwareApplication` schema on docs homepage.
124
+
125
+ ### Changed
126
+ - `test_validation.py` rewritten from script-style to proper pytest (17 tests, all pass).
127
+ - `pyproject.toml` keywords expanded to 20 terms; classifiers expanded with `Code Generators`,
128
+ `Libraries :: Python Modules`, `Environment :: Console`, `Operating System :: OS Independent`.
129
+ - `mkdocs.yml` enriched with `site_author`, explicit `language: en`, `navigation.indexes`,
130
+ `search.share`, `toc.follow`, and `meta` markdown extension for per-page SEO tags.
131
+
132
+ ## [2.0.0] - 2026-01-25
133
+
134
+ ### Major Release - Complete Rewrite
135
+
136
+ #### Added
137
+ - **Comprehensive Validation System** - 6 types of documentation checks
138
+ - **Coverage Analysis** - Project-wide documentation metrics
139
+ - **Modern Type Support** - PEP 604 unions, PEP 585 generics
140
+ - **Async Function Support** - Full support for `async def`
141
+ - **Multiple Export Formats** - JSON, Markdown, console output
142
+ - **Smart Docstring Parsing** - Preserves existing documentation
143
+ - **Structured AST Traversal** - NodeVisitor pattern for reliability
144
+ - **Professional Reporting** - Actionable error messages with suggestions
145
+ - **CI/CD Ready** - Easy integration with pipelines
146
+
147
+ #### Changed
148
+ - Replaced basic type inference with comprehensive `TypeAnalyzer`
149
+ - Improved docstring generation with better templates
150
+ - Enhanced error handling with proper logging
151
+ - Better handling of edge cases and malformed code
152
+
153
+ #### Fixed
154
+ - Duplicate `_infer_type` methods consolidated
155
+ - Brittle patching logic made robust
156
+ - Import resolution issues
157
+ - Unicode/encoding handling
158
+
159
+ #### Breaking Changes
160
+ - Minimum Python version: 3.8+
161
+ - Some internal APIs changed (public API remains compatible)
162
+
163
+ ## [1.0.0] - Earlier Version
164
+
165
+ - Basic docstring generation
166
+ - Template-based descriptions
167
+ - File and string input support
@@ -0,0 +1,32 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use PyCodeCommenter in your research or project, please cite it using this metadata."
3
+ type: software
4
+ title: PyCodeCommenter
5
+ abstract: >
6
+ PyCodeCommenter is an open-source Python tool for automatically generating
7
+ Google-style docstrings from Python AST, validating existing docstrings
8
+ against real function signatures, and measuring documentation coverage.
9
+ It is deterministic, rule-based, and requires no AI or network access.
10
+ authors:
11
+ - family-names: Amos
12
+ given-names: Nabasa
13
+ alias: Amos Quety
14
+ email: amosnabasa4@gmail.com
15
+ website: https://nabasa-amos.netlify.app
16
+ orcid: ""
17
+ version: 2.3.0
18
+ date-released: "2026-08-22"
19
+ license: MIT
20
+ repository-code: https://github.com/AmosQuety/PyCodeCommenter
21
+ url: https://amosquety.github.io/PyCodeCommenter/
22
+ keywords:
23
+ - python
24
+ - docstring
25
+ - documentation
26
+ - validation
27
+ - coverage
28
+ - google-style
29
+ - ast
30
+ - developer-tools
31
+ - ci-cd
32
+ - static-analysis
@@ -1,29 +1,29 @@
1
- # Contributing to PyCodeCommenter
2
-
3
- First off, thank you for considering contributing to PyCodeCommenter! It's people like you who make it a great tool for everyone.
4
-
5
- ## How Can I Contribute?
6
-
7
- ### Reporting Bugs
8
- * Check the [Issues](https://github.com/AmosQuety/PyCodeCommenter/issues) to see if it has already been reported.
9
- * If not, open a new issue. Include a clear title, a description of the problem, and steps to reproduce (like a small code snippet).
10
-
11
- ### Proposing Enhancements
12
- * Open an issue to discuss your idea before starting work.
13
- * Explain why this feature would be useful and how it should work.
14
-
15
- ### Pull Requests
16
- 1. Fork the repo and create your branch from `main`.
17
- 2. Follow the existing code style.
18
- 3. Add tests if you're adding new functionality.
19
- 4. Ensure all tests pass.
20
- 5. Update documentation (including `README.md`) if necessary.
21
- 6. Open a Pull Request with a clear description of your changes.
22
-
23
- ## Code Style
24
- * Use [black](https://github.com/psf/black) for formatting.
25
- * Follow Google-style docstrings (since that's what we generate!).
26
- * Maintain Python 3.8+ compatibility.
27
-
28
- ## Need Help?
29
- Feel free to open a discussion or an issue if you have any questions!
1
+ # Contributing to PyCodeCommenter
2
+
3
+ First off, thank you for considering contributing to PyCodeCommenter! It's people like you who make it a great tool for everyone.
4
+
5
+ ## How Can I Contribute?
6
+
7
+ ### Reporting Bugs
8
+ * Check the [Issues](https://github.com/AmosQuety/PyCodeCommenter/issues) to see if it has already been reported.
9
+ * If not, open a new issue. Include a clear title, a description of the problem, and steps to reproduce (like a small code snippet).
10
+
11
+ ### Proposing Enhancements
12
+ * Open an issue to discuss your idea before starting work.
13
+ * Explain why this feature would be useful and how it should work.
14
+
15
+ ### Pull Requests
16
+ 1. Fork the repo and create your branch from `main`.
17
+ 2. Follow the existing code style.
18
+ 3. Add tests if you're adding new functionality.
19
+ 4. Ensure all tests pass.
20
+ 5. Update documentation (including `README.md`) if necessary.
21
+ 6. Open a Pull Request with a clear description of your changes.
22
+
23
+ ## Code Style
24
+ * Use [black](https://github.com/psf/black) for formatting.
25
+ * Follow Google-style docstrings (since that's what we generate!).
26
+ * Maintain Python 3.8+ compatibility.
27
+
28
+ ## Need Help?
29
+ Feel free to open a discussion or an issue if you have any questions!
@@ -1,15 +1,15 @@
1
- v2.1.0 — Safety & Trust · Jun 10 → Jun 30
2
- This is the "stop scaring users" release. All four items are independent so you can ship them in any order.
3
- --dry-run and --backup first — they're the most urgent. Dry-run prints a unified diff to stdout. Backup simply does shutil.copy(path, path + ".bak") before any in-place write. Maybe 2 days each.
4
- Config loader next. Add a config.py module that walks up the directory tree looking for .pycodecommenter.yaml and loads it with ruamel.yaml. Wire the values to the existing hard-coded defaults. A week's work max.
5
- Smarter parameter inference is also v2.1 — see the dedicated audit prompt below.
6
- Test rewrite is ongoing across all phases but the baseline pass (assertions on critical paths) should land here.
7
-
8
- v2.2.0 — Accuracy & Output · Jul 1 → Aug 15
9
- This is the "be correct and be composable" release. Decorator awareness cleans up the false-positive noise. JSON output unlocks every downstream integration — make it a flag on both validate and coverage. The Sphinx :raises: fix is a targeted one-liner in validator.py.
10
-
11
- v3.0.0 — Safe, Configurable, Extensible · Aug 16 → Nov 1
12
- The big one. The merge algorithm is the hardest item in the entire roadmap — budget 3–4 weeks for it alone. The approach: parse the existing docstring into sections, generate fresh sections, then do a section-by-section merge where any section with human content that doesn't match the auto-generated template is preserved. Multi-style support travels alongside — once the generator is style-aware, NumPy and Sphinx become config flags.
13
-
14
- v3.1.0 — Integrations · Nov 2, 2026 → Mar 1, 2027
1
+ v2.1.0 — Safety & Trust · Jun 10 → Jun 30
2
+ This is the "stop scaring users" release. All four items are independent so you can ship them in any order.
3
+ --dry-run and --backup first — they're the most urgent. Dry-run prints a unified diff to stdout. Backup simply does shutil.copy(path, path + ".bak") before any in-place write. Maybe 2 days each.
4
+ Config loader next. Add a config.py module that walks up the directory tree looking for .pycodecommenter.yaml and loads it with ruamel.yaml. Wire the values to the existing hard-coded defaults. A week's work max.
5
+ Smarter parameter inference is also v2.1 — see the dedicated audit prompt below.
6
+ Test rewrite is ongoing across all phases but the baseline pass (assertions on critical paths) should land here.
7
+
8
+ v2.2.0 — Accuracy & Output · Jul 1 → Aug 15
9
+ This is the "be correct and be composable" release. Decorator awareness cleans up the false-positive noise. JSON output unlocks every downstream integration — make it a flag on both validate and coverage. The Sphinx :raises: fix is a targeted one-liner in validator.py.
10
+
11
+ v3.0.0 — Safe, Configurable, Extensible · Aug 16 → Nov 1
12
+ The big one. The merge algorithm is the hardest item in the entire roadmap — budget 3–4 weeks for it alone. The approach: parse the existing docstring into sections, generate fresh sections, then do a section-by-section merge where any section with human content that doesn't match the auto-generated template is preserved. Multi-style support travels alongside — once the generator is style-aware, NumPy and Sphinx become config flags.
13
+
14
+ v3.1.0 — Integrations · Nov 2, 2026 → Mar 1, 2027
15
15
  VS Code extension, GitHub Action for PR automation, SARIF output. These all depend on the v3.0 foundation being solid. Don't start them until merge and JSON output are stable.
@@ -0,0 +1,82 @@
1
+ You have a full engineering audit attached @More future work.md. This is a
2
+ multi-phase task with HARD STOPS between phases. You are not permitted to
3
+ combine phases, skip ahead, or make architecture decisions on my behalf,
4
+ even if the next step seems obvious.
5
+
6
+ GLOBAL RULES (apply to every phase):
7
+ - Work on a new git branch (e.g. `fix/audit-phaseN`). Do not commit to main.
8
+ - Each phase lists the EXACT files you are allowed to modify. Do not touch
9
+ any other file. If you believe another file must change to complete the
10
+ phase, STOP and tell me why instead of doing it.
11
+ - At the end of each phase, paste the FULL, UNTRUNCATED output of:
12
+ git diff --stat
13
+ git diff
14
+ python -m pytest -v
15
+ Do not summarize test results in prose ("37 passed") instead of pasting
16
+ the actual output. I want to see the real terminal output.
17
+ - After posting the above, write exactly: "PHASE N COMPLETE — WAITING FOR
18
+ APPROVAL" and STOP. Do not start the next phase in the same response,
19
+ even partially. Do not pre-write code for the next phase "for
20
+ efficiency."
21
+ - If completing a phase requires a design decision not specified below
22
+ (e.g. which library to use, which of two valid approaches to take),
23
+ STOP and ask me. Do not pick one yourself and proceed. A bracketed note
24
+ like "[we'll decide together]" means you must ask a direct question and
25
+ wait — it is not permission to choose.
26
+
27
+ ---
28
+
29
+ PHASE 1 — Trivial fixes (files: commenter.py, validator.py, type_analyzer.py)
30
+ - Fix PyCodeCommenter.validate() to pass self.file_path instead of None
31
+ - Fix check_coverage() to use the real file path instead of "<string>"
32
+ - Rename `infos` -> `info` consistently (backward-compatible alias is fine)
33
+ - Fix PEP 604 rendering: `X | Y` instead of `Union[X, Y]`
34
+ Do NOT touch get_patched_code() in this phase.
35
+
36
+ ---
37
+
38
+ PHASE 2 — Regression tests ONLY (files: test_edge_cases.py, and any new
39
+ test file you create — NO source files under PyCodeCommenter/ may change)
40
+ - Write a test that reproduces the multi-line signature corruption bug
41
+ (Question 2, first CRITICAL issue in the audit)
42
+ - Write a test that reproduces the line-shift insertion bug
43
+ - Run the tests and paste output PROVING they fail against the current
44
+ (unfixed) source code. A test that passes at the end of this phase is a
45
+ FAILURE of this phase — it means either the test is wrong or you fixed
46
+ the bug early, both of which are not allowed here.
47
+ - Do not modify commenter.py, validator.py, or type_analyzer.py in this
48
+ phase under any circumstance.
49
+
50
+ ---
51
+
52
+ PHASE 3 — Fix the patcher (BLOCKED until I respond to a question)
53
+ Before writing any code in this phase, ask me directly: "Should I use
54
+ libcst, or the ast.unparse() fallback?" and list, in your own words, the
55
+ tradeoffs of each — specifically including: does this approach preserve
56
+ comments in the source file? Does it preserve formatting/quote style?
57
+ What new dependency (if any) does it add?
58
+ Wait for my answer before writing any implementation code.
59
+ Once I've answered:
60
+ - Implement the chosen approach in get_patched_code() only
61
+ - Make the Phase 2 tests pass
62
+ - Add a NEW test that checks whether comments in the source file survive
63
+ patching, and tell me honestly whether they do or don't
64
+ - Confirm no other existing tests regress
65
+
66
+ ---
67
+
68
+ PHASE 4 (files: cli.py, config.py)
69
+ - Add directory support to `validate` and `generate` CLI commands
70
+ - Add --fail-below to coverage CLI
71
+ - Wire load_config() into cli.py
72
+
73
+ ---
74
+
75
+ PHASE 5 (files: validator.py, docstring_parser.py)
76
+ - Fix ast.walk() double-counting nested functions
77
+ - Fix hardcoded 8-space continuation-line parsing
78
+
79
+ ---
80
+
81
+ Begin with Phase 1 only. Stop after Phase 1 and wait for my explicit
82
+ approval before starting Phase 2.