The Phoenix project utilizes checkstyle for code formatting, however, it has been observed that the code is not well formatted. One potential reason for this is that the project currently only provides eclipse formatter rules, which may not be used by all developers. To address this issue, one solution is to implement the spotless plugin. This plugin allows formatting to be done through maven, rather than relying on IDE specific rules. Developers can run the command "maven spotless:apply" to format their code. Additionally, this plugin can be added to pre-check-in checks, allowing the pre-check-in job to run "maven spotless:apply" or "maven spotless:check" as needed. One potential concern is that a one-time "format all" exercise may be required. However, this can be avoided by using the <ratchetFrom> configuration, which only applies spotless to changes made after a specific commit. Some projects, such as HBase, have already adopted the use of spotless. A JIRA ticket (PHOENIX-6850) has been filed and a sample pull request (https://github.com/apache/phoenix/pull/1548) has been created to demonstrate the implementation of spotless in Phoenix.
Please take a look and let me know if you have any concerns or suggestions. -- *With Regards,* *Aman Poonia*
