forked from checkstyle/checkstyle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue checkstyle#2999: allow regex in subpackage and importcontrol el…
…ement
- Loading branch information
1 parent
4c5092c
commit 2c1f01d
Showing
14 changed files
with
430 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
src/main/resources/com/puppycrawl/tools/checkstyle/checks/imports/import_control_1_2.dtd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- Add the following to any file that is to be validated against this DTD: | ||
<!DOCTYPE module PUBLIC | ||
"-//Puppy Crawl//DTD Import Control 1.2//EN" | ||
"http://checkstyle.sourceforge.net/dtds/import_control_1_2.dtd"> | ||
--> | ||
|
||
<!-- | ||
The root element of the configuration file. | ||
--> | ||
<!ELEMENT import-control ((allow|disallow)*,subpackage*)> | ||
|
||
<!-- | ||
pkg - The root package to be checked. For example "com.puppycrawl". | ||
--> | ||
<!ATTLIST import-control | ||
pkg CDATA #REQUIRED | ||
regex (true) #IMPLIED> | ||
|
||
<!-- | ||
Represents a subpackage of the parent element. | ||
--> | ||
<!ELEMENT subpackage ((allow|disallow)*,subpackage*)> | ||
|
||
<!-- | ||
name - The name of the subpackage. For example if the name is "tools" | ||
and the pa the parent is "com.puppycrawl", then it corresponds to the | ||
package "com.puppycrawl.tools". If the regex attribute is "true" the | ||
name is interpreted as a regular expression. | ||
--> | ||
<!ATTLIST subpackage | ||
name CDATA #REQUIRED | ||
regex (true) #IMPLIED> | ||
|
||
<!-- | ||
Represents attributes for a guard which can either allow or disallow | ||
access. | ||
pkg - The fully qualified name of the package to guard. Cannot be | ||
specified in conjunction with "class". | ||
class - The fully qualified name of the class to guard. Cannot be | ||
specified in conjunction with "pkg". | ||
exact-match - Only valid with "pkg". Specifies whether the package | ||
name matching should be exact. For example, the pkg | ||
"com.puppycrawl.tools" will match the import | ||
"com.puppycrawl.tools.checkstyle.api.*" when the option is not set, | ||
but will not match is the option is set. | ||
local-only - Indicates that the guard is to apply only to the current | ||
package and not to subpackages. | ||
regex - Indicates that the class or package name has to be interpreted as | ||
regular expression. | ||
--> | ||
<!ENTITY % attlist.guard " | ||
pkg CDATA #IMPLIED | ||
exact-match (true) #IMPLIED | ||
class CDATA #IMPLIED | ||
local-only (true) #IMPLIED | ||
regex (true) #IMPLIED"> | ||
|
||
<!-- | ||
Represents a guard that will allow access. | ||
--> | ||
<!ELEMENT allow EMPTY> | ||
<!ATTLIST allow | ||
%attlist.guard;> | ||
|
||
<!-- | ||
Represents a guard that will disallow access. | ||
--> | ||
<!ELEMENT disallow EMPTY> | ||
<!ATTLIST disallow | ||
%attlist.guard;> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.