Files
nomad/.semgrep/imports.yml
Piotr Kazmierczak 648bacda77 testing: migrate nomad/scheduler off of testify (#25968)
In the spirit of #25909, this PR removes testify dependencies from the scheduler
package, along with reflect.DeepEqual removal. This is again a combination of
semgrep and hx editing magic.

---------

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2025-06-04 09:29:28 +02:00

33 lines
1.1 KiB
YAML

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
rules:
- id: "disallow-imports"
pattern-either:
- pattern: import "github.com/boltdb/bolt"
- pattern: import "github.com/pkg/errors"
- pattern: import "=~/github.com\/hashicorp\/consul$/"
- pattern: import "github.com/hashicorp/consul/command/flags"
- pattern: import "=~/github.com\/hashicorp\/consul\/sdk$/"
- pattern: import "=~/github.com\/hashicorp\/go-set$/"
- pattern: import "github.com/mitchellh/cli"
- pattern: import "golang.org/x/exp/slices"
- pattern: import "golang.org/x/exp/maps"
- pattern: import "golang.org/x/exp/constraints"
message: "Import of this package has been disallowed"
languages: [go]
severity: "ERROR"
paths:
include:
- "*.go"
- id: "disallow-new-testify-imports"
pattern: import "github.com/stretchr/testify"
message: "Do not import testify in packages where it has been removed"
languages: [go]
severity: "ERROR"
paths:
include:
- "nomad/state/*_test.go"
- "nomad/scheduler/*_test.go"