Skip to content

Commit

Permalink
Merge pull request #8 from trello/vr/internal-root-function
Browse files Browse the repository at this point in the history
make sure root functions are internal so we don't have import errors
  • Loading branch information
burntcookie90 committed Mar 22, 2019
2 parents 9874755 + b285644 commit 3fe008a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package com.trello.mrclean.plugin

import com.squareup.kotlinpoet.FileSpec
import com.squareup.kotlinpoet.FunSpec
import com.squareup.kotlinpoet.KModifier

class RootFunctionGenerator {
fun createRootFunction(packageName: String): FileSpec {
val rootFunction = FunSpec.builder("sanitizedToString")
.addModifiers(KModifier.INTERNAL)
.receiver(Any::class)
.returns(String::class)
.apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RootFunctionGeneratorTest {
|import kotlin.Any
|import kotlin.String
|fun Any.sanitizedToString(): String =
|internal fun Any.sanitizedToString(): String =
| error("No function generated! Make sure to annotate with @Sanitize")
|
""".trimMargin()
Expand Down

0 comments on commit 3fe008a

Please sign in to comment.