{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/github-plugin/pulls/comments/37234123","id":37234123,"diff_hunk":"@@ -0,0 +1,122 @@\n+# Code Style Guidelines\n+\n+Most of rules is checked with help of the *maven-checkstyle-plugin* during the `validate` phase. \n+Checkstyle rules are more important than this document.\n+\n+## Resulting from long experience\n+\n+* To the largest extent possible, all fields shall be private. Use an IDE to generate the getters and setters.\n+* If a class has more than one `volatile` member field, it is probable that there are subtle race conditions. Please consider where appropriate encapsulation of the multiple fields into an immutable value object replace the multiple `volatile` member fields with a single `volatile` reference to the value object (or perhaps better yet an `AtomicReference` to allow for `compareAndSet` - if compare-and-set logic is appropriate).\n+* If it is `Serializable` it shall have a `serialVersionUID` field. Unless code has shipped to users, the initial value of the `serialVersionUID` field shall be `1L`.\n+\n+## Indentation\n+\n+1. **Use spaces.** Tabs are banned.\n+2. **Java blocks are 4 spaces.** JavaScript blocks as for Java. **XML nesting is 4 spaces**\n+\n+## Field Naming Conventions\n+\n+1. \"hungarian\"-style notation is banned (i.e. instance variable names preceded by an 'm', etc)\n+2. If the field is `static final` then it shall be named in `ALL_CAPS_WITH_UNDERSCORES`.\n+3. Start variable names with a lowercase letter and use camelCase rather than under_scores.\n+4. Spelling and abreviations: If the word is widely used in the JVM runtime, stick with the spelling/abreviation in the JVM runtime, e.g. `color` over `colour`, `sync` over `synch`, `async` over `asynch`, etc.\n+5. It is acceptable to use `i`, `j`, `k` for loop indices and iterators. If you need more than three, you are likely doing something wrong and as such you shall either use full descriptive names or refactor.\n+6. It is acceptable to use `e` for the exception in a `try...catch` block.\n+7. You shall never use `l` (i.e. lower case `L`) as a variable name.\n+\n+## Line Length\n+\n+To the greatest extent possible, please wrap lines to ensure that they do not exceed 120 characters.\n+\n+## Maven POM file layout\n+\n+* The `pom.xml` file shall use the sequencing of elements as defined by the `mvn tidy:pom` command (after any indenting fix-up).\n+* If you are introducing a property to the `pom.xml` the property must be used in at least two distinct places in the model or a comment justifying the use of a property shall be provided.\n+* If the `<plugin>` is in the groupId `org.apache.maven.plugins` you shall omit the `<groupId>`.\n+* All `<plugin>` entries shall have an explicit version defined unless inherited from the parent.\n+\n+## Java code style\n+\n+### Imports\n+\n+* For code in `src/main`:\n+    - `*` imports are banned. \n+    - `static` imports are preferred until not mislead.\n+* For code in `src/test`:\n+    - `*` imports of anything other than JUnit classes and Hamcrest matchers are banned.\n+\n+### Annotation placement\n+\n+* Annotations on classes, interfaces, annotations, enums, methods, fields and local variables shall be on the lines immediately preceding the line where modifier(s) (e.g. `public` / `protected` / `private` / `final`, etc) would be appropriate.\n+* Annotations on method arguments shall, to the largest extent possible, be on the same line as the method argument (and, if present, before the `final` modifier)\n+\n+### Javadoc\n+\n+* Each class shall have a Javadoc comment.\n+* Unless the method is `private`, it shall have a Javadoc comment.\n+* Getters and Setters shall have a Javadoc comment. The following is prefered\n+    ```\n+    /**\n+     * The count of widgets\n+     */\n+    private int widgetCount;\n+    \n+    /**\n+     * Returns the count of widgets.\n+     *\n+     * @return the count of widgets. \n+     */\n+    public int getWidgetCount() {\n+        return widgetCount;\n+    }\n+    \n+    /**\n+     * Sets the count of widgets.\n+     *\n+     * @param widgetCount the count of widgets.\n+     */\n+    public void setWidgetCount(int widgetCount) {\n+        this.widgetCount = widgetCount;\n+    }\n+    ```\n+* When adding a new class / interface / etc, it shall have a `@since` doc comment. The version shall be `FIXME` (or `TODO`) to indicate that the person merging the change should replace the `FIXME` with the next release version number. The fields and methods within a class/interface (but not nested classes) will be assumed to have the `@since` annotation of their class/interface unless a different `@since` annotation is present.\n+\n+### IDE Configuration\n+\n+* Eclipse, by and large the IDE defaults are acceptable with the following changes:\n+    - Tab policy to `Spaces only`\n+    - Indent statements within `switch` body\n+    - Maximum line width `120`\n+    - Line wrapping, ensure all to `wrap where necessary`\n+    - Organize imports alphabetically, no grouping\n+* NetBeans, by and large the IDE defaults are acceptable with the following changes:\n+    - Tabs and Indents\n+        + Change Right Margin to `120`\n+        + Indent case statements in switch\n+    - Wrapping\n+        + Change all the `Never` values to `If Long`\n+        + Select the checkbox for Wrap After Assignement Operators\n+* IntelliJ, by and large the IDE defaults are acceptable with the following changes:\n+    - Wrapping and Braces\n+        + Change `Do not wrap` to `Wrap if long`\n+        + Change `Do not force` to `Always`\n+    - Javadoc\n+        + Disable generating `<p/>` on empty lines\n+    - Imports\n+        + Class count to use import with '*': `9999`\n+        + Names count to use static import with '*': `99999`\n+        + Import Layout\n+            * import all other imports\n+            * blank line\n+            * import static all other imports\n+    \n+## Issues\n+\n+This project uses [Jenkins Jira issue tracker](https://issues.jenkins-ci.org) \n+with [github-plugin](https://issues.jenkins-ci.org/browse/JENKINS/component/15896) component.\n+            \n+## Links \n+\n+- https://wiki.jenkins-ci.org/display/JENKINS/contributing\n+- https://wiki.jenkins-ci.org/display/JENKINS/Extend+Jenkins\n+- https://wiki.jenkins-ci.org/display/JENKINS/GitHub+commit+messages","path":"CONTRIBUTING.md","position":122,"original_position":122,"commit_id":"9b5fba601717c07d13686a61845200e74c3e4884","original_commit_id":"9b5fba601717c07d13686a61845200e74c3e4884","user":{"login":"KostyaSha","id":231611,"avatar_url":"https://avatars.githubusercontent.com/u/231611?v=3","gravatar_id":"","url":"https://api.github.com/users/KostyaSha","html_url":"https://github.com/KostyaSha","followers_url":"https://api.github.com/users/KostyaSha/followers","following_url":"https://api.github.com/users/KostyaSha/following{/other_user}","gists_url":"https://api.github.com/users/KostyaSha/gists{/gist_id}","starred_url":"https://api.github.com/users/KostyaSha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KostyaSha/subscriptions","organizations_url":"https://api.github.com/users/KostyaSha/orgs","repos_url":"https://api.github.com/users/KostyaSha/repos","events_url":"https://api.github.com/users/KostyaSha/events{/privacy}","received_events_url":"https://api.github.com/users/KostyaSha/received_events","type":"User","site_admin":false},"body":"@jtnord included his earlier \"GitHub+commit+messages\" into \"contributing\" page. So this link can be removed now","created_at":"2015-08-17T20:40:48Z","updated_at":"2015-08-17T20:40:48Z","html_url":"https://github.com/jenkinsci/github-plugin/pull/69#discussion_r37234123","pull_request_url":"https://api.github.com/repos/jenkinsci/github-plugin/pulls/69","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/github-plugin/pulls/comments/37234123"},"html":{"href":"https://github.com/jenkinsci/github-plugin/pull/69#discussion_r37234123"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/github-plugin/pulls/69"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/github-plugin/pulls/69","id":42596879,"html_url":"https://github.com/jenkinsci/github-plugin/pull/69","diff_url":"https://github.com/jenkinsci/github-plugin/pull/69.diff","patch_url":"https://github.com/jenkinsci/github-plugin/pull/69.patch","issue_url":"https://api.github.com/repos/jenkinsci/github-plugin/issues/69","number":69,"state":"open","locked":false,"title":"checkstyle with contributing guides","user":{"login":"lanwen","id":1964214,"avatar_url":"https://avatars.githubusercontent.com/u/1964214?v=3","gravatar_id":"","url":"https://api.github.com/users/lanwen","html_url":"https://github.com/lanwen","followers_url":"https://api.github.com/users/lanwen/followers","following_url":"https://api.github.com/users/lanwen/following{/other_user}","gists_url":"https://api.github.com/users/lanwen/gists{/gist_id}","starred_url":"https://api.github.com/users/lanwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lanwen/subscriptions","organizations_url":"https://api.github.com/users/lanwen/orgs","repos_url":"https://api.github.com/users/lanwen/repos","events_url":"https://api.github.com/users/lanwen/events{/privacy}","received_events_url":"https://api.github.com/users/lanwen/received_events","type":"User","site_admin":false},"body":"no any functional change, only code style and maven-checkstyle-plugin in pom\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/jenkinsci/github-plugin/69)\n<!-- Reviewable:end -->\n","created_at":"2015-08-17T14:56:17Z","updated_at":"2015-08-17T20:40:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f23bc4bb3ebdf7620e2480441da612647b458d6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/github-plugin/pulls/69/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/github-plugin/pulls/69/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/github-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/github-plugin/issues/69/comments","statuses_url":"https://api.github.com/repos/jenkinsci/github-plugin/statuses/9b5fba601717c07d13686a61845200e74c3e4884","head":{"label":"lanwen:checkstyle","ref":"checkstyle","sha":"9b5fba601717c07d13686a61845200e74c3e4884","user":{"login":"lanwen","id":1964214,"avatar_url":"https://avatars.githubusercontent.com/u/1964214?v=3","gravatar_id":"","url":"https://api.github.com/users/lanwen","html_url":"https://github.com/lanwen","followers_url":"https://api.github.com/users/lanwen/followers","following_url":"https://api.github.com/users/lanwen/following{/other_user}","gists_url":"https://api.github.com/users/lanwen/gists{/gist_id}","starred_url":"https://api.github.com/users/lanwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lanwen/subscriptions","organizations_url":"https://api.github.com/users/lanwen/orgs","repos_url":"https://api.github.com/users/lanwen/repos","events_url":"https://api.github.com/users/lanwen/events{/privacy}","received_events_url":"https://api.github.com/users/lanwen/received_events","type":"User","site_admin":false},"repo":{"id":37472554,"name":"github-plugin","full_name":"lanwen/github-plugin","owner":{"login":"lanwen","id":1964214,"avatar_url":"https://avatars.githubusercontent.com/u/1964214?v=3","gravatar_id":"","url":"https://api.github.com/users/lanwen","html_url":"https://github.com/lanwen","followers_url":"https://api.github.com/users/lanwen/followers","following_url":"https://api.github.com/users/lanwen/following{/other_user}","gists_url":"https://api.github.com/users/lanwen/gists{/gist_id}","starred_url":"https://api.github.com/users/lanwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lanwen/subscriptions","organizations_url":"https://api.github.com/users/lanwen/orgs","repos_url":"https://api.github.com/users/lanwen/repos","events_url":"https://api.github.com/users/lanwen/events{/privacy}","received_events_url":"https://api.github.com/users/lanwen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lanwen/github-plugin","description":"Jenkins github plugin","fork":true,"url":"https://api.github.com/repos/lanwen/github-plugin","forks_url":"https://api.github.com/repos/lanwen/github-plugin/forks","keys_url":"https://api.github.com/repos/lanwen/github-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lanwen/github-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lanwen/github-plugin/teams","hooks_url":"https://api.github.com/repos/lanwen/github-plugin/hooks","issue_events_url":"https://api.github.com/repos/lanwen/github-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/lanwen/github-plugin/events","assignees_url":"https://api.github.com/repos/lanwen/github-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/lanwen/github-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/lanwen/github-plugin/tags","blobs_url":"https://api.github.com/repos/lanwen/github-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lanwen/github-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lanwen/github-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/lanwen/github-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lanwen/github-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/lanwen/github-plugin/languages","stargazers_url":"https://api.github.com/repos/lanwen/github-plugin/stargazers","contributors_url":"https://api.github.com/repos/lanwen/github-plugin/contributors","subscribers_url":"https://api.github.com/repos/lanwen/github-plugin/subscribers","subscription_url":"https://api.github.com/repos/lanwen/github-plugin/subscription","commits_url":"https://api.github.com/repos/lanwen/github-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/lanwen/github-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/lanwen/github-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/lanwen/github-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/lanwen/github-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/lanwen/github-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lanwen/github-plugin/merges","archive_url":"https://api.github.com/repos/lanwen/github-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lanwen/github-plugin/downloads","issues_url":"https://api.github.com/repos/lanwen/github-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/lanwen/github-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/lanwen/github-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/lanwen/github-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lanwen/github-plugin/labels{/name}","releases_url":"https://api.github.com/repos/lanwen/github-plugin/releases{/id}","created_at":"2015-06-15T15:08:01Z","updated_at":"2015-06-15T15:08:01Z","pushed_at":"2015-08-17T16:41:44Z","git_url":"git://github.com/lanwen/github-plugin.git","ssh_url":"git@github.com:lanwen/github-plugin.git","clone_url":"https://github.com/lanwen/github-plugin.git","svn_url":"https://github.com/lanwen/github-plugin","homepage":"http://jenkins-ci.org/","size":547,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"909f546ef7198137738cc8c650d5cdb7aa4b1f0e","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":1163555,"name":"github-plugin","full_name":"jenkinsci/github-plugin","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/github-plugin","description":"Jenkins github plugin","fork":false,"url":"https://api.github.com/repos/jenkinsci/github-plugin","forks_url":"https://api.github.com/repos/jenkinsci/github-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/github-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/github-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/github-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/github-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/github-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/github-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/github-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/github-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/github-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/github-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/github-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/github-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/github-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/github-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/github-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/github-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/github-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/github-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/github-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/github-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/github-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/github-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/github-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/github-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/github-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/github-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/github-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/github-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/github-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/github-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/github-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/github-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/github-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/github-plugin/releases{/id}","created_at":"2010-12-13T05:35:14Z","updated_at":"2015-08-17T16:23:19Z","pushed_at":"2015-08-17T16:41:44Z","git_url":"git://github.com/jenkinsci/github-plugin.git","ssh_url":"git@github.com:jenkinsci/github-plugin.git","clone_url":"https://github.com/jenkinsci/github-plugin.git","svn_url":"https://github.com/jenkinsci/github-plugin","homepage":"http://jenkins-ci.org/","size":1374,"stargazers_count":118,"watchers_count":118,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":151,"mirror_url":null,"open_issues_count":7,"forks":151,"open_issues":7,"watchers":118,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/github-plugin/pulls/69"},"html":{"href":"https://github.com/jenkinsci/github-plugin/pull/69"},"issue":{"href":"https://api.github.com/repos/jenkinsci/github-plugin/issues/69"},"comments":{"href":"https://api.github.com/repos/jenkinsci/github-plugin/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/github-plugin/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/github-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/github-plugin/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/github-plugin/statuses/9b5fba601717c07d13686a61845200e74c3e4884"}}}}