Title: Block-like array initializers are not preserved · Issue #572 · google/google-java-format · GitHub
Open Graph Title: Block-like array initializers are not preserved · Issue #572 · google/google-java-format
X Title: Block-like array initializers are not preserved · Issue #572 · google/google-java-format
Description: The Google Java Style Guide specifies that arrays may be formatted in a block-like fashion, however google-java-format clobbers this to one line per element. For example, the following: protected static final byte[] TEST_ARRAY = new byte...
Open Graph Description: The Google Java Style Guide specifies that arrays may be formatted in a block-like fashion, however google-java-format clobbers this to one line per element. For example, the following: protected s...
X Description: The Google Java Style Guide specifies that arrays may be formatted in a block-like fashion, however google-java-format clobbers this to one line per element. For example, the following: protected s...
Opengraph URL: https://github.com/google/google-java-format/issues/572
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Block-like array initializers are not preserved","articleBody":"The [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html#s4.8.3-arrays) specifies that arrays may be formatted in a block-like fashion, however google-java-format clobbers this to one line per element.\r\n\r\nFor example, the following:\r\n\r\n```\r\nprotected static final byte[] TEST_ARRAY =\r\n new byte[] {\r\n (byte) 0x31, (byte) 0x32, (byte) 0x33, (byte) 0x34, (byte) 0x35, (byte) 0x36, (byte) 0xFF, (byte) 0xFF\r\n };\r\n```\r\nbecomes\r\n```\r\n protected static final byte[] TEST_ARRAY =\r\n new byte[] {\r\n (byte) 0x31,\r\n (byte) 0x32,\r\n (byte) 0x33,\r\n (byte) 0x34,\r\n (byte) 0x35,\r\n (byte) 0x36,\r\n (byte) 0xFF,\r\n (byte) 0xFF\r\n };\r\n```\r\n\r\nFor larger formatted constant definitions, formatting is essential to preserving understanding of the structure. It seems like preserving formatting should either be default behaviour, or an option.","author":{"url":"https://github.com/makinako","@type":"Person","name":"makinako"},"datePublished":"2021-03-09T01:35:42Z","url":"https://github.com/google/google-java-format/issues/572"}
| 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:d2f3c49a-3d71-ffc8-3164-5f6a61995657 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A908:2668B6:88B255:BA4C7F:6AFBD040 |
| html-safe-nonce | 071d5d05f5267c896f1cfc7b050c8de334690fd126abe6119d9d1ded30b5c794 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTA4OjI2NjhCNjo4OEIyNTU6QkE0QzdGOjZBRkJEMDQwIiwidmlzaXRvcl9pZCI6IjkxNDk2MzM4NTM5NzM1ODE4ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1ebb6244f582cd3021c32f7cecc13b2bbb9b68bcac0fcfc4da7df789ff1eec94 |
| hovercard-subject-tag | issue:825151040 |
| 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/572/issue_layout |
| twitter:image | https://opengraph.githubassets.com/74054ceb7129a8fa003105456606e3eea7568dc94bd2fc1c15200c276746bf2d/google/google-java-format/issues/572 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/74054ceb7129a8fa003105456606e3eea7568dc94bd2fc1c15200c276746bf2d/google/google-java-format/issues/572 |
| og:image:alt | The Google Java Style Guide specifies that arrays may be formatted in a block-like fashion, however google-java-format clobbers this to one line per element. For example, the following: protected s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | makinako |
| 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