Add support for the new generate checks and file suppression option

This commit is contained in:
Erik C. Thauvin 2025-05-22 09:28:46 -07:00
parent f063889778
commit def9be96f1
Signed by: erik
GPG key ID: 776702A6A2DA330E
3 changed files with 29 additions and 0 deletions

View file

@ -314,6 +314,25 @@ public class CheckstyleOperation extends AbstractProcessOperation<CheckstyleOper
return this;
}
/**
* Generates to output a suppression xml that will have suppress elements with {@code checks} and {@code files}
* attributes only to use to suppress all violations from user's config. Instead of printing every violation, all
* violations will be catched and single suppressions xml file will be printed out. Used only with the
* {@link #configurationFile(String) configurationFile} option. Output location can be
* specified with the {@link #outputPath(String) output} option.
*
* @param generateChecksAndFileSuppression {@code true} or {@code false}
* @return the checkstyle operation
*/
public CheckstyleOperation generateChecksAndFileSuppression(boolean generateChecksAndFileSuppression) {
if (generateChecksAndFileSuppression) {
options_.put("-G", "");
} else {
options_.remove("-G");
}
return this;
}
/**
* Generates to output a suppression xml to use to suppress all violations from user's config. Instead of printing
* every violation, all violations will be caught and single suppressions xml file will be printed out.