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
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+21-20
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Found a bug? Take these steps:
16
16
17
17
# Feature Request
18
18
19
-
If you think there's something missing in Spectrum that is a good candidate to become a feature of the framework, please
19
+
If you think there's something missing in Spectrum that is a good candidate to become a new feature, please
20
20
[open a feature request](https://github.com/giulong/spectrum/issues/new?assignees=giulong&labels=&projects=&template=feature-request.md&title=%5BRFE%5D+%3CProvide+a+short+title%3E)
21
21
by fulfilling the provided template.
22
22
@@ -25,25 +25,25 @@ by fulfilling the provided template.
25
25
If you found something missing in the [docs](https://giulong.github.io/spectrum/#spectrum),
26
26
or you want to contribute with real configuration examples of how you use Spectrum, feel free to open a Pull Request.
27
27
28
-
> ⚠ Minor changes such as fixing typos or rewriting the current docs will not be accepted.
28
+
> ⚠️ Minor changes such as fixing typos or rewriting the current docs will be rejected.
29
29
30
30
# Discussions
31
31
32
-
If you just want to ask something about Spectrum, either to maintainers or to other users, check the
32
+
If you just want to ask something about Spectrum, either to maintainers or other users, check the
to see if there's something on that topic already. If not, feel free to open a new one.
35
35
36
36
# Submitting Changes
37
37
38
-
> ⚠ Purely cosmetic changes, such as just fixing whitespaces or formatting code, will not be accepted.
38
+
> ⚠️ Purely cosmetic changes, such as just fixing whitespaces or formatting code, will not be accepted.
39
39
> Neither refactoring will.
40
40
41
41
If you'd like to actively contribute to Spectrum, whether it's source code or documentation, take these steps:
42
42
43
43
1. First of all, be sure to read the [DEV.md](DEV.md) to be able to build Spectrum and its docs locally
44
44
2.[Fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo)
45
45
3. Checkout a `feature/*`, `bugfix/*`, or `docs/*` branch with a short and meaningful name
46
-
4. Make your changes and be sure you have a successful local build (at least the framework-only build)
46
+
4. Make your changes and be sure you have a successful local build (at least the _framework-only_ build)
47
47
5. Be sure your code complies to the [Coding Conventions](#coding-conventions)
48
48
6. Submit a Pull Request towards `develop`
49
49
@@ -62,9 +62,9 @@ Do's:
62
62
63
63
* be [SOLID](https://en.wikipedia.org/wiki/SOLID)
64
64
* Take a look around: your code should follow the conventions already in place
65
-
* Write small classes and methods, with reusability and evolvability in mind
65
+
* Write small classes and methods, with reusability and maintainability in mind
66
66
* Leverage [convention over configuration](https://en.wikipedia.org/wiki/Convention_over_configuration), providing defaults to reduce the boilerplate code a user would need to explicitly write
67
-
* Explicitly mark variables as final. Mutable variables are not accepted, with very few exceptions
67
+
* Explicitly mark variables as `final`. Mutable variables are not accepted, with very few exceptions
68
68
* Leverage Java 21 api
69
69
* Lines up to 180 chars are ok, with a grain of salt: put methods-chained calls on a new line only if they're many
70
70
* Write few meaningful logs at a proper level
@@ -85,33 +85,34 @@ Don'ts:
85
85
Every line of code must be unit-tested. There's no reason not to do so.
86
86
If you write conditional logic, be sure you test each branch.
87
87
You can leverage the coverage report produced by the build at [docs/jacoco/index.html](docs/jacoco/index.html)
88
-
to see what's missing. Keep in mind that coverage is an important way to check missing branches, not just as an empty number.
88
+
to see what's missing. Keep in mind that coverage _per se_is just an empty number, but it's an important way to check missing branches.
89
89
90
90
Rules:
91
91
92
-
* Each class must:
92
+
* Each test class must:
93
93
* be in the same package of its source counterpart
94
94
* have a name that is made up of the **source** class' name + 'Test', such as `MySourceClass`→`MySourceClassTest`
95
-
* Each method must:
96
-
* be `public void`
95
+
* Each test method must:
96
+
* be package-private
97
97
* have a short and clear `@DisplayName`
98
-
* not contain any conditional logic
99
-
* Strict mocking is required, as per mockito's default
100
-
* Use dummy values as arguments. Suggestion: if you have a method with an argument like `String fileName`, use a variable like `String fileName = "fileName";` in your test
98
+
* contain no conditional logic
99
+
* Strict mocking is required, as per mockito's default, with few exceptions allowed
100
+
* Use dummy values as arguments. Suggestion: if you have a method with an argument like `String fileName`, use a variable with name and value matching,
101
+
like `String fileName = "fileName";`
101
102
* Avoid generic argument matchers such as `any()` when possible. Knowing what we're passing to methods calls matter, even if they're dummy values
102
103
103
104
### Integration Tests
104
105
105
-
Integration tests are not always needed. They are, for example, when implementing a new feature that produce some kind of artifact, such as a report.
106
+
Integration tests are not always needed. They are, for example, when implementing a new feature that produces some kind of artifact, such as a report.
106
107
In that case, we need an integration test that checks that artifact, and provide a way to avoid regressions.
107
108
108
-
Generally speaking, you can write integration tests if you think they're useful, but maybe it's **better asking** before wasting time.
109
+
Generally speaking, you can write integration tests if you think they're useful, but maybe it's **better asking** before wasting your time.
109
110
110
111
Rules:
111
112
112
-
* Each class must:
113
+
* Each test class must:
113
114
* have a name that ends with 'IT', such as `ExtentReportVerifierIT`
0 commit comments