Skip to content

airlift/airstyle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Airstyle

Java code formatter and Maven plugin for Airlift code style.

The formatter produces output according to the formatter style, which starts from the Airlift.xml IntelliJ code style configuration and extends it with additional rules, including wrapping, imports, comments, Javadoc, and Checkstyle compatibility.

Goals

The Airstyle plugin has two goals:

  • check verifies that Java sources are properly formatted, and fails the build if any files need formatting.
  • format rewrites Java sources in place to be properly formatted.

Usage

Add the plugin to your build to run check in the default validate phase:

<build>
    <plugins>
        <plugin>
            <groupId>io.airlift</groupId>
            <artifactId>airstyle-maven-plugin</artifactId>
            <version><!-- current plugin version --></version>
            <executions>
                <execution>
                    <goals>
                        <goal>check</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

After configuring the plugin, run your normal build to execute check:

mvn validate

Rewrite source files with the configured plugin:

mvn airstyle:format

If you just want to try the plugin without configuring it, you can run the goals directly:

mvn io.airlift:airstyle-maven-plugin:RELEASE:check
mvn io.airlift:airstyle-maven-plugin:RELEASE:format

Parameters

Common Parameters

These parameters are shared by check and format:

Parameter Description
<sourceDirectories> Source directories to process.
Default: compile source roots
User Property: airstyle.sourceDirectories
<testSourceDirectories> Test source directories to process.
Default: test compile source roots
User Property: airstyle.testSourceDirectories
<includes> Ant-style patterns for included files.
Default: **/*.java
User Property: airstyle.includes
<excludes> Ant-style patterns for excluded files.
Default: no exclusions
User Property: airstyle.excludes
<includeTestSources> Include test source roots.
Default: true
User Property: airstyle.includeTestSources
<parallel> Process files in parallel.
Default: true
User Property: airstyle.parallel
<skip> Skip goal execution.
Default: false
User Property: airstyle.skip
<rewriteUnusedLambdaParameters> Rewrite unused lambda parameters to Java's unnamed variable _. Set to false for Java 21 and older projects.
Default: true
User Property: airstyle.rewriteUnusedLambdaParameters

check Parameters

Parameter Description
<failOnViolation> Fail the build when files needing formatting are found.
Default: true
User Property: airstyle.failOnViolation

License

See LICENSE. Airstyle is licensed under the Apache License 2.0.

About

Java code formatter for Airlift code style

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages