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 c77e884 commit 4311423
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 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"
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ deps: ## Install build and development dependencies
.PHONY: lint-deps
lint-deps: ## Install linter dependencies
@echo "==> Updating linter dependencies..."
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.0
go install github.com/client9/misspell/cmd/misspell@v0.3.4
go install github.com/hashicorp/go-hclog/hclogvet@v0.1.6

Expand Down

0 comments on commit 4311423

Please sign in to comment.