How could I blacklist a Type from a namespace? #74
-
I have the following configuration: <!DOCTYPE NsDepCopConfig SYSTEM
"https://raw.githubusercontent.com/realvizu/NsDepCop/master/source/NsDepCop.ConfigSchema/NsDepCopConfig.xsd">
<NsDepCopConfig IsEnabled="true" ChildCanDependOnParentImplicitly="true" InfoImportance="High"
ExcludedFiles="*.Designer.cs" CodeIssueKind="Error">
<Allowed From="*" To="*"/>
<VisibleMembers OfNamespace="Xunit">
<Type Name="IAsyncLifetime"/>
<Type Name="CollectionAttribute"/>
<Type Name="ICollectionFixture`1"/>
<Type Name="FactAttribute"/>
<Type Name="TheoryAttribute"/>
<Type Name="ClassDataAttribute"/>
<Type Name="CollectionDefinitionAttribute"/>
</VisibleMembers>
</NsDepCopConfig> The purpose is just to prevent developers using the Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sounds like a perfectly legit use case, but unfortunately it's not supported right now. Let me create an issue from this discussion an lets see if someone would like to implement it. |
Beta Was this translation helpful? Give feedback.
Sounds like a perfectly legit use case, but unfortunately it's not supported right now.
This tool was first built with only allowlisting in mind, and denylisting was an afterthought without considering VisibleMembers (or rather something like ForbiddenMembers).
Let me create an issue from this discussion an lets see if someone would like to implement it.