Skip to content

Commit ce05545

Browse files
authored
Cleanup Maintainance (#51)
cleanup
1 parent 0eeb4c4 commit ce05545

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

examples/cyclomatic_complexity/run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import codegen
22
from codegen import Codebase
3+
from codegen.sdk.enums import ProgrammingLanguage
34
from codegen.sdk.core.statements.for_loop_statement import ForLoopStatement
45
from codegen.sdk.core.statements.if_block_statement import IfBlockStatement
56
from codegen.sdk.core.statements.try_catch_statement import TryCatchStatement
@@ -81,7 +82,7 @@ def calculate_cyclomatic_complexity(code_block):
8182

8283
if __name__ == "__main__":
8384
print("🔍 Analyzing codebase...")
84-
codebase = Codebase.from_repo("fastapi/fastapi", commit="887270ff8a54bb58c406b0651678a27589793d2f")
85+
codebase = Codebase.from_repo("fastapi/fastapi", commit="887270ff8a54bb58c406b0651678a27589793d2f", programming_language=ProgrammingLanguage.PYTHON)
8586

8687
print("Running analysis...")
8788
run(codebase)

examples/document_functions/README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,17 @@ def hop_through_imports(imp: Import) -> Symbol | ExternalModule:
4343
return imp.imported_symbol
4444
```
4545

46-
## Usage
46+
## Running the Conversion
4747

48-
1. Run the script on a target repository:
49-
```python
50-
codebase = Codebase.from_repo("your/repo", commit="commit_hash")
51-
run(codebase)
48+
```bash
49+
# Install Codegen
50+
pip install codegen
51+
52+
# Run the conversion
53+
python run.py
5254
```
5355

54-
2. The script will:
56+
The script will:
5557
- Process each function in the codebase
5658
- Skip functions that already have docstrings
5759
- Generate contextually aware docstrings for undocumented functions
@@ -81,4 +83,13 @@ The script provides detailed progress information:
8183
- Documenting legacy codebases
8284
- Maintaining documentation standards in large projects
8385
- Onboarding new team members with better code documentation
84-
- Preparing codebases for public release
86+
- Preparing codebases for public release
87+
88+
## Learn More
89+
90+
- [Creating Documentation](https://docs.codegen.com/tutorials/creating-documentation#creating-documentation)
91+
- [Codegen Documentation](https://docs.codegen.com)
92+
93+
## Contributing
94+
95+
Feel free to submit issues and enhancement requests!

0 commit comments

Comments
 (0)