Skip to content

Commit 65364e6

Browse files
feat(docs): configuration management
changes: - file: readme_gen.py area: docs modified: [_extract_project_metadata, ReadmeGenerator] - file: test_llm_helper.py area: util modified: [test_readme_without_llm, TestGeneratorFallback] stats: lines: "+15/-4 (net +11)" files: 2 complexity: "+150% complexity (monitor)"
1 parent 06d20aa commit 65364e6

File tree

7 files changed

+28
-9
lines changed

7 files changed

+28
-9
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.2.6] - 2026-03-07
11+
12+
### Test
13+
- Update tests/test_llm_helper.py
14+
15+
### Other
16+
- Update code2docs/generators/readme_gen.py
17+
1018
## [0.2.5] - 2026-03-07
1119

1220
### Docs

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# code2docs
22

3-
![version](https://img.shields.io/badge/version-0.2.5-blue) ![python](https://img.shields.io/badge/python-%3E%3D3.9-blue) ![docs](https://img.shields.io/badge/docs-auto--generated-blueviolet)
3+
![version](https://img.shields.io/badge/version-0.2.6-blue) ![python](https://img.shields.io/badge/python-%3E%3D3.9-blue) ![docs](https://img.shields.io/badge/docs-auto--generated-blueviolet)
44

55
> Auto-generate and sync project documentation from source code analysis.
66
@@ -140,7 +140,7 @@ code2docs can update only specific sections of an existing README using markers:
140140
```markdown
141141
<!-- code2docs:start --># code2docs
142142

143-
![version](https://img.shields.io/badge/version-0.2.5-blue) ![python](https://img.shields.io/badge/python-%3E%3D3.9-blue) ![coverage](https://img.shields.io/badge/coverage-unknown-lightgrey) ![functions](https://img.shields.io/badge/functions-153-green)
143+
![version](https://img.shields.io/badge/version-0.2.6-blue) ![python](https://img.shields.io/badge/python-%3E%3D3.9-blue) ![coverage](https://img.shields.io/badge/coverage-unknown-lightgrey) ![functions](https://img.shields.io/badge/functions-153-green)
144144
> **153** functions | **30** classes | **28** files | CC̄ = 0.0
145145

146146
## Installation

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.5
1+
0.2.6

code2docs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
README.md, API references, module docs, examples, and architecture diagrams.
66
"""
77

8-
__version__ = "0.2.5"
8+
__version__ = "0.2.6"
99
__author__ = "Tom Sapletta"
1010

1111
from .config import Code2DocsConfig

code2docs/generators/readme_gen.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,21 @@ def _extract_project_metadata(self) -> Dict:
255255
pass
256256

257257
# Find LICENSE file
258-
for license_file in ["LICENSE", "LICENSE.txt", "LICENSE.md", "COPYING"]:
259-
license_path = Path(self.result.project_path) / license_file
258+
license_paths = [
259+
Path(self.result.project_path) / lf
260+
for lf in ["LICENSE", "LICENSE.txt", "LICENSE.md", "COPYING"]
261+
]
262+
# Also check parent directory if project_path is a nested package (e.g., code2docs/code2docs)
263+
parent_path = Path(self.result.project_path).parent
264+
if parent_path != Path(self.result.project_path):
265+
license_paths += [
266+
parent_path / lf
267+
for lf in ["LICENSE", "LICENSE.txt", "LICENSE.md", "COPYING"]
268+
]
269+
270+
for license_path in license_paths:
260271
if license_path.exists():
261-
metadata["license_file"] = license_file
272+
metadata["license_file"] = license_path.name
262273
# Try to extract license name from file content
263274
if not metadata["license"]:
264275
try:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "code2docs"
7-
version = "0.2.5"
7+
version = "0.2.6"
88
description = "Auto-generate and sync project documentation from source code analysis"
99
readme = "README.md"
1010
requires-python = ">=3.9"

tests/test_llm_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def test_readme_without_llm(self):
235235
gen = ReadmeGenerator(config, result)
236236
content = gen.generate()
237237
assert "mylib" in content
238-
assert "How It Works" in content
238+
assert "Installation" in content # New default section instead of "How It Works"
239239

240240
def test_architecture_without_llm(self):
241241
from code2docs.generators.architecture_gen import ArchitectureGenerator

0 commit comments

Comments
 (0)