Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tkxkd0159 committed Jun 25, 2024
1 parent 9c8ef50 commit 227e8f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: golangci/golangci-lint-action@v6
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.51
version: v1.59
args: --timeout 10m
github-token: ${{ secrets.GITHUB_TOKEN }}
if: env.GIT_DIFF
13 changes: 3 additions & 10 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- errcheck
- goconst
Expand All @@ -23,14 +21,15 @@ linters:
- prealloc
- exportloopref
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unused
- varcheck

issues:
exclude-dirs: # following upstream rules
- x/wasm
- app
exclude-rules:
- text: "Use of weak random number generator"
linters:
Expand All @@ -46,12 +45,6 @@ linters-settings:
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: true
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0
prealloc:
# XXX: we don't recommend using this linter before doing performance profiling.
# For most programs usage of prealloc will be a premature optimization.
Expand Down
18 changes: 9 additions & 9 deletions cmd/contract_tests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ func main() {
// This must be compiled beforehand and given to dredd as parameter, in the meantime the server should be running
h := hooks.NewHooks()
server := hooks.NewServer(hooks.NewHooksRunner(h))
h.BeforeAll(func(t []*transaction.Transaction) {
h.BeforeAll(func(_ []*transaction.Transaction) {
fmt.Println("Sleep 5 seconds before all modification")
})
h.BeforeEach(func(t *transaction.Transaction) {
h.BeforeEach(func(_ *transaction.Transaction) {
fmt.Println("before each modification")
})
h.Before("/version > GET", func(t *transaction.Transaction) {
h.Before("/version > GET", func(_ *transaction.Transaction) {
fmt.Println("before version TEST")
})
h.Before("/node_version > GET", func(t *transaction.Transaction) {
h.Before("/node_version > GET", func(_ *transaction.Transaction) {
fmt.Println("before node_version TEST")
})
h.BeforeEachValidation(func(t *transaction.Transaction) {
h.BeforeEachValidation(func(_ *transaction.Transaction) {
fmt.Println("before each validation modification")
})
h.BeforeValidation("/node_version > GET", func(t *transaction.Transaction) {
h.BeforeValidation("/node_version > GET", func(_ *transaction.Transaction) {
fmt.Println("before validation node_version TEST")
})
h.After("/node_version > GET", func(t *transaction.Transaction) {
h.After("/node_version > GET", func(_ *transaction.Transaction) {
fmt.Println("after node_version TEST")
})
h.AfterEach(func(t *transaction.Transaction) {
h.AfterEach(func(_ *transaction.Transaction) {
fmt.Println("after each modification")
})
h.AfterAll(func(t []*transaction.Transaction) {
h.AfterAll(func(_ []*transaction.Transaction) {
fmt.Println("after all modification")
})
server.Serve()
Expand Down

0 comments on commit 227e8f8

Please sign in to comment.