[ checkstyle-Patches-3515915 ] New check: ForbidsCertainImportsCheck

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[ checkstyle-Patches-3515915 ] New check: ForbidsCertainImportsCheck

Patches item #3515915, was opened at 2012-04-08 11:09
Message generated for change (Comment added) made by oburn
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Pending
Resolution: None
Priority: 5
Private: No
Submitted By: Daniil Yaroslavtsev (daniilyar)
Assigned to: Nobody/Anonymous (nobody)
Summary: New check: ForbidsCertainImportsCheck

Initial Comment:
This check forbids certain imports usage in class. Idea was taken from the similar check in Sonar project.


Package regexp;
Forbidden imports regexp.
Check operates with packages/imports text in string representation without "package"/"import" words and semicolons. You can be sure to write any regular expressions for package/imports text filtering.

Example of usage: Forbid to use "*.ui.*" packages in "*.dao.*" packages:

Package name regexp = ".+.ui..+"
Forbidden imports regexp = ".+.dao..+"

By means of few instances of this check will be possible to check any number of rules.

Made in accordance with this issue:


>Comment By: Oliver Burn (oburn)
Date: 2012-04-16 03:48

Does the ImportControl check
(http://checkstyle.sourceforge.net/config_imports.html#ImportControl) not
already meet these requirements?

If not, please give a concrete example of where it does not.


You can respond by visiting:

For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
Checkstyle-devel mailing list
[hidden email]