-
-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore FunctionOnlyReturningConstant for allowed annotations #1968
Ignore FunctionOnlyReturningConstant for allowed annotations #1968
Conversation
|
||
it("does not report excluded annotated function which returns a constant") { | ||
val code = """ | ||
import jdk.nashorn.internal.ir.annotations.Ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the reason why the build fails on some machines when compiling the test snippet. Please remove this import here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, replaced with kotlin.SinceKotlin
""".trimIndent() | ||
val config = TestConfig(mapOf("excludeAnnotatedFunction" to "jdk.nashorn.internal.ir.annotations.Ignore")) | ||
val rule = FunctionOnlyReturningConstant(config) | ||
assertThat(rule.compileAndLint(code)).hasSize(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
assertThat(rule.compileAndLint(code)).hasSize(0) | |
assertThat(rule.compileAndLint(code)).isEmpty() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done !
|
||
it("does not report excluded annotated function which returns a constant") { | ||
val code = """ | ||
import jdk.nashorn.internal.ir.annotations.Ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use the kotlin.SinceKotlin
annotation for testing purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, Done.
Thanks! I like this config option. |
…1968) * Ignore FunctionOnlyReturningConstant for allowed annotations * Refactor tests
…1968) * Ignore FunctionOnlyReturningConstant for allowed annotations * Refactor tests
Fixes #1313
excludeAnnotatedFunctions
to provide a list of annotations that can disableFunctionOnlyReturningConstant
checkdagger.Provides