Title: Inconsistent annotation formatting · Issue #360 · google/google-java-format · GitHub
Open Graph Title: Inconsistent annotation formatting · Issue #360 · google/google-java-format
X Title: Inconsistent annotation formatting · Issue #360 · google/google-java-format
Description: I was wondering if anyone could explain the inconsistent formatting of annotations I see here between an abstract class member and a private field: - @Value.Parameter - abstract int page(); + @Value.Parameter + abstract int page(); and -...
Open Graph Description: I was wondering if anyone could explain the inconsistent formatting of annotations I see here between an abstract class member and a private field: - @Value.Parameter - abstract int page(); + @Valu...
X Description: I was wondering if anyone could explain the inconsistent formatting of annotations I see here between an abstract class member and a private field: - @Value.Parameter - abstract int page(); + @Valu...
Opengraph URL: https://github.com/google/google-java-format/issues/360
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistent annotation formatting","articleBody":"I was wondering if anyone could explain the inconsistent formatting of annotations I see here between an abstract class member and a private field:\r\n\r\n```\r\n- @Value.Parameter\r\n- abstract int page();\r\n+ @Value.Parameter\r\n+ abstract int page();\r\n```\r\n\r\nand\r\n\r\n```\r\n- @Reference\r\n- private SomeService someService;\r\n+ @Reference private SomeService someService;\r\n```\r\n\r\nThe [style guide](https://google.github.io/styleguide/javaguide.html#s4.8.5-annotations) mentions that **multiple annotations** _may_ go on a single line - but my reading would be that it could imply \"the annotations remain on a separate line to the field, but the annotations may be wrapped onto one line\".\r\n\r\nIt further says there's no specific rules about types, parameters and local variables.\r\n\r\nFor a measure of consistency - I think sticking to separate lines would be better, except for parameters - which already often wrap to their own line.\r\n\r\nThoughts? What are the rules which the formatter currently uses?","author":{"url":"https://github.com/talios","@type":"Person","name":"talios"},"datePublished":"2019-04-04T00:07:49Z","url":"https://github.com/google/google-java-format/issues/360"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:90a22620-cc3d-4ee3-c064-207dc02e05ee |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB2E:13BAA8:84C196:B08350:6AFBD3FD |
| html-safe-nonce | 8a8865b08762b1514647278844fba2873160cc0cdfcea4190d6013f09a20b1e5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjJFOjEzQkFBODo4NEMxOTY6QjA4MzUwOjZBRkJEM0ZEIiwidmlzaXRvcl9pZCI6IjMwMzY0OTUzMzg3NzUzOTgzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 99cd6237194dc28105c1dc996231cb0df9dc646e88f6673b6d1d900e96a8b625 |
| hovercard-subject-tag | issue:429025964 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/google/google-java-format/360/issue_layout |
| twitter:image | https://opengraph.githubassets.com/df2925dccdc61260907fea8d224325d4eeba9f82e7b552d0005348ba7f40ade8/google/google-java-format/issues/360 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/df2925dccdc61260907fea8d224325d4eeba9f82e7b552d0005348ba7f40ade8/google/google-java-format/issues/360 |
| og:image:alt | I was wondering if anyone could explain the inconsistent formatting of annotations I see here between an abstract class member and a private field: - @Value.Parameter - abstract int page(); + @Valu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | talios |
| hostname | github.com |
| expected-hostname | github.com |
| None | 18742cb872ec73544356e60359266b67aafece70c4ce008042e06227924cdd07 |
| turbo-cache-control | no-preview |
| go-import | github.com/google/google-java-format git https://github.com/google/google-java-format.git |
| octolytics-dimension-user_id | 1342004 |
| octolytics-dimension-user_login | |
| octolytics-dimension-repository_id | 35448780 |
| octolytics-dimension-repository_nwo | google/google-java-format |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 35448780 |
| octolytics-dimension-repository_network_root_nwo | google/google-java-format |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 820be804f18e1ef3940bd74a00d41d73d02e2b91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width