You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(config): rename domains to prefixes and deprecate domains
- Introduce 'prefixes' to replace 'domains' configuration key
- Maintain backwards compatibility by parsing 'domains' but log a deprecation warning
- Update IsAllowedModuleDomain check to IsAllowedModulePrefix and merge arrays for backward compatibility
- Update README, examples, and tests to use 'prefixes'
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,9 @@ Allow and block list linter for direct Go module dependencies. This is useful fo
14
14
15
15
Allowed and blocked modules are defined in a `./.gomodguard.yaml` or `~/.gomodguard.yaml` file.
16
16
17
-
Modules can be allowed by module or domain name. When allowed modules are specified any modules not in the allowed configuration are blocked.
17
+
Modules can be allowed by module or prefix name. When allowed modules are specified any modules not in the allowed configuration are blocked.
18
18
19
-
If no allowed modules or domains are specified then all modules are allowed except for blocked ones.
19
+
If no allowed modules or module prefixes are specified then all modules are allowed except for blocked ones.
20
20
21
21
The linter looks for blocked modules in `go.mod` and searches for imported packages where the imported packages module is blocked. Indirect modules are not considered.
22
22
@@ -41,8 +41,11 @@ allowed:
41
41
- github.com/go-xmlfmt/xmlfmt
42
42
- github.com/phayes/checkstyle
43
43
- github.com/mitchellh/go-homedir
44
-
domains: # List of allowed module domains
45
-
- golang.org
44
+
- github.com/confluentinc/confluent-kafka-go/v2 # Allow v2 only
45
+
prefixes: # List of allowed module prefixes (Replaced domains which is now deprecated)
46
+
- golang.org # Allow all golang.org modules
47
+
- github.com/kubernetes # Allow all Kubernetes modules
48
+
- github.com/apache/arrow-go # Allow all Apache Arrow module major versions
0 commit comments