File tree Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 11import codegen
22from codegen import Codebase
3+ from codegen .sdk .enums import ProgrammingLanguage
34from codegen .sdk .core .statements .for_loop_statement import ForLoopStatement
45from codegen .sdk .core .statements .if_block_statement import IfBlockStatement
56from codegen .sdk .core .statements .try_catch_statement import TryCatchStatement
@@ -81,7 +82,7 @@ def calculate_cyclomatic_complexity(code_block):
8182
8283if __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 )
Original file line number Diff line number Diff 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!
You can’t perform that action at this time.
0 commit comments