Lintroller houses all of the custom linters that Outreach uses for Go projects.
Please read the CONTRIBUTING.md document for guidelines on developing and contributing changes.
lintroller is a collection of linting rules for go projects, implemented as
Analyzers
run through
unitchecker.
This makes lintroller compatible with go vet, the recommended way to run lintroller.
When lintroller is run with -config, configuration is read from the
lintroller YAML key.
lintroller.exclusions.paths accepts regex patterns for excluding files and
packages by path.
lintroller:
exclusions:
paths:
- '(^|/)node_modules(/|$)'copyright- Checks that files start with a header that matches a regular expression.doculint- Checks that packages and various top-level items in the package have well-formed comments.header- Checks that source code files have structured headers.todo- Checks that TODO comments:- Start the comment line.
- Have one or more of a github username in parenthesis (
(username)) or a Jira ticket ([ticket-123]), in that order, immediately after the TODO text. - Have a colon and space after the username or ticket.
why- Checks thatnolintcomments:- Have specific rule(s) they are ignoring (are followed by a colon then one or more comma-separated rules to ignore).
- Are followed by
// Why: <explanation>on the same line.