Skip to content

Commit

Permalink
Do not add internal to private members (#6213)
Browse files Browse the repository at this point in the history
  • Loading branch information
BoD authored Oct 22, 2024
1 parent dca22ae commit cc5c076
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,36 @@ fun FileSpec.Builder.addInternal(patterns: List<String>): FileSpec.Builder = app
}
when (member) {
is TypeSpec -> {
member.toBuilder()
.addModifiers(KModifier.INTERNAL)
.build()
if (member.modifiers.contains(KModifier.PRIVATE)) {
member
} else {
member.toBuilder()
.addModifiers(KModifier.INTERNAL)
.build()
}
}

is FunSpec -> {
member.toBuilder()
.addModifiers(KModifier.INTERNAL)
.build()
if (member.modifiers.contains(KModifier.PRIVATE)) {
member
} else {
member.toBuilder()
.addModifiers(KModifier.INTERNAL)
.build()
}
}

is PropertySpec -> {
member.toBuilder()
.addModifiers(KModifier.INTERNAL)
.build()
if (member.modifiers.contains(KModifier.PRIVATE)) {
member
} else {
member.toBuilder()
.addModifiers(KModifier.INTERNAL)
.build()
}
}

else -> error("Top Level $member is not supported")
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ class CodegenTest {
}

val generateAsInternal = when (folder.name) {
"mutation_create_review", "simple_fragment" -> true
"mutation_create_review", "simple_fragment", "enum_field" -> true
else -> false
}

Expand Down

0 comments on commit cc5c076

Please sign in to comment.