-
Notifications
You must be signed in to change notification settings - Fork 9
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
Showing
10 changed files
with
124 additions
and
74 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 |
---|---|---|
|
@@ -10,26 +10,17 @@ on: | |
- main | ||
|
||
jobs: | ||
linting: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21 | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Installing golangci-lint | ||
run: go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
|
||
- name: Installing gofumpt | ||
run: go install mvdan.cc/gofumpt@latest | ||
|
||
- name: Installing goimports | ||
run: go install golang.org/x/tools/cmd/goimports@latest | ||
|
||
- name: Formatting and linting the project | ||
run: make check | ||
go-version: '1.21' | ||
cache: false | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.54 | ||
|
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 @@ | ||
linters: | ||
enable: | ||
- errcheck | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- unused | ||
- gocognit | ||
- godox | ||
- gocritic | ||
- gci | ||
- containedctx | ||
- contextcheck | ||
- exhaustive | ||
- wastedassign | ||
- nonamedreturns | ||
- ireturn | ||
- gofumpt | ||
- tagalign | ||
- errname | ||
- errorlint | ||
|
||
|
||
linters-settings: | ||
gosimple: | ||
checks: ["all"] | ||
|
||
govet: | ||
enable-all: true | ||
disable: fieldalignment | ||
shadow: | ||
strict: true | ||
|
||
godox: | ||
severity: warning | ||
|
||
predeclared: | ||
# Comma-separated list of predeclared identifiers to not report on. | ||
# Default: "" | ||
ignore: "len" | ||
# Include method names and field names (i.e., qualified names) in checks. | ||
# Default: false | ||
q: true | ||
|
||
tagliatelle: | ||
# Check the struct tag name case. | ||
case: | ||
use-field-name: false | ||
rules: | ||
json: snake | ||
yaml: snake | ||
|
||
issues: | ||
exclude-rules: | ||
# disable funlen for all _test.go files | ||
- path: _test.go | ||
linters: | ||
- funlen | ||
|
||
- linters: | ||
- govet | ||
text: "shadow: declaration of \"err\" shadows" | ||
|
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,42 +1,34 @@ | ||
### Testing | ||
unit_test: | ||
go test ./... | ||
go test $(PACKAGES) | ||
|
||
test: | ||
go test ./... -covermode=atomic | ||
|
||
race_test: | ||
go test ./... --race | ||
|
||
fmt: | ||
gofumpt -l -w . | ||
|
||
install-tools: | ||
### dev tools | ||
devtools: | ||
@echo "Installing devtools" | ||
go install golang.org/x/tools/cmd/goimports@latest | ||
go install mvdan.cc/gofumpt@latest | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
|
||
install-packages: | ||
packages: | ||
go mod tidy | ||
|
||
|
||
### Formatting, linting, and vetting | ||
fmt: | ||
gofumpt -l -w . | ||
go mod tidy | ||
godot -w . | ||
|
||
check: | ||
golangci-lint run \ | ||
--build-tags "${BUILD_TAG}" \ | ||
--timeout=20m0s \ | ||
--enable=gofmt \ | ||
--enable=unconvert \ | ||
--enable=unparam \ | ||
--enable=asciicheck \ | ||
--enable=misspell \ | ||
--enable=revive \ | ||
--enable=decorder \ | ||
--enable=reassign \ | ||
--enable=usestdlibvars \ | ||
--enable=nilerr \ | ||
--enable=gosec \ | ||
--enable=exportloopref \ | ||
--enable=whitespace \ | ||
--enable=goimports \ | ||
--enable=gocyclo \ | ||
--enable=lll | ||
|
||
|
||
build-bot: | ||
go build -o build/main cmd/app.go | ||
golangci-lint run --build-tags "${BUILD_TAG}" --timeout=20m0s | ||
|
||
### building | ||
build: | ||
go build -o build/main cmd/app.go | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
package main | ||
|
||
import ( | ||
"pactus-bot/client" | ||
|
||
"github.com/kehiy/RoboPac/client" | ||
"github.com/yudai/pp" | ||
) | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module pactus-bot | ||
module github.com/kehiy/RoboPac | ||
|
||
go 1.21 | ||
|
||
|
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