aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/OpenPeeDeeP/depguard/v2/README.md
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2024-03-04 17:40:11 +0000
committerTaras Madan <tarasmadan@google.com>2024-03-04 18:34:55 +0000
commit5fc5366972c874b919f93165bb4ed4e2bcb7c350 (patch)
tree287c3361a0dee0c72af80d9a1a66714a06e98a62 /vendor/github.com/OpenPeeDeeP/depguard/v2/README.md
parent1be5ce38a9059c356eb193a8c34d60d61c9fc31f (diff)
mod: bump github.com/golangci/golangci-lint from 1.55.2 to 1.56.2
Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.55.2 to 1.56.2. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md) - [Commits](https://github.com/golangci/golangci-lint/compare/v1.55.2...v1.56.2) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Diffstat (limited to 'vendor/github.com/OpenPeeDeeP/depguard/v2/README.md')
-rw-r--r--vendor/github.com/OpenPeeDeeP/depguard/v2/README.md25
1 files changed, 21 insertions, 4 deletions
diff --git a/vendor/github.com/OpenPeeDeeP/depguard/v2/README.md b/vendor/github.com/OpenPeeDeeP/depguard/v2/README.md
index 3de3f6317..2ccfa22c5 100644
--- a/vendor/github.com/OpenPeeDeeP/depguard/v2/README.md
+++ b/vendor/github.com/OpenPeeDeeP/depguard/v2/README.md
@@ -7,13 +7,12 @@ allow specific packages within a repository.
## Install
```bash
-go get github.com/OpenPeeDeeP/depguard/v2
+go install github.com/OpenPeeDeeP/depguard@latest
```
## Config
-The Depguard binary looks for a file named `^\.?depguard\.(yaml|yml|json|toml)$` in the current
-current working directory. Examples include (`.depguard.yml` or `depguard.toml`).
+The Depguard binary looks for a file named `^\.?depguard\.(yaml|yml|json|toml)$` in the current working directory. Examples include (`.depguard.yml` or `depguard.toml`).
The following is an example configuration file.
@@ -24,6 +23,7 @@ The following is an example configuration file.
"$all",
"!$test"
],
+ "listMode": "Strict",
"allow": [
"$gostd",
"github.com/OpenPeeDeeP"
@@ -36,6 +36,7 @@ The following is an example configuration file.
"files": [
"$test"
],
+ "listMode": "Lax",
"deny": {
"github.com/stretchr/testify": "Please use standard library for tests"
}
@@ -48,6 +49,7 @@ the linter's output.
- `files` - list of file globs that will match this list of settings to compare against
- `allow` - list of allowed packages
- `deny` - map of packages that are not allowed where the value is a suggestion
+= `listMode` - the mode to use for package matching
Files are matched using [Globs](https://github.com/gobwas/glob). If the files
list is empty, then all files will match that list. Prefixing a file
@@ -67,6 +69,21 @@ A Prefix List just means that a package will match a value, if the value is a
prefix of the package. Example `github.com/OpenPeeDeeP/depguard` package will match
a value of `github.com/OpenPeeDeeP` but won't match `github.com/OpenPeeDeeP/depguard/v2`.
+ListMode is used to determine the package matching priority. There are three
+different modes; Original, Strict, and Lax.
+
+Original is the original way that the package was written to use. It is not recommended
+to stay with this and is only here for backwards compatibility.
+
+Strict, at its roots, is everything is denied unless in allowed.
+
+Lax, at its roots, is everything is allowed unless it is denied.
+
+There are cases where a package can be matched in both the allow and denied lists.
+You may allow a subpackage but deny the root or vice versa. The `settings_tests.go` file
+has many scenarios listed out under `TestListImportAllowed`. These tests will stay
+up to date as features are added.
+
### Variables
There are variable replacements for each type of list (file or package). This is
@@ -74,7 +91,7 @@ to reduce repetition and tedious behaviors.
#### File Variables
-> you can still use and exclamation mark `!` in front of a variable to say not to
+> you can still use an exclamation mark `!` in front of a variable to say not to
use it. Example `!$test` will match any file that is not a go test file.
- `$all` - matches all go files