package
module
Version:
v0.2.3
Opens a new window with list of versions in this module.
Published: Jan 29, 2023
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
README
¶
delivery-club-rules
Delivery club go rules linter
How to use:
Full installation example: https://github.com/peakle/dc-rules-example
- Install rules:
go get -v github.com/delivery-club/delivery-club-rules
- Create rules.go file in your project like
in example
- Add linter to your pipeline:
-
Like another one check in golangci-lint (will work for golangci-lint >v1.46.0):
linters:
enable:
- gocritic
linters-settings:
gocritic:
enabled-checks:
- ruleguard
settings:
ruleguard:
rules: "YourDir/rules.go"
-
Like explicit check WITHOUT golangci-lint:
- install binary by
curl
or go install
:
curl -sSfL https://raw.githubusercontent.com/delivery-club/delivery-club-rules/master/releaser/install.sh | sh -s -- -d -b $(go env GOPATH)/bin latest
OR
go install -v github.com/delivery-club/delivery-club-rules/cmd/dcRules@latest
- Run lint:
dcRules ./...
-
Like file watcher in Goland IDE (will work for golangci-lint >v1.46.0):
- add golangci-lint as
File Watcher
in IDE (Preferences -> Tools -> File Watchers -> Add)
- set
Arguments
field where .golangci.yml
file will be like example above:
run $FileDir$ --config=$ProjectFileDir$/.golangci.yml
How to update to new rules version:
- update rules version in your go.mod file
- download new rules version:
go get github.com/delivery-club/delivery-club-rules@newVersion
- if you using golangci-lint update cache:
golangci-lint cache clean
How to add new checks:
- Ruleguard tour for newbees: https://go-ruleguard.github.io/by-example
- Fork repo && open PR :D
Documentation
¶
Source Files
¶
Directories
¶
cmd
|
|
|
|
|
|
|
|
precompile
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.