You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(contrib): fix various grammar errors and markdownlint issues (#402)
grammar:
- "lot of people" -> "many people"
- unneeded "the" before "backward compatibility"
- "shall" -> "should"
- missing comma "," after various prepositions
- fix run-on sentence in `volatile` style
- etc
`markdownlint` issues:
- add syntax highlighting to Java codeblock example
- consistently use `-` instead of `*` or `+`
- all three were used before, only one should be used consistently
- consistently use two space indentation for sub-bullets
- sometimes it was two space, other times it was four space
- etc
and [jenkins solutions](https://wiki.jenkins-ci.org/display/JENKINS/Hint+on+retaining+backward+compatibility) can help to retain the backward compatibility.
9
+
and [jenkins solutions](https://wiki.jenkins-ci.org/display/JENKINS/Hint+on+retaining+backward+compatibility) can help to retain backward compatibility.
10
10
- Should be easily maintained (so maintainers need some time to think about architecture of implementation).
11
11
- Have at least one test for positive use case.
12
12
13
-
This plugin is used by lot of people, so it should be stable enough. Please ensure your change is compatible at least with the last LTS line.
13
+
This plugin is used by many people, so it should be stable. Please ensure your change is compatible at least with the last LTS line.
14
14
Any core dependency upgrade must be justified.
15
15
16
16
# Code Style Guidelines
@@ -20,9 +20,9 @@ Checkstyle rules are more important than this document.
20
20
21
21
## Resulting from long experience
22
22
23
-
* To the largest extent possible, all fields shall be private. Use an IDE to generate the getters and setters.
24
-
* 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).
25
-
* 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`.
23
+
- To the largest extent possible, all fields should be private. Use an IDE to generate the getters and setters.
24
+
- 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 multiple fields into an immutable value object. That is, to replace 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).
25
+
- If it is `Serializable`, it should have a `serialVersionUID` field. Unless code has shipped to users, the initial value of the `serialVersionUID` field should be `1L`.
26
26
27
27
## Indentation
28
28
@@ -32,45 +32,46 @@ Checkstyle rules are more important than this document.
32
32
## Field Naming Conventions
33
33
34
34
1. "hungarian"-style notation is banned (e.g. instance variable names preceded by an 'm', etc.).
35
-
2. If the field is `static final` then it shall be named in`ALL_CAPS_WITH_UNDERSCORES`.
35
+
2. If the field is `static final`, then it should be named as`ALL_CAPS_WITH_UNDERSCORES`.
36
36
3. Start variable names with a lowercase letter and use camelCase rather than under_scores.
37
37
4. Spelling and abbreviations: If the word is widely used in the JVM runtime, stick with the spelling/abbreviation in the JVM runtime, e.g. `color` over `colour`, `sync` over `synch`, `async` over `asynch`, etc.
38
38
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.
39
39
6. It is acceptable to use `e` for the exception in a `try...catch` block.
40
-
7.You shall never use `l` (i.e. lower case `L`) as a variable name.
40
+
7.Never use `l` (i.e. lower case `L`) as a variable name.
41
41
42
42
## Line Length
43
43
44
44
To the greatest extent possible, please wrap lines to ensure that they do not exceed 120 characters.
45
45
46
46
## Maven POM file layout
47
47
48
-
* The `pom.xml` file shall use the sequencing of elements as defined by the `mvn tidy:pom` command (after any indenting fix-up).
49
-
* 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.
50
-
* If the `<plugin>` is in the groupId `org.apache.maven.plugins` you shall omit the `<groupId>`.
51
-
* All `<plugin>` entries shall have an explicit version defined unless inherited from the parent.
48
+
- The `pom.xml` file should use the sequencing of elements as defined by the `mvn tidy:pom` command (after any indenting fix-up).
49
+
- 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 should be provided.
50
+
- If the `<plugin>` is in the groupId `org.apache.maven.plugins`, you should omit the `<groupId>`.
51
+
- All `<plugin>` entries should have an explicit version defined unless inherited from the parent.
52
52
53
53
## Java code style
54
54
55
55
### Imports
56
56
57
-
* For code in `src/main`:
58
-
-`*` imports are banned.
59
-
-`static` imports are preferred until not mislead.
60
-
* For code in `src/test`:
61
-
-`*` imports of anything other than JUnit classes and Hamcrest matchers are banned.
57
+
- For code in `src/main`:
58
+
-`*` imports are banned.
59
+
-`static` imports are preferred until not mislead.
60
+
- For code in `src/test`:
61
+
-`*` imports of anything other than JUnit classes and Hamcrest matchers are banned.
62
62
63
63
### Annotation placement
64
64
65
-
* 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.
66
-
* 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).
65
+
- Annotations on classes, interfaces, annotations, enums, methods, fields and local variables should be on the lines immediately preceding the line where modifier(s) (e.g. `public` / `protected` / `private` / `final`, etc) would be appropriate.
66
+
- Annotations on method arguments should, to the largest extent possible, be on the same line as the method argument (and, if present, before the `final` modifier).
67
67
68
68
### Javadoc
69
69
70
-
* Each class shall have a Javadoc comment.
71
-
* Unless the method is `private`, it shall have a Javadoc comment.
72
-
* Getters and Setters shall have a Javadoc comment. The following is prefered:
73
-
```
70
+
- Each class should have a Javadoc comment.
71
+
- Unless the method is `private`, it should have a Javadoc comment.
72
+
- Getters and Setters should have a Javadoc comment. The following is prefered:
73
+
74
+
```java
74
75
/**
75
76
* The count of widgets
76
77
*/
@@ -94,7 +95,8 @@ To the greatest extent possible, please wrap lines to ensure that they do not ex
94
95
this.widgetCount = widgetCount;
95
96
}
96
97
```
97
-
* 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.
98
+
99
+
-When adding a new class / interface / etc, it should have a `@since` doc comment. The version should 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/interfaceunless a different `@since` annotation is present.
0 commit comments