Skip to content
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

Try out error_prone and write about it in the wiki #492

Open
jwlibby opened this issue May 22, 2024 · 1 comment
Open

Try out error_prone and write about it in the wiki #492

jwlibby opened this issue May 22, 2024 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@jwlibby
Copy link
Collaborator

jwlibby commented May 22, 2024

This is part of the #462 epic on plugins for quality.
Note: error_prone is a replacement for the stock JDK javac as a plugin to the JDK compiler

Try out error_prone and see what you think. When evaluating refer to the questions in #462 and upon completion add your pros and cons for this plugin as a comment to the aforementioned story. Plugin link: error-prone.

error_prone should fail many of the problems spotted by CodeQL and security/quality plugins, but fail them during compile. This is part of "security/quality in depth": if one tool doesn't catch concerns, another tool might.

This is a good topic for the "Going Further" section in Use static analysis. That page does not have more (yet) for folks to do in improving the compilation part of their build.

Note, this problem showed up: https://stackoverflow.com/questions/69439506/no-processor-claimed-any-of-these-annotations

Write about it in the wiki
Look for a badge

@jwlibby jwlibby added the spike Explore options and questions label May 22, 2024
@jwlibby jwlibby moved this to Backlog in @binkley's Modern Build May 22, 2024
@jwlibby jwlibby moved this from Backlog to Ready in @binkley's Modern Build May 22, 2024
@binkley binkley changed the title Try out error-prone Try out error_prone May 28, 2024
@binkley binkley assigned binkley and unassigned binkley Jun 5, 2024
@binkley binkley changed the title Try out error_prone [Spike] Try out error_prone Jun 19, 2024
@jwlibby
Copy link
Collaborator Author

jwlibby commented Aug 8, 2024

  • What is the license? Apache 2.0
  • Does the plugin work with both Gradle and Maven? Yes, but complicated: Gradle needs a 3rd-party plugin
  • What IDEs have add-ons for the tool? IntelliJ, eclipse
  • How does this mesh with Checkstyle? Or can the plugin replace Checkstyle? Identifies different problems
  • Can the plugin automatically reformat the code as part of the local build process? no
  • If code is reformatted before pushing, how will the programmer be aware of this? n/a
  • Does the plugin have good backward/forward compatibility and adaptability to different versions of the language, its dependencies and the runtime environment (jvm)? Doesn’t work out of the box w 21, have to add special jvm compiler directives
  • Is the plugin configurable in its rules to meet my team standards?
    • Book tries to be agnostic on most things. An existing example is the checkstyle settings in config/checkstyle/*. Some coarse grained configuration
  • Other notes
    • Gradle build fails due to insufficient test coverage, but maven doesn’t, why?

@jwlibby jwlibby moved this from In progress to In review in @binkley's Modern Build Aug 8, 2024
@jwlibby jwlibby removed their assignment Aug 8, 2024
binkley added a commit that referenced this issue Aug 9, 2024
See https://github.com/tbroyer/gradle-errorprone-plugin.

Example error below.
This error seems bizarre. Our code does not do this: perhaps generated
code?

```
> Task :compileJava
/home/binkley/src/java/modern-java-practices/src/main/java/demo/ErrorProneSpike.java:24: error: [CollectionIncompatibleType] Argument 'i - 1' should not be passed to this method; its type int is not compatible with its collection's type argument Short
            s.remove(i - 1);
                    ^
    (see https://errorprone.info/bugpattern/CollectionIncompatibleType)
1 error
```
@jwlibby jwlibby added documentation Improvements or additions to documentation enhancement New feature or request and removed spike Explore options and questions labels Aug 9, 2024
@jwlibby jwlibby changed the title [Spike] Try out error_prone Try out error_prone and write about it in the wiki Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
Status: In progress
Development

No branches or pull requests

2 participants