Skip to content

Conversation

BojanStipic
Copy link
Contributor

Gradle plugin has IDE_HOOK.md document which explains how to integrate Spotless into IDEs. The similar documentation is missing for the Maven plugin even though it has the same capabilities. This PR adds this missing documentation (copy-pasted and adjusted from the Gradle docs).

@Goooler Goooler requested a review from Copilot July 23, 2025 08:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds IDE integration documentation for the Maven plugin by creating a new IDE_HOOK.md file. The documentation explains how to integrate Spotless Maven plugin with IDEs using command-line arguments, filling a gap in documentation since similar documentation already exists for the Gradle plugin.

  • Adds comprehensive documentation for Maven IDE hook functionality
  • Documents command-line arguments and their usage patterns
  • Explains status information and error handling for IDE integrations

- if `stderr` starts with `IS DIRTY`, then the file was dirty, and `stdout` contains its full formatted contents
- in every other case, `stdout` will be empty / the file will be unchanged because there is nothing to change
- if `stderr` starts with `IS CLEAN`, then the file is already clean
- if `stderr` starts with `DID NOT CONVERGE`, then the formatter is misbehaving, and the rest of `stderr` has useful diagnostic info (e.g. `spotless:diagnose` for [padded cell](../PADDEDCELL.md))
Copy link
Preview

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reference to spotless:diagnose appears to be Gradle-specific syntax. For Maven, this should likely be mvn spotless:diagnose to be consistent with Maven command syntax.

Suggested change
- if `stderr` starts with `DID NOT CONVERGE`, then the formatter is misbehaving, and the rest of `stderr` has useful diagnostic info (e.g. `spotless:diagnose` for [padded cell](../PADDEDCELL.md))
- if `stderr` starts with `DID NOT CONVERGE`, then the formatter is misbehaving, and the rest of `stderr` has useful diagnostic info (e.g. `mvn spotless:diagnose` for [padded cell](../PADDEDCELL.md))

Copilot uses AI. Check for mistakes.

@nedtwigg nedtwigg merged commit ff973d3 into diffplug:main Jul 24, 2025
19 checks passed
@nedtwigg
Copy link
Member

Thanks for bringing these docs up to reality!

@BojanStipic BojanStipic deleted the maven-ide-hook branch July 24, 2025 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants