Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#582 new check: ForbidsCertainImports

Future
closed
nobody
Check (274)
5
2013-11-17
2011-09-23
Roman Ivanov
No

Forbids usage Certain Imports usage in class.
idea was taken from similar check in Sonar project.

Parameters:
- Package name. (type=regexp)
- Forbidden package name in imports. (type=regexp)

Example of usage:
Forbid to use ".log4j." classes/packages in imports in all ("") packages
Forbid to use "
.ui." packages in ".dao.*" packages

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

Discussion

  • Oliver Burn
    Oliver Burn
    2012-02-29

    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.

     
  • Roman Ivanov
    Roman Ivanov
    2012-04-20

    Released at 1.0.5, http://sevntu-checkstyle.github.com/sevntu.checkstyle/.
    Oliver, yes ImportControl looks the same, we just missed it, may be it was not that obvious how to use .... Thanks for pointing
    I will try to use it, and put here results of my functional compare.

     
  • Ivan Sopov
    Ivan Sopov
    2013-11-17

    • status: open --> closed
    • Group: --> Future