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 StringName for the moduleConfig attribute 'tabWidth'.private static final intThe checker threads number.private StringConfig file location.private booleanOption that controls whether to print debug info.private static final Main.OutputFormatDefault output format.private static final intThe 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 booleanSwitch whether to execute ignored modules or not.List of file to validate.private Main.OutputFormatOutput format.private booleanSwitch whether to generate check and file suppressions file or not.private booleanSwitch whether to generate xpath suppressions file or not.private static final intWidth of CLI help option.private static final StringOption name for output format.private PathOutput file location.private booleanOption that controls whether to print the AST of the file.private booleanOption that controls whether to print the AST of the file including comments.private booleanOption that controls whether to print the parse tree of the javadoc comment.private booleanOption that controls whether to print the full AST of the file.private FileProperties file location.private StringLineNo and columnNo for the suppression.private intTab character length.private static final intThe tree walker threads number.private StringShow 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
Width of CLI help option.- See Also:
-
DEFAULT_THREAD_COUNT
The 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
The checker threads number. This option has been skipped for CLI options intentionally.- See Also:
-
TREE_WALKER_THREADS_NUMBER
The tree walker threads number.- 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
Tab character length. -
generateXpathSuppressionsFile
Switch whether to generate xpath suppressions file or not. -
generateCheckAndFileSuppressionsFile
Switch whether to generate check and file suppressions file or not. -
format
Output format. -
printAst
Option that controls whether to print the AST of the file. -
printAstWithComments
Option that controls whether to print the AST of the file including comments. -
printJavadocTree
Option that controls whether to print the parse tree of the javadoc comment. -
printTreeWithJavadoc
Option that controls whether to print the full AST of the file. -
debug
Option that controls whether to print debug info. -
exclude
Option that allows users to specify a list of paths to exclude. -
excludeRegex
Option that allows users to specify a regex of paths to exclude. -
executeIgnoredModules
Switch 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
-