Skip to content

Enable ktfmt - #3038

Draft
jaschdoc wants to merge 4 commits into
mainfrom
format-with-ktfmt
Draft

Enable ktfmt#3038
jaschdoc wants to merge 4 commits into
mainfrom
format-with-ktfmt

Conversation

@jaschdoc

@jaschdoc jaschdoc commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Enables ktfmt across the entire repo.

  • Check that build files have not changed except for formatting
  • Check test files
  • Check the following source file changes:

Here is a list of changed class files after enabling ktfmt. The corresponding source files should be double-checked. The list is obtained by first compiling KSP without applying ktfmt, then applying ktfmt and recompiling. Then all class files were checked for byte-for-byte equality modulo debug information, i.e., the pseudo predicate compileModuloDebugInfo(ksp) == compileModuloDebugInfo(ktfmt(ksp)) was checked. Thus, these class files were the only ones to differ. Most of the changes seem to be local variable and stack changes, but the source files should be checked just to be sure.

================================================================================
SUMMARY OF ALL CHANGED CLASSES:
================================================================================
 1. com.google.devtools.ksp.cmdline.KSPJvmMainKt [SEMANTIC DIFF]
 2. com.google.devtools.ksp.common.IncrementalContextBase [SEMANTIC DIFF]
 3. com.google.devtools.ksp.common.impl.PsiResolutionStrategy [SEMANTIC DIFF]
 4. com.google.devtools.ksp.impl.KotlinSymbolProcessingKt [NOISE ONLY]
 5. com.google.devtools.ksp.impl.KotlinSymbolProcessing [SEMANTIC DIFF]
 6. com.google.devtools.ksp.impl.ResolverAAImpl [SEMANTIC DIFF]
 7. com.google.devtools.ksp.impl.symbol.java.KSAnnotationJavaImplKt [SEMANTIC DIFF]
 8. com.google.devtools.ksp.impl.symbol.java.KSAnnotationJavaImpl [SEMANTIC DIFF]
 9. com.google.devtools.ksp.impl.symbol.kotlin.AbstractKSDeclarationImpl [SEMANTIC DIFF]
10. com.google.devtools.ksp.impl.symbol.kotlin.KSAnnotationImpl [SEMANTIC DIFF]
11. com.google.devtools.ksp.impl.symbol.kotlin.KSClassDeclarationEnumEntryImpl [SEMANTIC DIFF]
12. com.google.devtools.ksp.impl.symbol.kotlin.KSClassDeclarationImpl$asStarProjectedType$1$1 [NOISE ONLY]
13. com.google.devtools.ksp.impl.symbol.kotlin.KSClassDeclarationImpl$special$$inlined$lazyMemoizedSequence$1 [NOISE ONLY]
14. com.google.devtools.ksp.impl.symbol.kotlin.KSClassDeclarationImpl [SEMANTIC DIFF]
15. com.google.devtools.ksp.impl.symbol.kotlin.KSFunctionDeclarationImpl$special$$inlined$lazyMemoizedSequence$1 [SEMANTIC DIFF]
16. com.google.devtools.ksp.impl.symbol.kotlin.KSFunctionDeclarationImpl [SEMANTIC DIFF]
17. com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyAccessorImpl$special$$inlined$lazyMemoizedSequence$3 [SEMANTIC DIFF]
18. com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyDeclarationImpl$special$$inlined$lazyMemoizedSequence$1 [NOISE ONLY]
19. com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyDeclarationImplKt [NOISE ONLY]
20. com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyDeclarationImpl [SEMANTIC DIFF]
21. com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyDeclarationLocalVariableImpl [SEMANTIC DIFF]
22. com.google.devtools.ksp.impl.symbol.kotlin.KSTypeParameterImpl [SEMANTIC DIFF]
23. com.google.devtools.ksp.impl.symbol.kotlin.KSValueParameterImpl [NOISE ONLY]
24. com.google.devtools.ksp.impl.symbol.kotlin.UtilKt [SEMANTIC DIFF]
25. com.google.devtools.ksp.impl.symbol.kotlin.resolved.KSAnnotationResolvedImpl [SEMANTIC DIFF]
26. com.google.devtools.ksp.impl.symbol.util.BinaryUtilsKt [NOISE ONLY]
27. com.google.devtools.ksp.impl.symbol.util.DeclarationOrdering [NOISE ONLY]
28. com.google.devtools.ksp.impl.symbol.util.PsiUtilsKt [SEMANTIC DIFF]
29. com.google.devtools.ksp.standalone.IncrementalJavaFileManagerKt [NOISE ONLY]

================================================================================
Total changed class files: 29
Total pairs with non-trivial semantic diffs: 20
================================================================================

UPDATE

================================================================================
 1. com.google.devtools.ksp.cmdline.KSPJvmMainKt
 2. com.google.devtools.ksp.common.IncrementalContextBase
 3. com.google.devtools.ksp.common.impl.PsiResolutionStrategy
 4. com.google.devtools.ksp.gradle.AndroidPluginIntegration
 5. com.google.devtools.ksp.gradle.KspAATask$Companion
 6. com.google.devtools.ksp.gradle.KspAATask$Companion$registerKspAATask$kspTaskProvider$1
 7. com.google.devtools.ksp.gradle.KspAATask$Companion$registerKspAATask$kspTaskProvider$1$3$mapArgProviders$1
 8. com.google.devtools.ksp.gradle.KspConfigurations
 9. com.google.devtools.ksp.gradle.KspExtension
10. com.google.devtools.ksp.gradle.KspGradleSubplugin
11. com.google.devtools.ksp.impl.KotlinSymbolProcessing
12. com.google.devtools.ksp.impl.KotlinSymbolProcessingKt
13. com.google.devtools.ksp.impl.ResolverAAImpl
14. com.google.devtools.ksp.impl.symbol.java.KSAnnotationJavaImpl
15. com.google.devtools.ksp.impl.symbol.java.KSAnnotationJavaImplKt
16. com.google.devtools.ksp.impl.symbol.kotlin.AbstractKSDeclarationImpl
17. com.google.devtools.ksp.impl.symbol.kotlin.KSAnnotationImpl
18. com.google.devtools.ksp.impl.symbol.kotlin.KSClassDeclarationEnumEntryImpl
19. com.google.devtools.ksp.impl.symbol.kotlin.KSClassDeclarationImpl
20. com.google.devtools.ksp.impl.symbol.kotlin.KSClassDeclarationImpl$asStarProjectedType$1$1
21. com.google.devtools.ksp.impl.symbol.kotlin.KSClassDeclarationImpl$special$$inlined$lazyMemoizedSequence$1
22. com.google.devtools.ksp.impl.symbol.kotlin.KSFunctionDeclarationImpl
23. com.google.devtools.ksp.impl.symbol.kotlin.KSFunctionDeclarationImpl$special$$inlined$lazyMemoizedSequence$1
24. com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyAccessorImpl$special$$inlined$lazyMemoizedSequence$3
25. com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyDeclarationImpl
26. com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyDeclarationImpl$special$$inlined$lazyMemoizedSequence$1
27. com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyDeclarationImplKt
28. com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyDeclarationLocalVariableImpl
29. com.google.devtools.ksp.impl.symbol.kotlin.KSTypeParameterImpl
30. com.google.devtools.ksp.impl.symbol.kotlin.KSValueParameterImpl
31. com.google.devtools.ksp.impl.symbol.kotlin.UtilKt
32. com.google.devtools.ksp.impl.symbol.kotlin.resolved.KSAnnotationResolvedImpl
33. com.google.devtools.ksp.impl.symbol.util.BinaryUtilsKt
34. com.google.devtools.ksp.impl.symbol.util.DeclarationOrdering
35. com.google.devtools.ksp.impl.symbol.util.PsiUtilsKt
36. com.google.devtools.ksp.processing.KSPConfig$Builder
37. com.google.devtools.ksp.processing.KSPConfigKt
38. com.google.devtools.ksp.standalone.IncrementalJavaFileManagerKt
================================================================================

Another update

1. com.google.devtools.ksp.cmdline.KSPJvmMainKt.printHelpMsg
  2. com.google.devtools.ksp.common.IncrementalContextBase.getOnDemandImports
  3. com.google.devtools.ksp.common.IncrementalContextBase.recordGetSealedSubclasses
  4. com.google.devtools.ksp.common.impl.PsiResolutionStrategy.resolveJavaAnnotationByShortName
  5. com.google.devtools.ksp.gradle.AndroidPluginIntegration.registerGeneratedSources
  6. com.google.devtools.ksp.gradle.AndroidPluginIntegration.tryUpdateKspWithAndroidSourceSets
  7. com.google.devtools.ksp.gradle.KspAATask$Companion$registerKspAATask$kspTaskProvider$1$3$mapArgProviders$1.transform
  8. com.google.devtools.ksp.gradle.KspAATask$Companion.configureCrossCompilationSkipCondition$lambda$6
  9. com.google.devtools.ksp.gradle.KspConfigurations.<init>
 10. com.google.devtools.ksp.impl.KotlinSymbolProcessing.execute$lambda$9
 11. com.google.devtools.ksp.impl.ResolverAAImpl.getClassDeclarationByName$findClass
 12. com.google.devtools.ksp.impl.ResolverAAImpl.getDeclarationsInSourceOrder
 13. com.google.devtools.ksp.impl.ResolverAAImpl.getFunctionDeclarationsByName
 14. com.google.devtools.ksp.impl.ResolverAAImpl.getPackageAnnotations$kotlin_analysis_api
 15. com.google.devtools.ksp.impl.ResolverAAImpl.getPropertyDeclarationByName
 16. com.google.devtools.ksp.impl.symbol.java.KSAnnotationJavaImpl.arguments_delegate$lambda$0
 17. com.google.devtools.ksp.impl.symbol.java.KSAnnotationJavaImpl.defaultArguments_delegate$lambda$0
 18. com.google.devtools.ksp.impl.symbol.java.KSAnnotationJavaImplKt.calcValue
 19. com.google.devtools.ksp.impl.symbol.kotlin.AbstractKSDeclarationImpl.parent_delegate$lambda$0
 20. com.google.devtools.ksp.impl.symbol.kotlin.KSAnnotationImpl.defaultArguments_delegate$lambda$0
 21. com.google.devtools.ksp.impl.symbol.kotlin.KSClassDeclarationEnumEntryImpl.getAllFunctions
 22. com.google.devtools.ksp.impl.symbol.kotlin.KSClassDeclarationEnumEntryImpl.getAllProperties
 23. com.google.devtools.ksp.impl.symbol.kotlin.KSClassDeclarationEnumEntryImpl.parentDeclaration_delegate$lambda$0
 24. com.google.devtools.ksp.impl.symbol.kotlin.KSClassDeclarationImpl.primaryConstructor_delegate$lambda$0
 25. com.google.devtools.ksp.impl.symbol.kotlin.KSFunctionDeclarationImpl$special$$inlined$lazyMemoizedSequence$1.invoke
 26. com.google.devtools.ksp.impl.symbol.kotlin.KSFunctionDeclarationImpl.extensionReceiver_delegate$lambda$0
 27. com.google.devtools.ksp.impl.symbol.kotlin.KSFunctionDeclarationImpl.simpleName_delegate$lambda$0
 28. com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyAccessorImpl$special$$inlined$lazyMemoizedSequence$3.invoke
 29. com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyDeclarationImpl.extensionReceiver_delegate$lambda$0
 30. com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyDeclarationImpl.hasBackingField_delegate$lambda$0
 31. com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyDeclarationLocalVariableImpl.type_delegate$lambda$0
 32. com.google.devtools.ksp.impl.symbol.kotlin.KSTypeParameterImpl.bounds_delegate$lambda$0
 33. com.google.devtools.ksp.impl.symbol.kotlin.UtilKt.annotationsWithRepeatableUnfolded
 34. com.google.devtools.ksp.impl.symbol.kotlin.UtilKt.convertToKotlinType
 35. com.google.devtools.ksp.impl.symbol.kotlin.UtilKt.findJvmSuppressWildcards
 36. com.google.devtools.ksp.impl.symbol.kotlin.UtilKt.typeArguments
 37. com.google.devtools.ksp.impl.symbol.kotlin.UtilKt.updateFromAnnotations
 38. com.google.devtools.ksp.impl.symbol.kotlin.resolved.KSAnnotationResolvedImpl.defaultArguments_delegate$lambda$0
 39. com.google.devtools.ksp.impl.symbol.util.PsiUtilsKt.getDocString
 40. com.google.devtools.ksp.processing.KSPConfig$Builder.setIncrementalLogGraphOrigin

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

@jaschdoc jaschdoc left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Build files have not changed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

@jaschdoc
jaschdoc force-pushed the format-with-ktfmt branch from 0a9f159 to fb43485 Compare July 16, 2026 14:52
@jaschdoc
jaschdoc marked this pull request as ready for review July 16, 2026 15:33

@jaschdoc jaschdoc left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked more files

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

@jaschdoc jaschdoc left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked more files

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Checked

@jaschdoc
jaschdoc force-pushed the format-with-ktfmt branch 2 times, most recently from 9f5c1e7 to 9b2b79a Compare July 17, 2026 11:09
@jaschdoc
jaschdoc force-pushed the format-with-ktfmt branch from 9b2b79a to 185d94e Compare July 17, 2026 11:29
@jaschdoc
jaschdoc marked this pull request as draft July 17, 2026 12:55
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.

1 participant