Skip to content

Commit

Permalink
Check wrong usage or errors pkgs via depguard
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer committed Jul 27, 2023
1 parent 3445032 commit baefdef
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 18 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: GolangCIlint

on: pull_request

jobs:
golangci-lint:
name: GolangCI-Lint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
version: v1.53.3
github_token: ${{ secrets.GITHUB_TOKEN }}
golangci_lint_flags: "--timeout=10m"
reporter: github-pr-check
filter_mode: nofilter
fail_on_error: true
18 changes: 0 additions & 18 deletions .github/workflows/main.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ linters-settings:
block-size: 2
stylecheck:
initialisms: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"]
depguard:
rules:
main:
# exclude the ierrors.go file itself
files:
- "!**/ierrors.go"
deny:
- pkg: "errors"
desc: Should be replaced with "github.com/iotaledger/hive.go/ierrors" package
- pkg: "golang.org/x/xerrors"
desc: Should be replaced with "github.com/iotaledger/hive.go/ierrors" package
- pkg: "github.com/pkg/errors"
desc: Should be replaced with "github.com/iotaledger/hive.go/ierrors" package

linters:
# Disable all linters.
Expand Down

0 comments on commit baefdef

Please sign in to comment.