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
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 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
-