From 366f7cef8b4b7b62cb87f5e0c27d2f4fbee93a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=8C=AF=E8=8D=9F?= <605951224@qq.com> Date: Wed, 24 Oct 2018 17:33:49 +0900 Subject: [PATCH 1/2] Supplementary explanation for code snippets line width Add "Line width for code snippets is 76 characters" to Java Language Formatting Guidelines --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 172de8b008a7c..14aad7c6b7ab4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -159,6 +159,7 @@ Please follow these formatting guidelines: * Java indent is 4 spaces * Line width is 140 characters +* Line width for code snippets is 76 characters * The rest is left to Java coding standards * Disable “auto-format on save” to prevent unnecessary format changes. This makes reviews much harder as it generates unnecessary formatting changes. If your IDE supports formatting only modified chunks that is fine to do. * Wildcard imports (`import foo.bar.baz.*`) are forbidden and will cause the build to fail. This can be done automatically by your IDE: From 345c02e37c3429ea7bbce9de0b514081a89031dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=8C=AF=E8=8D=9F?= <605951224@qq.com> Date: Thu, 25 Oct 2018 09:25:33 +0900 Subject: [PATCH 2/2] Add additonal sentence for code snipptes. code snipptes that are included in the documentation (the ones surrounded by `// tag` and `// end` comments) --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 14aad7c6b7ab4..fcfb14b2b7979 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -159,7 +159,7 @@ Please follow these formatting guidelines: * Java indent is 4 spaces * Line width is 140 characters -* Line width for code snippets is 76 characters +* Line width for code snippets that are included in the documentation (the ones surrounded by `// tag` and `// end` comments) is 76 characters * The rest is left to Java coding standards * Disable “auto-format on save” to prevent unnecessary format changes. This makes reviews much harder as it generates unnecessary formatting changes. If your IDE supports formatting only modified chunks that is fine to do. * Wildcard imports (`import foo.bar.baz.*`) are forbidden and will cause the build to fail. This can be done automatically by your IDE: