4
4
5
5
The Go linter ` paralleltest ` checks that the t.Parallel gets called for the test method and for the range of test cases within the test.
6
6
7
+ ## Installation
8
+
9
+ ``` sh
10
+ go install github.com/kunwardeep/paralleltest@latest
11
+ ```
12
+
7
13
## Usage
8
14
9
15
``` sh
@@ -16,6 +22,57 @@ A few options can be activated by flag:
16
22
* ` -ignoremissingsubtests ` : Require that top-level tests specify ` t.Parallel ` , but don't require it in subtests (` t.Run(...) ` ).
17
23
* ` -ignoreloopVar ` : Ignore loop variable detection.
18
24
25
+ ## Development
26
+
27
+ ### Prerequisites
28
+
29
+ - Go 1.23.0 or later
30
+ - Make
31
+
32
+ ### Local Development
33
+
34
+ 1 . Clone the repository:
35
+ ``` sh
36
+ git clone https://github.com/kunwardeep/paralleltest.git
37
+ cd paralleltest
38
+ ```
39
+
40
+ 2 . Install development tools:
41
+ ``` sh
42
+ make install_devtools
43
+ ```
44
+
45
+ 3 . Install dependencies:
46
+ ``` sh
47
+ make ensure_deps
48
+ ```
49
+
50
+ 4 . Run tests:
51
+ ``` sh
52
+ make test
53
+ ```
54
+
55
+ 5 . Run linter:
56
+ ``` sh
57
+ make lint
58
+ ```
59
+
60
+ To fix linting issues automatically:
61
+ ``` sh
62
+ make lint_fix
63
+ ```
64
+
65
+ ### CI/CD
66
+
67
+ The project uses GitHub Actions for continuous integration. The workflow includes:
68
+
69
+ - Running tests with race condition detection
70
+ - Running golangci-lint for code quality checks
71
+
72
+ The workflow runs on:
73
+ - Pull requests
74
+ - Pushes to the main branch
75
+
19
76
## Examples
20
77
21
78
### Missing ` t.Parallel() ` in the test method
@@ -100,7 +157,6 @@ func TestFunctionRangeNotUsingRangeValueInTDotRun(t *testing.T) {
100
157
}{{name: " foo" }}
101
158
for _ , tc := range testCases {
102
159
t.Run (tc.name , func (t *testing.T ) {
103
- // ^ call to tc.name
104
160
t.Parallel ()
105
161
fmt.Println (tc.name )
106
162
})
@@ -146,3 +202,15 @@ func TestFunctionRangeNotReInitialisingVariable(t *testing.T) {
146
202
// Error displayed
147
203
// Range statement for test TestFunctionRangeNotReInitialisingVariable does not reinitialise the variable tc
148
204
```
205
+
206
+ ## Contributing
207
+
208
+ 1 . Fork the repository
209
+ 2 . Create your feature branch (` git checkout -b feature/amazing-feature ` )
210
+ 3 . Commit your changes (` git commit -m 'Add some amazing feature' ` )
211
+ 4 . Push to the branch (` git push origin feature/amazing-feature ` )
212
+ 5 . Open a Pull Request
213
+
214
+ ## License
215
+
216
+ This project is licensed under the MIT License - see the [ LICENSE] ( LICENSE ) file for details.
0 commit comments