Skip to content

Commit

Permalink
build: swap depguard for semgrep
Browse files Browse the repository at this point in the history
  • Loading branch information
shoenig committed Aug 9, 2023
1 parent bf9d2f3 commit b826e71
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
8 changes: 0 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ linters-settings:
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
depguard:
# disallow packages from being used
list-type: blacklist
packages:
- github.com/boltdb/bolt
- github.com/hashicorp/consul/command/flags
- github.com/pkg/errors
gocritic:
disabled-checks:
- commentFormatting
Expand All @@ -92,7 +85,6 @@ linters:
- unconvert
- gofmt
- gosimple
- depguard
- staticcheck
- asasalint
- asciicheck
Expand Down
18 changes: 18 additions & 0 deletions .semgrep/imports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

rules:
- id: "disallow-imports"
patterns:
- pattern: '"github.com/boltdb/bolt"'
- pattern: '"github.com/pkg/errors"'
- pattern: '"github.com/hashicorp/consul"'
- pattern: '"github.com/hashicorp/consul/command/flags"'
- pattern: '"github.com/hashicorp/consul/sdk"'
message: "Import of this package has been disallowed"
languages:
- "generic"
severity: "ERROR"
paths:
include:
- "*.go"

0 comments on commit b826e71

Please sign in to comment.