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

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

Closed
wants to merge 1 commit into from

Conversation

fawind
Copy link
Contributor

@fawind fawind commented May 27, 2021

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.

None yet

2 participants