Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
ImportControl: blacklist mode #3451
base on #3358
We need to think about this....... there might be some problems with priority of rule apply.
referenced this issue
Sep 19, 2016
While issues are not resolved, you can take a look at http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/ForbidCertainImportsCheck.html it should do what is needed.
@timurt , please help us with this issue.
@romani Ok, first of all let me describe behaviour shortly:
I have found one way we can do this, but I am not sure is it logically correct
The main disadvantage of such implementation is 'allow everything' rule will be used by all subpackages of this parent. Here is example
What if we want
What I suggest, as I mentioned before there is rule 'What is not allowed explicitly - is disallowed by default.'. What if we add new property for
In this example we can see if we could not find suitable allow/disallow inside
confirmed, good summary, please do PR right now to update xdoc to explain users how it works now.
You solution is completely correct, please add new subsection to xdoc "Example of blacklist mode" and show user example.
It completely ok, user is responsible for config he is creating. If he decided to go "black list" mode, and define only disallowed imports. He should not expect that mix of modes will work. Config is either "black list " (allow all at root, disallow certain) or it is "white list" (allow certain).
I like your idea ..... with minor correction.
Rationale of your request is to "allow independent rules for subpackages". It will allow define completely isolated rules for special packages, for example:
This extension is not related to blacklist mode, so please make summary from my and your post and create new issue.
This issue should should address only backlist mode.