Replies: 2 comments 2 replies
-
Those are the flags from https://errorprone.info/docs/installation and yes you'd need to explicitly add them to the Regarding the need for the flags, I think it'd be a good reason to open an issue on the ErrorProne project for them to add some documentation about |
Beta Was this translation helpful? Give feedback.
-
Ha! I can't imagine writing an error prone check without writing a test for it :). I guess my perspective is iff I'm using Java 17 right now with gradle I pretty quickly come across this plugin. I then create a simple project to use error prone and think "sweet, it works" ( which is what I did :) ). Now I want to bring in my own errorprone checks and since the plugin helped me get this far I kindof hope the plugin could help with tests as well. In my perfect world I would follow the plugin documentation and there'd be a section on "testing. your custom checks" and then be able to add something like: test {
useJUnitPlatform()
jvmArgs = errorpone.JVM_ARGS_STRONG_ENCAPSULATION
} Or something to that effect. Since you're going to all the effort to setup the flags for the builds, it would be lovely for people to not have to figure it out separately for testing their own custom checks. |
Beta Was this translation helpful? Give feedback.
-
I am developing a custom error prone check for error prone 2.18 running on java 17. Using the
net.ltgt.errorprone
plugin works great for building. However, when I adda test class that uses CompilationTestHelper as follow:I get the following error when executing the test:
I am able to resolve the issue by adding the following to the test section of my
build.gradle
file:These are the same args as in
ErrorPronePlugin.kt
JVM_ARGS_STRONG_ENCAPSULATION
.Am I missing something? Is there a flag I can add to the test section of my
build.gradle
file to add the strong encapsulation arguments when running tests usingCompilationTestHelper
?Beta Was this translation helpful? Give feedback.
All reactions