Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MetadataGeneratorUtil doesn't support custom output folder locations #10748

Open
rnveach opened this issue Aug 28, 2021 · 0 comments
Open

MetadataGeneratorUtil doesn't support custom output folder locations #10748

rnveach opened this issue Aug 28, 2021 · 0 comments
Labels

Comments

@rnveach
Copy link
Member

rnveach commented Aug 28, 2021

MetadataGeneratorUtil doesn't allow any user configuration for where to place the meta files it generates. As such they go to the base src\main\resources folder, and doesn't allow a custom location like checkstyle has at src\main\resources\com\puppycrawl\tools\checkstyle\meta.

In addition, it doesn't allow any configuration to keep XML files separated into different folders like checkstyle has with meta\checks\annotation and meta\checks\blocks as an example.

We should expand this util to be just as configurable as checkstyle allows for itself.

See

if (moduleDetails.getFullQualifiedName().startsWith("com.puppycrawl.tools.checkstyle")) {
final String moduleFilePath = FILEPATH_CONVERSION
.matcher(moduleDetails.getFullQualifiedName())
.replaceAll(fileSeparator);
final String checkstyleString = "checkstyle";
final int indexOfCheckstyle =
moduleFilePath.indexOf(checkstyleString) + checkstyleString.length();
modifiedPath = rootOutputPath + DEFAULT_FILE_SEPARATOR
+ moduleFilePath.substring(0, indexOfCheckstyle) + "/meta/"
+ moduleFilePath.substring(indexOfCheckstyle + 1) + xmlExtension;
}
else {
String moduleName = moduleDetails.getName();
if (moduleDetails.getModuleType() == ModuleType.CHECK) {
moduleName += "Check";
}
modifiedPath = rootOutputPath + "/checkstylemeta-" + moduleName + xmlExtension;
}
as the targeted code which give checkstyle the extra functions others don't get.

The 2nd argument can be used for the output location, just like the first argument is for the input location. We may have to switch MetadataGeneratorUtil to picocli for it to take optional arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants