Class PackageLint
java.lang.Object
network.ike.docs.plugin.packages.PackageLint
The ownership lint of the packages layout (
dev-adoc-packages,
IKE-Network/ike-issues#1341), the check that makes the layout a
guarantee and not a habit. It fails the build with every finding listed:
- the root holds nothing but dotted-group directories and
META-INF: a file at the root, animagesdirectory at the root, or a directory that is not a group is a finding; - every package begins with the module's own group, unless
ike.adoc.packagesdeclares another prefix on purpose; - a topic's directory equals the domain prefix of its
:topic-id:, so that a person who knows a topic's id and its owner can write its include line without looking; - images are inside packages: an
imagesdirectory directly under a group that is not itself a package is a finding.
An include or image line that still uses the {topics} alias
is reported as a warning naming the file and line, so the alias can be
retired once the last one is gone; it does not fail the build.
- Since:
- 136
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
-
Field Details
-
ATTRIBUTE
-
ALIAS
-
-
Method Details
-
lint
public static PackageLint.Report lint(Path root, String groupId, List<String> declared) throws IOException Lint a root.- Parameters:
root- the AsciiDoc rootgroupId- the module's group id, which every package begins withdeclared- package names or group prefixesike.adoc.packagesdeclares on purpose; a package passes the ownership rule when it equals one or begins with one followed by/or.- Returns:
- the report
- Throws:
IOException- if the tree cannot be read
-
owned
Whether a package passes the ownership rule.- Parameters:
name- the package namegroupId- the module's group iddeclared- the prefixesike.adoc.packagesdeclares- Returns:
- true when the package begins with the group or a declared prefix
-