ImportControl configuration for multiple packages

75 views
Skip to first unread message

Daniel Stephan

unread,
Feb 10, 2016, 7:10:11 AM2/10/16
to checkstyle
Hi all,

it seems to me that it is at the moment not possible to use the same import control configuration for multiple subpackages. Correct me, if I'm wrong... What I need to do is this:

<subpackage pkg="de.main">
   
<subpackage pkg="*">
     
<subpackage pkg="service">
         
<allow...>
     
</subpackage>
   
</subpackage>
</subpackage>

This way, the package control configuration for the service subpackage would match all modules at once, like de.main.mod1.service as well as de.main.mod2.service and so on. If someone creates a mod3 module, then the configuration would still work.

I couldn't get it to work, as wildcards and regex are only valid on allow or disallow elements right now. Is there some other way to do it?

If not, do you think this functionality is easy to add? Should I add a feature request on https://github.com/checkstyle/checkstyle/issues?

Thanks for any help on this, best regards
Daniel

Roman Ivanov

unread,
Feb 18, 2016, 9:12:58 AM2/18/16
to Daniel Stephan, checkstyle
Hi Daniel,

yes, your request do make sense. Please report feature request. If you want to speedup the fix please be welcome with PullRequest.


The only correction is that new attribute need to be created for "subpackage" element - "regex"="true/false". That is required to be consistent with design of "allow" element.

New version, need to be create "1_2" .

thanks,
Roman Ivanov

jens dehnert

unread,
Mar 14, 2016, 9:58:50 AM3/14/16
to checkstyle
Hi Roman,
I have basically the same request. Has one already been created? If not, should it created against checkstyle on the SF feature request page? https://sourceforge.net/p/checkstyle/feature-requests/ ?

Roman Ivanov

unread,
Mar 14, 2016, 4:45:17 PM3/14/16
to jens dehnert, checkstyle
sourceforge tacking is closed.


On 14 March 2016 at 06:58, 'jens dehnert' via checkstyle <check...@googlegroups.com> wrote:
Hi Roman,
I have basically the same request. Has one already been created? If not, should it created against checkstyle on the SF feature request page? https://sourceforge.net/p/checkstyle/feature-requests/ ?

--
You received this message because you are subscribed to the Google Groups "checkstyle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to checkstyle+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages