Conversation
Replace formatter-maven-plugin and impsort-maven-plugin with spotless-maven-plugin. Spotless provides a more modern and flexible approach to code formatting. Configuration: - Use Palantir Java Format (version 2.50.0) for consistent Java formatting - Enable removeUnusedImports to clean up unnecessary imports - Configure importOrder to match current convention: java, jakarta, javax, org.w3c, org.xml, junit, then others - Add license header enforcement using the Apache License 2.0 template Plugin is configured in root pom.xml pluginManagement and inherited by all child modules. Profile changes in parent/pom.xml: - sourcecheck profile: uses spotless:check to validate formatting - full profile: uses spotless:apply to auto-format during build The legacy formatter and impsort plugins remain configured for backward compatibility but are no longer used in the default profiles.
Apply Palantir Java Format to all Java source files using Spotless. Changes applied: - Consistent code formatting according to Palantir style - Removed unused imports - Organized imports according to project convention - Ensured all files have the proper Apache License 2.0 header This is a large-scale formatting change affecting approximately 21,000 Java source files to establish a consistent code style baseline.
Add a dedicated workflow to check code formatting on pull requests targeting main and LTS branches (camel-4.4.x, camel-4.8.x, camel-4.10.x, camel-4.14.x). The workflow: - Triggers only when Java files are modified - Runs spotless:check via the sourcecheck profile - Provides helpful guidance in the job summary when formatting fails - Includes concurrency control to cancel obsolete runs This ensures all PRs conform to the project's formatting standards before they can be merged.
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🤖 CI automation will test this PR automatically. 🐫 Apache Camel Committers, please review the following items:
|
|
-1 this makes backporting code much harder when things every file are reformatted. |
Migrate to spotless which offers a bit more than just simple formatting, especially on pom files and other non java source files.