From 2965f342cb713c1c7a265529bfd2f64007f74f15 Mon Sep 17 00:00:00 2001 From: jayhack Date: Thu, 23 Jan 2025 14:30:04 -0800 Subject: [PATCH 1/4] . --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index f448a7d61..850756cc8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Graph sitter [![Documentation](https://img.shields.io/badge/docs-docs.codegen.com-blue)](https://docs.codegen.com) -[![Unit Tests](https://github.com/codegen-sh/codegen-sdk/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/codegen-sh/codegen-sdk/actions/workflows/unit-tests.yml) [Codegen](https://docs.codegen.com) is a python library for manipulating codebases. @@ -42,7 +41,7 @@ We built Codegen backwards from real-world refactors performed on enterprise cod - **Natural mental model**: Write transforms that read like your thought process - "move this function", "rename this variable", "add this parameter". No more wrestling with ASTs or manual import management. -- **Battle-tested on complex codebases**: Handle Python, TypeScript, and React codebases with millions of lines of code. Built and validated on refactors at companies like [Ramp](https://ramp.com). +- **Battle-tested on complex codebases**: Handle Python, TypeScript, and React codebases with millions of lines of code. - **Built for advanced intelligences**: As AI developers become more sophisticated, they need expressive yet precise tools to manipulate code. Codegen provides a programmatic interface that both humans and AI can use to express complex transformations through code itself. From 91418710b2c48fee9a193e9c78b95fb17a95cfa4 Mon Sep 17 00:00:00 2001 From: jayhack Date: Thu, 23 Jan 2025 18:56:41 -0800 Subject: [PATCH 2/4] . --- src/codegen/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/codegen/__init__.py diff --git a/src/codegen/__init__.py b/src/codegen/__init__.py new file mode 100644 index 000000000..c61714134 --- /dev/null +++ b/src/codegen/__init__.py @@ -0,0 +1,5 @@ +from codegen.cli.sdk.decorator import function +from codegen.cli.sdk.functions import Function +from codegen.sdk.core.codebase import Codebase + +__all__ = ["Codebase", "Function", "function"] From 3798ee3bd5ac175785fb2af9ab2c0761f59fccc3 Mon Sep 17 00:00:00 2001 From: jayhack Date: Thu, 23 Jan 2025 19:06:43 -0800 Subject: [PATCH 3/4] added unit test --- tests/unit/test_imports.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/unit/test_imports.py diff --git a/tests/unit/test_imports.py b/tests/unit/test_imports.py new file mode 100644 index 000000000..e2af00f64 --- /dev/null +++ b/tests/unit/test_imports.py @@ -0,0 +1,16 @@ +import codegen +from codegen import Codebase + + +def test_codegen_imports(): + # Test decorated function + @codegen.function(name="sample_codemod") + def run(codebase): + pass + + # Test class + cls = codegen.Function + assert cls is not None + + codebase = Codebase("./") + assert codebase is not None From a784452a0427a79092acb5dc407c04308fd2eb65 Mon Sep 17 00:00:00 2001 From: jayhack Date: Thu, 23 Jan 2025 19:25:01 -0800 Subject: [PATCH 4/4] . --- docs/prism.css | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/prism.css b/docs/prism.css index 8a5ac4fdb..7d78bb4e2 100644 --- a/docs/prism.css +++ b/docs/prism.css @@ -1,5 +1,24 @@ +/* Override font variables */ +:root { + --font-jetbrains-mono: Menlo, Monaco, "Courier New", monospace !important; + /* --font-jetbrains-mono: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace !important; */ +} + +pre[class*="language-"], +code[class*="language-"], +pre, +code, +kbd, +samp { + font-family: Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace !important; + --font-jetbrains-mono: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", + monospace !important; + font-weight: 500 !important; +} + pre[class*="language-"] { - font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; + font-family: Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace !important; + font-weight: 500 !important; text-align: left; white-space: pre; word-spacing: normal; @@ -52,7 +71,7 @@ pre[class*="language-"] { .language-python .language-bash { background-color: #15141b !important; - font-family: Menlo, Monaco, Consolas, "Courier New", monospace !important; + font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace !important; font-weight: 600 !important; font-size: 16px !important; }