Skip to content

Proposal: Native Support or Integration for Pre-Commit Hook Workflow (Maven & Gradle) #2475

@mrlonis

Description

@mrlonis

Hi there! First off, I just want to say how much I appreciate Spotless. It has become a critical part of my workflow, and I really value the consistency and flexibility it brings to code formatting.

One area where I’ve felt a bit of friction, though, is around formal support for pre-commit workflows. To address this, I built separate solutions for both Maven and Gradle that wire up Spotless to Git pre-commit hooks via shell script files that then call Spotless via Maven or Gradle. They work well and are quite robust, but admittedly require a fair amount of setup and documentation, which can be a barrier, especially for teams or developers trying to onboard quickly.

After stepping back from these projects, I wondered whether this kind of functionality might be a candidate for inclusion directly in Spotless itself, or possibly as an officially supported companion module. You may have considered something like this before, and if so, I’d love to hear your thoughts or learn from any past discussions.

I’m opening this issue to start the conversation and gauge whether there's interest in exploring this further. I’d be happy to share what I’ve built and work toward something that fits well with the existing design and philosophy of Spotless.

Thanks for your time, and again, I appreciate the work you all do on this project!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions