Skip to content

ImportControl: allow regex in subpackage elements. #2999

@effjay

Description

@effjay

Hi all,

at the moment it is not possible to use the same import control configuration for multiple subpackages.

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.

For this, a new attribute might need to be created for the "subpackage" element: "regex"="true/false". That is required to be consistent with the design of the "allow" element.

This will mean that http://www.puppycrawl.com/dtds/import_control_1_1.dtd must be changed to version 1.2 as well.

Thanks for any help on this, best regards
Daniel

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions