Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use compact-no-array style for @InlineMe annotations
Suggestions by the `InlineMeSuggester` always use the array syntax for import annotations even when only one import is listed. This clashes with checkstyle's [`AnnotationUseStyleCheck`](https://checkstyle.sourceforge.io/apidocs/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.html) check which uses `COMPACT_NO_ARRAY` style per default and disallows single-value arrays. Note that the proposed style would also work with the two other checkstyle options. Example: ```diff - @InlineMe(replacement = "REPLACEMENT", "imports = {"java.time.Duration"}) + @InlineMe(replacement = "REPLACEMENT", "imports = "java.time.Duration") ``` Note that this is a more nitty suggestion -- fine to drop this if the other style is preferred. But I believe this would reduce friction for consumers using checkstyle. Fixes #2366 COPYBARA_INTEGRATE_REVIEW=#2366 from fawind:fw/inlineme-compact-no-array 6af0ad6 PiperOrigin-RevId: 376748570
- Loading branch information
Showing
2 changed files
with
26 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters