Package com.puppycrawl.tools.checkstyle
Class Main.CliOptions
java.lang.Object
com.puppycrawl.tools.checkstyle.Main.CliOptions
- Enclosing class:
Main
Command line options.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
Name for the moduleConfig attribute 'tabWidth'.private static final int
The checker threads number.private String
Config file location.private boolean
Option that controls whether to print debug info.private static final Main.OutputFormat
Default output format.private static final int
The default number of threads to use for checker and the tree walker.Option that allows users to specify a list of paths to exclude.Option that allows users to specify a regex of paths to exclude.private boolean
Switch whether to execute ignored modules or not.List of file to validate.private Main.OutputFormat
Output format.private boolean
Switch whether to generate suppressions file or not.private static final int
Width of CLI help option.private static final String
Option name for output format.private Path
Output file location.private boolean
Option that controls whether to print the AST of the file.private boolean
Option that controls whether to print the AST of the file including comments.private boolean
Option that controls whether to print the parse tree of the javadoc comment.private boolean
Option that controls whether to print the full AST of the file.private File
Properties file location.private String
LineNo and columnNo for the suppression.private int
Tab character length.private static final int
The tree walker threads number.private String
Show AST branches that match xpath. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the list of exclusions provided through the command line arguments.validateCli
(picocli.CommandLine.ParseResult parseResult, List<File> filesToProcess) Validates the user-specified command line options.Validates optional command line parameters that might be used with config file.
-
Field Details
-
HELP_WIDTH
private static final int HELP_WIDTHWidth of CLI help option.- See Also:
-
DEFAULT_THREAD_COUNT
private static final int DEFAULT_THREAD_COUNTThe default number of threads to use for checker and the tree walker.- See Also:
-
ATTRIB_TAB_WIDTH_NAME
Name for the moduleConfig attribute 'tabWidth'.- See Also:
-
DEFAULT_OUTPUT_FORMAT
Default output format. -
OUTPUT_FORMAT_OPTION
Option name for output format.- See Also:
-
CHECKER_THREADS_NUMBER
private static final int CHECKER_THREADS_NUMBERThe checker threads number. Suppression: CanBeFinal - we use picocli and it use reflection to manage such fields This option has been skipped for CLI options intentionally.- See Also:
-
TREE_WALKER_THREADS_NUMBER
private static final int TREE_WALKER_THREADS_NUMBERThe tree walker threads number. Suppression: CanBeFinal - we use picocli and it use reflection to manage such fields This option has been skipped for CLI options intentionally.- See Also:
-
files
List of file to validate. -
configurationFile
Config file location. -
outputPath
Output file location. -
propertiesFile
Properties file location. -
suppressionLineColumnNumber
LineNo and columnNo for the suppression. -
tabWidth
private int tabWidthTab character length. Suppression: CanBeFinal - we use picocli and it use reflection to manage such fields -
generateXpathSuppressionsFile
private boolean generateXpathSuppressionsFileSwitch whether to generate suppressions file or not. -
format
Output format. Suppression: CanBeFinal - we use picocli and it use reflection to manage such fields -
printAst
private boolean printAstOption that controls whether to print the AST of the file. -
printAstWithComments
private boolean printAstWithCommentsOption that controls whether to print the AST of the file including comments. -
printJavadocTree
private boolean printJavadocTreeOption that controls whether to print the parse tree of the javadoc comment. -
printTreeWithJavadoc
private boolean printTreeWithJavadocOption that controls whether to print the full AST of the file. -
debug
private boolean debugOption that controls whether to print debug info. -
exclude
Option that allows users to specify a list of paths to exclude. Suppression: CanBeFinal - we use picocli and it use reflection to manage such fields -
excludeRegex
Option that allows users to specify a regex of paths to exclude. Suppression: CanBeFinal - we use picocli and it use reflection to manage such fields -
executeIgnoredModules
private boolean executeIgnoredModulesSwitch whether to execute ignored modules or not. -
xpath
Show AST branches that match xpath.
-
-
Constructor Details
-
CliOptions
private CliOptions()
-
-
Method Details
-
getExclusions
Gets the list of exclusions provided through the command line arguments.- Returns:
- List of exclusion patterns.
-
validateCli
private List<String> validateCli(picocli.CommandLine.ParseResult parseResult, List<File> filesToProcess) Validates the user-specified command line options.- Parameters:
parseResult
- used to verify if the format option was specified on the command linefilesToProcess
- the list of files whose style to check- Returns:
- list of violations
-
validateOptionalCliParametersIfConfigDefined
Validates optional command line parameters that might be used with config file.- Returns:
- list of violations
-