|
| 1 | +In order for a pull request adding a linter to be reviewed, the linter and the PR must follow some requirements. |
| 2 | + |
| 3 | +- [ ] The CLA must be signed |
| 4 | + |
| 5 | +### Pull Request Description |
| 6 | + |
| 7 | +- [ ] It must have a link to the linter repository. |
| 8 | +- [ ] It must provide a short description of the linter. |
| 9 | + |
| 10 | +### Linter |
| 11 | + |
| 12 | +- [ ] It must not be a duplicate of another linter or a rule of a linter. (the team will help to verify that) |
| 13 | +- [ ] It must have a valid license (AGPL is not allowed) and the file must contain the required information by the license, ex: author, year, etc. |
| 14 | +- [ ] The linter repository must have a CI and tests. |
| 15 | +- [ ] It must use [`go/analysis`](https://golangci-lint.run/contributing/new-linters/). |
| 16 | +- [ ] It must have a valid tag, ex: `v1.0.0`, `v0.1.0`. |
| 17 | +- [ ] It must not contain `init()`. |
| 18 | +- [ ] It must not contain `panic()`. |
| 19 | +- [ ] It must not contain `log.fatal()`, `os.exit()`, or similar. |
| 20 | +- [ ] It must not modify the AST. |
| 21 | +- [ ] It must not have false positives/negatives. (the team will help to verify that) |
| 22 | +- [ ] It must have tests inside golangci-lint. |
| 23 | +- [ ] It must use Go <= 1.21 |
| 24 | + |
| 25 | +### The Linter Tests Inside Golangci-lint |
| 26 | + |
| 27 | +- [ ] They must have at least one std lib import. |
| 28 | +- [ ] They must have integration tests without configuration (default). |
| 29 | +- [ ] They must have integration tests with configuration (if the linter has a configuration). |
| 30 | + |
| 31 | +### `.golangci.next.reference.yml` |
| 32 | + |
| 33 | +- [ ] The file `.golangci.next.reference.yml` must be updated. |
| 34 | +- [ ] The file `.golangci.reference.yml` must NOT be edited. |
| 35 | +- [ ] The linter must be added to the lists of available linters (alphabetical case-insensitive order). |
| 36 | + - `enable` and `disable` options |
| 37 | +- [ ] If the linter has a configuration, the exhaustive configuration of the linter must be added (alphabetical case-insensitive order) |
| 38 | + - The values must be different from the default ones. |
| 39 | + - The default values must be defined in a comment. |
| 40 | + - The option must have a short description. |
| 41 | + |
| 42 | +### Others Requirements |
| 43 | + |
| 44 | +- [ ] The files (tests and linter) inside golangci-lint must have the same name as the linter. |
| 45 | +- [ ] The `.golangci.yml` of golangci-lint itself must not be edited and the linter must not be added to this file. |
| 46 | +- [ ] The linters must be sorted in the alphabetical order (case-insensitive) in the `lintersdb/builder_linter.go` and `.golangci.next.reference.yml`. |
| 47 | +- [ ] The load mode (`WithLoadMode(...)`): |
| 48 | + - if the linter uses `goanalysis.LoadModeSyntax` -> no `WithLoadForGoAnalysis()` in `lintersdb/builder_linter.go` |
| 49 | + - if the linter uses `goanalysis.LoadModeTypesInfo`, it requires `WithLoadForGoAnalysis()` in `lintersdb/builder_linter.go` |
| 50 | +- [ ] The version in `WithSince(...)` must be the next minor version (`v1.X.0`) of golangci-lint. |
| 51 | +- [ ] `WithURL()` must contain the URL of the repository. |
| 52 | + |
| 53 | +### Recommendations |
| 54 | + |
| 55 | +- [ ] The file `jsonschema/golangci.next.jsonschema.json` should be updated. |
| 56 | +- [ ] The file `jsonschema/golangci.jsonschema.json` must NOT be edited. |
| 57 | +- [ ] The linter repository should have a readme and linting. |
| 58 | +- [ ] The linter should be published as a binary. (useful to diagnose bug origins) |
| 59 | +- [ ] The linter repository should have a `.gitignore` (IDE files, binaries, OS files, etc. should not be committed) |
| 60 | +- [ ] A tag should never be recreated. |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +The golangci-lint team will edit this comment to check the boxes before and during the review. |
| 65 | + |
| 66 | +The code review will start after the completion of those checkboxes (except for the specific items that the team will help to verify). |
| 67 | + |
| 68 | +The reviews should be addressed as commits (no squash). |
| 69 | + |
| 70 | +If the author of the PR is a member of the golangci-lint team, he should not edit this message. |
| 71 | + |
| 72 | +**This checklist does not imply that we will accept the linter.** |
0 commit comments