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
The current configruation, where we manually need to specify types is error prone. For example, I copied over an example from our docs where the class collector was missing and that caused the classLike collector to not emit anything. Sending me off to a wild goose chase.
I can think of two options for making this more convenient, with a clear preference for the first one, but feel free to propose alternatives.
Options
Replace current allow list with an ignore list
We change the default configuration to always use all types and replace the configuration with an ignore list, e.g.:
deptrac:
analyser:
ignored_types: ['class']
That way, people are less likely to run into errors, and we explicitly can still disable types we don't need.
Automatically determine required types
We could go through the deptrac.layers configuration and look which collectors are used. Based on the collectors we could then enable the required types.
A downside would be, that this would be a headache for extendability when using custom collectors. In those cases we could either enable all types or add something to the interface. The latter is probably safer, in case someone replaces a default collector with a custom implementation. Obviously, looking at the layers and then checking the used collectors will have some overhead. The good thing is, we could probably do this with the current DI-configuration, e.g. in a CompilerPass, at least as far as I can tell.
The text was updated successfully, but these errors were encountered:
The current configruation, where we manually need to specify types is error prone. For example, I copied over an example from our docs where the
class
collector was missing and that caused theclassLike
collector to not emit anything. Sending me off to a wild goose chase.I can think of two options for making this more convenient, with a clear preference for the first one, but feel free to propose alternatives.
Options
Replace current allow list with an ignore list
We change the default configuration to always use all types and replace the configuration with an ignore list, e.g.:
That way, people are less likely to run into errors, and we explicitly can still disable types we don't need.
Automatically determine required types
We could go through the
deptrac.layers
configuration and look which collectors are used. Based on the collectors we could then enable the required types.A downside would be, that this would be a headache for extendability when using custom collectors. In those cases we could either enable all types or add something to the interface. The latter is probably safer, in case someone replaces a default collector with a custom implementation. Obviously, looking at the layers and then checking the used collectors will have some overhead. The good thing is, we could probably do this with the current DI-configuration, e.g. in a CompilerPass, at least as far as I can tell.
The text was updated successfully, but these errors were encountered: