Visitar URL original
Use compact-no-array style for @InlineMe annotations by fawind · Pull Request #2366 · google/error-prone · GitHub
Skip to content

Use compact-no-array style for @InlineMe annotations - #2366

Closed
fawind wants to merge 1 commit into
google:masterfrom
fawind:fw/inlineme-compact-no-array
Closed

fawind wants to merge 1 commit into
google:masterfrom
fawind:fw/inlineme-compact-no-array

Conversation

@fawind

@fawind fawind commented May 27, 2021

Copy link
Copy Markdown
Contributor

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 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:

- @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.

@google-cla google-cla Bot added the cla: yes label May 27, 2021
@copybara-service copybara-service Bot closed this in 9aa812b Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants