Skip to content

herkrath/speedy-spotless

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Speedy Spotless

For easy formatting of staged changes. Inspired by pretty-quick.

It includes apply and check goals from Spotless Maven Plugin but also includes the new goal staged to trigger the formatting of files staged in Git.

Works with Java 8+.

Installation

Speedy Spotless supports the exact same configuration options as Spotless Maven Plugin.

Additionally the install-hooks goal may be used to install a pre-commit Git hook to format staged files when committing.

<build>
    <plugins>
      <plugin>
        <groupId>io.committed</groupId>
        <artifactId>speedy-spotless-maven-plugin</artifactId>
        <version>0.1.1</version>
        <executions>
          <execution>
            <id>install-formatter-hook</id>
            <goals>
              <goal>install-hooks</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <java>
            <googleJavaFormat>
              <style>GOOGLE</style>
            </googleJavaFormat>
            <removeUnusedImports />
          </java>
        </configuration>
      </plugin>
    </plugins>
</build>

Ensure the install-hooks goal is declared in your root POM.

Configuration

See Spotless Maven Plugin for code formatting options.

Caveats

  • Currently only Java files are formatted. Spotless's spotlessFiles option is ignored.

About

For easy formatting of staged changes. Inspired by https://github.com/azz/pretty-quick

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 90.4%
  • Shell 9.6%