Skip to content

Commit 33fc194

Browse files
author
codegen-bot
committed
Merge branch 'develop' into tawsif-add-support-for-codebase-exports
2 parents 0683135 + 0dc3580 commit 33fc194

File tree

184 files changed

+1000
-1023
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+1000
-1023
lines changed

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ commands:
7575
steps:
7676
- restore_cache:
7777
keys:
78-
- v1-verified-codemod-repos-{{ checksum "tests/verified_codemods/codemod_data/repo_commits.json" }}-{{.Environment.CIRCLE_NODE_INDEX}}-{{.Environment.CIRCLE_NODE_TOTAL}}
78+
- v1-verified-codemod-repos-{{ checksum "tests/integration/verified_codemods/codemod_data/repo_commits.json" }}-{{.Environment.CIRCLE_NODE_INDEX}}-{{.Environment.CIRCLE_NODE_TOTAL}}
7979
- run:
8080
command: |
8181
uv run --frozen gs codemod clone-repos --verified-codemod-repos --token ${CODEGEN_BOT_GHE_TOKEN}
8282
- save_cache:
8383
paths:
8484
- $GITHUB_WORKSPACE
85-
key: v1-verified-codemod-repos-{{ checksum "tests/verified_codemods/codemod_data/repo_commits.json" }}-{{.Environment.CIRCLE_NODE_INDEX}}-{{.Environment.CIRCLE_NODE_TOTAL}}
85+
key: v1-verified-codemod-repos-{{ checksum "tests/integration/verified_codemods/codemod_data/repo_commits.json" }}-{{.Environment.CIRCLE_NODE_INDEX}}-{{.Environment.CIRCLE_NODE_TOTAL}}
8686
build-wheels:
8787
parameters:
8888
base_packages:
@@ -237,7 +237,7 @@ jobs:
237237
- fetch-verified-codemods
238238
- cache-verified-codemod-repos
239239
- run_ats:
240-
default_tests: "tests/codemod/test_verified_codemods.py"
240+
default_tests: "tests/integration/codemod/test_verified_codemods.py"
241241
codecov_flags: "smart-tests-codemod"
242242
collect_args: --cli-api-key ${PROD_CLI_API_KEY} --token ${CODEGEN_BOT_GHE_TOKEN}
243243
ats_collect_args: --cli-api-key=${PROD_CLI_API_KEY},--token=${CODEGEN_BOT_GHE_TOKEN},
@@ -264,7 +264,7 @@ jobs:
264264
- clone-repos:
265265
extra_repos: false
266266
- run_ats:
267-
default_tests: "tests/codemod/test_codemods.py"
267+
default_tests: "tests/integration/codemod/test_codemods.py"
268268
codecov_flags: "smart-tests-codemod-oss"
269269
collect_args: --size=<<parameters.size>> --sync-graph=<<parameters.sync_graph>> --token ${CODEGEN_BOT_GHE_TOKEN}
270270
ats_collect_args: --size=<<parameters.size>>,--sync-graph=<<parameters.sync_graph>>,--token=${CODEGEN_BOT_GHE_TOKEN},
@@ -297,7 +297,7 @@ jobs:
297297
if [ "<<parameters.extra_repos>>" = "true" ]; then
298298
EXTRA_REPOS_ARG="--extra-repos=true"
299299
fi
300-
PYTEST_ARGS="${EXTRA_REPOS_ARG} --token ${CODEGEN_BOT_GHE_TOKEN} -o junit_suite_name=\"${CIRCLE_JOB}\" tests/codemod/test_parse.py"
300+
PYTEST_ARGS="${EXTRA_REPOS_ARG} --token ${CODEGEN_BOT_GHE_TOKEN} -o junit_suite_name=\"${CIRCLE_JOB}\" tests/integration/codemod/test_parse.py"
301301
echo "Running tests with args: $PYTEST_ARGS"
302302
TESTS_TO_RUN=$(PYTEST_ARGS=${PYTEST_ARGS} ./.circleci/collect.sh)
303303
echo $TESTS_TO_RUN | circleci tests run --command "ulimit -s unlimited; xargs uv run --frozen pytest -n auto ${PYTEST_ARGS}"

.gitattributes

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
**/expected_diff.txt filter=lfs diff=lfs merge=lfs -text
2-
tests/codemod/repos/extra/*.json filter=lfs diff=lfs merge=lfs -text
2+
tests/integration/codemod/repos/extra/*.json filter=lfs diff=lfs merge=lfs -text
33
**/expected_diff.patch filter=lfs diff=lfs merge=lfs -text
4-
tests/codemod/repos/repos.json filter=lfs diff=lfs merge=lfs -text
5-
tests/verified_codemods/** filter=lfs diff=lfs merge=lfs -text
4+
tests/integration/codemod/repos/repos.json filter=lfs diff=lfs merge=lfs -text
5+
tests/integration/verified_codemods/** filter=lfs diff=lfs merge=lfs -text
66
.github/disallowed-words.txt filter=lfs diff=lfs merge=lfs -text

.github/disallowed-words.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:ac0b7be00533f882fb174c498c27372fa78d3ec2d65c0e885475bf92b43b7303
3-
size 337
2+
oid sha256:c47fe11113256de71968b186bd459732c5f29547b9a57275f671502e9ebd8327
3+
size 328

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ uv-*.tar.gz
6363
graph-sitter-types/out/**
6464
graph-sitter-types/typings/**
6565
coverage.json
66-
tests/verified_codemods/codemod_data/repo_commits.json
66+
tests/integration/verified_codemods/codemod_data/repo_commits.json
6767

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
hooks:
2020
- id: biome-check
2121
additional_dependencies: ["@biomejs/[email protected]"]
22-
exclude: (src/codemods/eval)|(tests/unit/skills)|(tests/unit/output)|(tests/verified_codemods)|(docs/samples)
22+
exclude: (src/codemods/eval)|(tests/unit/codegen/sdk/skills)|(tests/unit/codegen/sdk/output)|(tests/integration/verified_codemods)|(docs/samples)
2323

2424
- repo: https://github.com/MarcoGorelli/cython-lint
2525
rev: v0.16.6
@@ -55,13 +55,13 @@ repos:
5555
hooks:
5656
- id: sync-pre-commit-deps
5757

58-
# - repo: https://github.com/codespell-project/codespell
59-
# rev: v2.2.4
60-
# hooks:
61-
# - id: codespell
62-
# additional_dependencies:
63-
# - tomli
64-
# files: "codegen-backend/docs/.*/.*.mdx"
58+
- repo: https://github.com/codespell-project/codespell
59+
rev: v2.4.0
60+
hooks:
61+
- id: codespell
62+
additional_dependencies:
63+
- tomli
64+
files: "docs/.*/.*.mdx"
6565

6666
- repo: https://github.com/fpgmaas/deptry.git
6767
rev: "0.22.0"

CLA.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,40 @@
1111
2. **“Contribution”** means any work of authorship (including any modifications or additions) that is intentionally Submitted by You for inclusion in the Project, in any form (including but not limited to source code, documentation, or other materials).
1212
3. **“Submit”** or **“Submitted”** means any act of transferring a Contribution to Codegen, Inc. via pull request, email, or any other method of communication for the purpose of inclusion in the Project.
1313
2. **Grant of Copyright License**
14-
14+
1515
Subject to the terms and conditions of this CLA, You hereby grant to Codegen, Inc. and to recipients of software distributed by Codegen, Inc.:
16-
16+
1717
- A perpetual, worldwide, non-exclusive, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
1818
3. **Grant of Patent License**
19-
19+
2020
Subject to the terms and conditions of this CLA, You hereby grant to Codegen, Inc. and to recipients of software distributed by Codegen, Inc. a perpetual, worldwide, non-exclusive, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer Your Contribution, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution alone or by combination of Your Contribution with the Project to which You Submitted it.
21-
21+
2222
If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that Your Contribution, or the Project to which You have contributed, directly or indirectly infringes any patent, then any patent licenses granted to that entity under this CLA for that Contribution or Project shall terminate as of the date such litigation is filed.
23-
23+
2424
4. **Representations and Warranties**
2525
1. **Original Work**. You represent that each of Your Contributions is an original work of authorship and that You have the necessary rights to grant the licenses under this CLA.
2626
2. **Third-Party Rights**. If Your employer(s) or any third party has rights to intellectual property that You create, You represent that You have received permission to make Contributions on behalf of that employer or third party (or that such employer or third party has waived those rights for Your Contributions).
2727
3. **No Other Agreements**. You represent that You are not aware of any other agreement or obligation that is inconsistent with the rights granted under this CLA.
2828
5. **Disclaimer of Warranty**
29-
29+
3030
UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, YOU PROVIDE YOUR CONTRIBUTIONS ON AN **“AS IS”** BASIS, **WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND**, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
31-
31+
3232
6. **Limitation of Liability**
33-
33+
3434
IN NO EVENT SHALL CODEGEN, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE), ARISING IN ANY WAY OUT OF OR IN CONNECTION WITH THIS AGREEMENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35-
35+
3636
7. **Subsequent Contributions and Updates**
37-
37+
3838
You agree that all current and future Contributions to the Project Submitted by You shall be subject to the terms of this CLA. Codegen, Inc. may publish updates to this CLA from time to time; in such case, You may need to agree to new terms before any subsequent Contributions.
39-
39+
4040
8. **License Modification Rights**
41-
41+
4242
You agree that Codegen, Inc. may change the license(s) applicable to the open source project(s) to which Your Contributions relate at Codegen, Inc.’s sole discretion, including without limitation by re-licensing the project(s) and Your Contributions under any other open source or “free” software license, or a commercial or proprietary license of Codegen, Inc.’s choosing.
43-
43+
4444
9. **Governing Law**
45-
45+
4646
This CLA shall be governed by and construed in accordance with the laws of the State of Delaware, without regard to its conflicts of laws provisions.
47-
47+
4848
10. **Signature / Electronic Consent**
49-
49+
5050
By signing or otherwise indicating Your acceptance of this CLA, You acknowledge that You have read and agree to be bound by its terms. If You are signing on behalf of an entity, You represent and warrant that You have the authority to do so.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ uv sync --dev
4545
uv run pytest tests/unit -n auto
4646

4747
# Codemod tests (tests larger programs)
48-
uv run pytest tests/codemod/test_codemods.py -n auto
48+
uv run pytest tests/integration/codemod/test_codemods.py -n auto
4949
```
5050

5151
## Pull Request Process

docs/api-reference/index.mdx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ Welcome to the Codegen API reference. This documentation covers the core classes
2222
and call sites.
2323
</Card>
2424
<Card
25-
title="CallGraph"
25+
title="Symbol"
2626
icon="diagram-project"
27-
href="/api-reference/core/CallGraph"
27+
href="/api-reference/core/Symbol"
2828
>
29-
Navigate function calls and dependencies throughout your codebase.
29+
Represents a symbol in your codebase, includes functions, classes, and more.
3030
</Card>
3131
</CardGroup>
3232

@@ -45,24 +45,23 @@ Welcome to the Codegen API reference. This documentation covers the core classes
4545

4646
### Code Analysis
4747

48-
- [Finding Functions](/api-reference/core/Codebase#find_function)
49-
- [Analyzing Dependencies](/api-reference/core/CallGraph#get_dependencies)
50-
- [Working with ASTs](/api-reference/core/File#get_ast)
51-
- [Type Information](/api-reference/core/Function#get_type)
48+
- [Finding Functions](/api-reference/core/Codebase#get-function)
49+
- [Analyzing Dependencies](/api-reference/core/Symbol#dependencies)
50+
- [Analyzing Usages](/api-reference/core/Symbol#usages)
5251

5352
### Code Transformation
5453

5554
- [Editing Files](/api-reference/core/File#edit)
56-
- [Managing Imports](/api-reference/core/File#add_import)
57-
- [Renaming Symbols](/api-reference/core/Codebase#rename)
58-
- [Moving Code](/api-reference/core/File#move)
55+
- [Managing Imports](/api-reference/core/SourceFile#add-import-from-import-string)
56+
- [Renaming Symbols](/api-reference/core/Symbol#set-name)
57+
- [Managing Return Types](/api-reference/core/Function#set-return-type)
58+
- [Moving Code](/api-reference/core/Symbol#move-to-file)
5959

6060
### React & TypeScript
6161

62-
- [Component Analysis](/api-reference/typescript/ReactComponent)
63-
- [Type Definitions](/api-reference/typescript/TypeDefinition)
64-
- [JSX Manipulation](/api-reference/typescript/JSXElement)
65-
- [Props & State](/api-reference/typescript/Props)
62+
- [JSX Components](/api-reference/typescript/JSXElement)
63+
- [Props & State](/api-reference/typescript/JSXProp)
64+
- [Type Aliases](/api-reference/typescript/TSTypeAlias)
6665

6766
<Note>
6867
Each class and function includes detailed examples and common use cases. Use

docs/building-with-codegen/at-a-glance.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Learn how to use Codegen's core APIs to analyze and transform code.
3535
<Card
3636
title="Symbols, Functions and Classes"
3737
icon="pen-to-square"
38-
href="/building-with-codegen/symbols-functions-and-classes"
38+
href="/building-with-codegen/the-editable-api"
3939
>
4040
Master the core abstractions for manipulating code safely and effectively.
4141
</Card>

docs/building-with-codegen/class-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ icon: "cube"
55
iconType: "solid"
66
---
77

8-
The [Class](/api-reference/core/class.py) API extends the [Symbol](/building-with-codegen/symbol-api) API to support methods, attributes, and inheritance hierarchies.
8+
The [Class](/api-reference/core/Class) API extends the [Symbol](/building-with-codegen/symbol-api) API to support methods, attributes, and inheritance hierarchies.
99

1010
## Methods and Method Usages
1111

0 commit comments

Comments
 (0)