Early Development: lintal is not yet recommended for general use. An alpha version will be published in late Q1 2026.
lintal fix

Automatic fixes

lintal can automatically fix many checkstyle violations that would otherwise require manual editing. Every fix is validated against checkstyle's own test suite and compiled with javac to guarantee correctness.
$
lintal fix src/

Fix in place

$
lintal fix src/

Preview changes

$
lintal fix src/ --diff

Include unsafe fixes

$
lintal fix src/ --unsafe-fixes
Whitespace

Spacing and indentation

Fix operator spacing, indentation levels, extra spaces, and line wrapping rules automatically.
WhitespaceAround
Add required whitespace around operators and keywords
Indentation
Correct indentation to configured level (default: 4 spaces)
SingleSpaceSeparator
Collapse multiple spaces to a single space
NoWhitespaceBefore
Remove whitespace before semicolons, commas, and postfix operators
OperatorWrap
Move operators to end of line (eol) or beginning of next line (nl)
EmptyLineSeparator
Add required blank lines between class members
Blocks

Brace placement

Enforce consistent placement of opening and closing curly braces across your codebase.
LeftCurly
Move opening braces to end of line (eol) or new line (nl)
RightCurly
Place closing brace on same line as else/catch/finally
Modifiers

Modifier ordering and correctness

Reorder modifiers to the canonical JLS order, add final where required, and remove redundant modifiers.
ModifierOrder
Reorder modifiers to the canonical Java Language Specification order
RedundantModifier
Remove redundant modifiers from interface members
FinalParameters
Add final to method and constructor parameters
FinalLocalVariable
Add final to local variables that are never reassigned
FinalClass
Add final to classes with only private constructors
Imports

Import cleanup

Remove unused and redundant imports to keep your file headers clean.
UnusedImports
Remove import statements that are not referenced in the file
RedundantImport
Remove duplicate imports and unnecessary java.lang imports
Style & Coding

Code style consistency

Enforce consistent array declarations, long literal suffixes, and one-statement-per-line.
ArrayTypeStyle
Convert C-style array declarations to Java-style
UpperEll
Replace lowercase 'l' with uppercase 'L' in long literals
OneStatementPerLine
Split multiple statements on the same line
Miscellaneous

File-level fixes

Fix file-level issues like missing trailing newlines automatically.
NewlineAtEndOfFile
Add missing newline at end of file
Unsafe Fixes

Semantic transformations

These fixes change the semantics of your code and require the --unsafe-fixes flag. Always review the changes before committing.
StringLiteralEquality
Replace == with .equals() for string comparisons
SimplifyBooleanExpression
Simplify redundant boolean comparisons and ternaries
EmptyStatement
Remove stray semicolons (empty statements)
MissingJavadocMethod
Add placeholder Javadoc stubs to public methods

Ready to automate your Java formatting?

Run lintal fix src/ and let lintal handle the tedious formatting work for you.