mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
Add linter checks to GHA & Fix code to pass lints
Add linter checks to GHA & Fix code to pass lints. The linters added are: - whitespace: Tool for detection of leading and trailing whitespace - gosec: Inspects source code for security problems - gci: Gci control golang package import order and make it always deterministic - misspell: Finds commonly misspelled English words in comments - gomnd: An analyzer to detect magic numbers The file utils/utils.go is excluded from the checks of gomnd, as uses magic numbers through the code
This commit is contained in:
@@ -12,3 +12,10 @@ POSTGRES_PASS=yourpasswordhere; sudo docker run --rm --name hermez-db-test -p 54
|
||||
```
|
||||
POSTGRES_PASS=yourpasswordhere go test ./...
|
||||
```
|
||||
|
||||
## Lint
|
||||
- Install [golangci-lint](https://golangci-lint.run)
|
||||
- Once installed, to check the lints
|
||||
```
|
||||
golangci-lint run --timeout=5m -E whitespace -E gosec -E gci -E misspell -E gomnd --max-same-issues 0
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user