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
It would be nice to have a way to allow/deny indirect/transitive imports.
For example, let's say a have a package a imported by package b. Then I have package c that imports package b. And I have a rule that denies c to import a. Currently, the linter passes. I think there should be an option to fail in that case.
The text was updated successfully, but these errors were encountered:
I am not sure on the best way to do that for this linter without significantly slowing this down. It looks at source files and reads the import statements from the AST. Though https://github.com/ryancurrah/gomodguard states it only works on direct dependencies as well. But given the go.sum file, it may be a better feature over there?
One (maybe stupid) option is to run go list -json ./... and parse the output, including Deps field. It also may be done only if at least one rule opted-in for the transitive check.
It would be nice to have a way to allow/deny indirect/transitive imports.
For example, let's say a have a package
a
imported by packageb
. Then I have packagec
that imports packageb
. And I have a rule that deniesc
to importa
. Currently, the linter passes. I think there should be an option to fail in that case.The text was updated successfully, but these errors were encountered: