Skip to content

Bump ktast to 0.10.0 and support implicit import#70

Merged
orangain merged 6 commits intomainfrom
implicit-import
Apr 1, 2025
Merged

Bump ktast to 0.10.0 and support implicit import#70
orangain merged 6 commits intomainfrom
implicit-import

Conversation

@orangain
Copy link
Copy Markdown
Owner

@orangain orangain commented Mar 31, 2025

Builder API has moved from ktcodeshift to ktast. For the compatibility of transform scripts, we provide implicit import of ktast.builder.* packages. In addition, to avoid having to write the import statements, we added implicit import support for the ktast.ast.* and ktcodeshift.* packages.

In summary, the following imports are implicitly available in the transform file now:

import ktast.ast.*
import ktast.builder.*
import ktcodeshift.*

@orangain orangain requested a review from Copilot March 31, 2025 13:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the documentation to reflect the upgrade of ktast to version 0.10.0 and introduces implicit imports for both ktast and ktcodeshift packages in transform scripts.

  • Removed explicit import statements for ktast and ktcodeshift in the examples.
  • Added a new "Implicit imports" section to document the available implicit imports.
Files not reviewed (13)
  • ktcodeshift-cli/build.gradle.kts: Language not supported
  • ktcodeshift-cli/src/test/resources/examples/Annotations.transform.kts: Language not supported
  • ktcodeshift-cli/src/test/resources/examples/FlattenList.transform.kts: Language not supported
  • ktcodeshift-cli/src/test/resources/examples/GenerateBuilders.transform.kts: Language not supported
  • ktcodeshift-cli/src/test/resources/examples/Identity.transform.kts: Language not supported
  • ktcodeshift-cli/src/test/resources/examples/JUnit4To5.transform.kts: Language not supported
  • ktcodeshift-cli/src/test/resources/examples/RenameVariable.transform.kts: Language not supported
  • ktcodeshift-cli/src/test/resources/examples/SortWhenBranches.transform.kts: Language not supported
  • ktcodeshift-dsl/build.gradle.kts: Language not supported
  • ktcodeshift-dsl/src/main/kotlin/ktcodeshift/NodeCollection.kt: Language not supported
  • ktcodeshift-dsl/src/main/kotlin/ktcodeshift/NodeExtension.kt: Language not supported
  • ktcodeshift-dsl/src/main/kotlin/ktcodeshift/script/ScriptDefinition.kt: Language not supported
  • ktcodeshift-dsl/src/test/kotlin/ktcodeshift/ApiTest.kt: Language not supported

@orangain orangain merged commit 76bf167 into main Apr 1, 2025
1 check passed
@orangain orangain deleted the implicit-import branch April 1, 2025 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants