-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59de2b9
commit 331c2ba
Showing
11 changed files
with
324 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
run: | ||
timeout: 5m | ||
|
||
issues: | ||
exclude-dirs: | ||
- lab | ||
|
||
linters-settings: | ||
gofmt: | ||
rewrite-rules: | ||
- pattern: 'interface{}' | ||
replacement: 'any' | ||
- pattern: 'a[b:len(a)]' | ||
replacement: 'a[b:]' | ||
revive: # this is recommended config from [here](https://github.com/mgechev/revive#configuration) | ||
rules: | ||
- name: blank-imports | ||
- name: context-as-argument | ||
- name: context-keys-type | ||
- name: dot-imports | ||
- name: error-return | ||
- name: error-strings | ||
- name: error-naming | ||
- name: exported | ||
- name: increment-decrement | ||
- name: var-naming | ||
arguments: | ||
- ["ID","HTTP","HTTPS","SQL","API","URL","URI"] # whitelist | ||
- [] # blacklist | ||
- name: var-declaration | ||
- name: package-comments | ||
- name: range | ||
- name: receiver-naming | ||
- name: time-naming | ||
- name: unexported-return | ||
- name: indent-error-flow | ||
- name: errorf | ||
- name: empty-block | ||
- name: superfluous-else | ||
- name: unused-parameter | ||
- name: unreachable-code | ||
- name: redefines-builtin-id | ||
govet: | ||
enable-all: true | ||
disable: | ||
- fieldalignment | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- unused | ||
- gofmt | ||
- revive | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- exportloopref | ||
- staticcheck | ||
- unconvert | ||
- unused | ||
- misspell | ||
- goimports | ||
- errcheck | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,21 @@ | ||
Snip helps you manage snippets in cmd. | ||
|
||
|
||
### Some commands | ||
```bash | ||
# Run tests | ||
go test ./... | ||
|
||
# Test coverage | ||
go test -coverprofile cover.out ./... | ||
go tool cover -html cover.out # view as html | ||
go tool cover -func cover.out # output coverage per functions | ||
|
||
# Run linters | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
golangci-lint run ./... | ||
|
||
# build | ||
go build -o snip . | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.