code2docs 0.1.7__tar.gz → 0.2.2__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.
- {code2docs-0.1.7 → code2docs-0.2.2}/PKG-INFO +3 -3
- {code2docs-0.1.7 → code2docs-0.2.2}/README.md +2 -2
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/__init__.py +1 -1
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/generators/api_reference_gen.py +2 -2
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/generators/architecture_gen.py +2 -2
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/generators/module_docs_gen.py +2 -2
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/generators/readme_gen.py +2 -1
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/templates/module_doc.md.j2 +1 -1
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs.egg-info/PKG-INFO +3 -3
- {code2docs-0.1.7 → code2docs-0.2.2}/pyproject.toml +1 -1
- {code2docs-0.1.7 → code2docs-0.2.2}/LICENSE +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/__main__.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/analyzers/__init__.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/analyzers/dependency_scanner.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/analyzers/docstring_extractor.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/analyzers/endpoint_detector.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/analyzers/project_scanner.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/cli.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/config.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/formatters/__init__.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/formatters/badges.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/formatters/markdown.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/formatters/toc.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/generators/__init__.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/generators/api_changelog_gen.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/generators/changelog_gen.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/generators/coverage_gen.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/generators/depgraph_gen.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/generators/examples_gen.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/generators/mkdocs_gen.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/sync/__init__.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/sync/differ.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/sync/updater.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/sync/watcher.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/templates/api_module.md.j2 +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/templates/architecture.md.j2 +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/templates/example_usage.py.j2 +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/templates/index.md.j2 +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs/templates/readme.md.j2 +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs.egg-info/SOURCES.txt +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs.egg-info/dependency_links.txt +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs.egg-info/entry_points.txt +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs.egg-info/requires.txt +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/code2docs.egg-info/top_level.txt +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/setup.cfg +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/tests/test_analyzers.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/tests/test_cli.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/tests/test_code2docs.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/tests/test_config.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/tests/test_formatters.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/tests/test_generators.py +0 -0
- {code2docs-0.1.7 → code2docs-0.2.2}/tests/test_sync.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code2docs
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Auto-generate and sync project documentation from source code analysis
|
|
5
5
|
Author-email: Tom Sapletta <tom@sapletta.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -40,7 +40,7 @@ Dynamic: license-file
|
|
|
40
40
|
|
|
41
41
|
# code2docs
|
|
42
42
|
|
|
43
|
-
  
|
|
44
44
|
|
|
45
45
|
> Auto-generate and sync project documentation from source code analysis.
|
|
46
46
|
|
|
@@ -180,7 +180,7 @@ code2docs can update only specific sections of an existing README using markers:
|
|
|
180
180
|
```markdown
|
|
181
181
|
<!-- code2docs:start --># code2docs
|
|
182
182
|
|
|
183
|
-
   
|
|
184
184
|
> **153** functions | **30** classes | **28** files | CC̄ = 0.0
|
|
185
185
|
|
|
186
186
|
## Installation
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# code2docs
|
|
2
2
|
|
|
3
|
-
  
|
|
4
4
|
|
|
5
5
|
> Auto-generate and sync project documentation from source code analysis.
|
|
6
6
|
|
|
@@ -140,7 +140,7 @@ code2docs can update only specific sections of an existing README using markers:
|
|
|
140
140
|
```markdown
|
|
141
141
|
<!-- code2docs:start --># code2docs
|
|
142
142
|
|
|
143
|
-
   
|
|
144
144
|
> **153** functions | **30** classes | **28** files | CC̄ = 0.0
|
|
145
145
|
|
|
146
146
|
## Installation
|
|
@@ -5,7 +5,7 @@ Uses code2llm's AnalysisResult to produce human-readable documentation:
|
|
|
5
5
|
README.md, API references, module docs, examples, and architecture diagrams.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = "0.
|
|
8
|
+
__version__ = "0.2.2"
|
|
9
9
|
__author__ = "Tom Sapletta"
|
|
10
10
|
|
|
11
11
|
from .config import Code2DocsConfig
|
|
@@ -97,7 +97,7 @@ class ApiReferenceGenerator:
|
|
|
97
97
|
doc_line = ""
|
|
98
98
|
if method.docstring:
|
|
99
99
|
doc_line = f" — {method.docstring.splitlines()[0]}"
|
|
100
|
-
cc = method.complexity.get("cyclomatic", 0)
|
|
100
|
+
cc = method.complexity.get("cyclomatic_complexity", method.complexity.get("cyclomatic", 0))
|
|
101
101
|
cc_badge = f" ⚠️ CC={cc}" if cc > 10 else ""
|
|
102
102
|
lines.append(f"- `{sig}`{doc_line}{cc_badge}")
|
|
103
103
|
lines.append("")
|
|
@@ -118,7 +118,7 @@ class ApiReferenceGenerator:
|
|
|
118
118
|
lines.append(f"### `{sig}`\n")
|
|
119
119
|
if func_info.docstring:
|
|
120
120
|
lines.append(f"{func_info.docstring.strip()}\n")
|
|
121
|
-
cc = func_info.complexity.get("cyclomatic", 0)
|
|
121
|
+
cc = func_info.complexity.get("cyclomatic_complexity", func_info.complexity.get("cyclomatic", 0))
|
|
122
122
|
if cc:
|
|
123
123
|
lines.append(f"- Complexity: {cc}")
|
|
124
124
|
if func_info.calls:
|
|
@@ -177,9 +177,9 @@ class ArchitectureGenerator:
|
|
|
177
177
|
|
|
178
178
|
# Average complexity
|
|
179
179
|
complexities = [
|
|
180
|
-
f.complexity.get("cyclomatic", 0)
|
|
180
|
+
f.complexity.get("cyclomatic_complexity", f.complexity.get("cyclomatic", 0))
|
|
181
181
|
for f in self.result.functions.values()
|
|
182
|
-
if f.complexity.get("cyclomatic", 0) > 0
|
|
182
|
+
if f.complexity.get("cyclomatic_complexity", f.complexity.get("cyclomatic", 0)) > 0
|
|
183
183
|
]
|
|
184
184
|
if complexities:
|
|
185
185
|
avg = round(sum(complexities) / len(complexities), 1)
|
|
@@ -80,7 +80,7 @@ class ModuleDocsGenerator:
|
|
|
80
80
|
if len(m.args) > 4:
|
|
81
81
|
args += ", ..."
|
|
82
82
|
ret = m.returns or "—"
|
|
83
|
-
cc = m.complexity.get("cyclomatic", "—")
|
|
83
|
+
cc = m.complexity.get("cyclomatic_complexity", m.complexity.get("cyclomatic", "—"))
|
|
84
84
|
warn = " ⚠️" if isinstance(cc, (int, float)) and cc > 10 else ""
|
|
85
85
|
lines.append(f"| `{m.name}` | `{args}` | `{ret}` | {cc}{warn} |")
|
|
86
86
|
lines.append("")
|
|
@@ -149,7 +149,7 @@ class ModuleDocsGenerator:
|
|
|
149
149
|
complexities = []
|
|
150
150
|
for func in self.result.functions.values():
|
|
151
151
|
if func.module == mod_name:
|
|
152
|
-
cc = func.complexity.get("cyclomatic", 0)
|
|
152
|
+
cc = func.complexity.get("cyclomatic_complexity", func.complexity.get("cyclomatic", 0))
|
|
153
153
|
if cc > 0:
|
|
154
154
|
complexities.append(cc)
|
|
155
155
|
return round(sum(complexities) / len(complexities), 1) if complexities else 0.0
|
|
@@ -95,7 +95,8 @@ class ReadmeGenerator:
|
|
|
95
95
|
"""Calculate average cyclomatic complexity."""
|
|
96
96
|
complexities = []
|
|
97
97
|
for func in self.result.functions.values():
|
|
98
|
-
cc = func.complexity.get("
|
|
98
|
+
cc = func.complexity.get("cyclomatic_complexity",
|
|
99
|
+
func.complexity.get("cyclomatic", 0))
|
|
99
100
|
if cc > 0:
|
|
100
101
|
complexities.append(cc)
|
|
101
102
|
return round(sum(complexities) / len(complexities), 1) if complexities else 0.0
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
{% for m in methods[cls_name] %}
|
|
31
31
|
{% set args = m.args[:4]|join(', ') %}
|
|
32
32
|
{% set ret = m.returns or '—' %}
|
|
33
|
-
{% set cc = m.complexity.get('cyclomatic', '—') %}
|
|
33
|
+
{% set cc = m.complexity.get('cyclomatic_complexity', m.complexity.get('cyclomatic', '—')) %}
|
|
34
34
|
| `{{ m.name }}` | `{{ args }}` | `{{ ret }}` | {{ cc }} |
|
|
35
35
|
{% endfor %}
|
|
36
36
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code2docs
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Auto-generate and sync project documentation from source code analysis
|
|
5
5
|
Author-email: Tom Sapletta <tom@sapletta.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -40,7 +40,7 @@ Dynamic: license-file
|
|
|
40
40
|
|
|
41
41
|
# code2docs
|
|
42
42
|
|
|
43
|
-
  
|
|
44
44
|
|
|
45
45
|
> Auto-generate and sync project documentation from source code analysis.
|
|
46
46
|
|
|
@@ -180,7 +180,7 @@ code2docs can update only specific sections of an existing README using markers:
|
|
|
180
180
|
```markdown
|
|
181
181
|
<!-- code2docs:start --># code2docs
|
|
182
182
|
|
|
183
|
-
   
|
|
184
184
|
> **153** functions | **30** classes | **28** files | CC̄ = 0.0
|
|
185
185
|
|
|
186
186
|
## Installation
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|