[ https://issues.apache.org/jira/browse/PHOENIX-6851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nihal Jain updated PHOENIX-6851: -------------------------------- Description: Similar to what Apache HBase does today, we want to similarly use spotless plugin to format code in Apache Phoenix. The goal is to improve code consistency across the project and make it easier for new contributors to onboard as today it is very difficult for new contributors (even exitsing one's) to ensure code is properly formatted across the repository in a consistent manner. Hence to overcome this hindrance, here is a summary of the proposed plan based on recent discussions and past experiences: # Integrate the Spotless plugin and update the code template ** Integrate the Spotless plugin into the Phoenix project. This will allow us to standardize code formatting through Maven, reducing reliance on IDE-specific formatting rules. ** Update the development template (dev/PhoenixCodeTemplate.xml) to sync the formatting standards used in HBase. ** Align the license header with the one used by HBase for consistency. 2) Apply Spotless to reformat the entire codebase: # Apply the Spotless plugin to reformat the entire codebase ** This will be done in a single commit to minimize noise in future patches. ** No manual changes should be made in this PR, for ease of review # Add Spotless to the pre-commit checks ** Integrate Spotless checks into the pre-commit process to ensure code consistency moving forward. ** Build is supposed to fail if code does not meet spotless rules ** We may want to add this step only after the initial reformatting is complete to avoid build failures and ease of backport to other branches. Hence we plan to create 3 separate JIRA sub-tasks to handle each of above mentioned steps independently and repeat for all active branches i.e 5.1, 5.2 and master. We plan to take this up once 5.2.1 lands in. See [https://lists.apache.org/thread/9gbh5xs544h4q4w4xt64oy9osy8g8f81] for complete discussion on this issue. CC: [~stoty], [~mnpoonia], [~larsfrancke] was: Similar to what hbase does we can use spotless plugin to format code. Idea is to include spotless check as part of mvn install so if format is wrong mvn install will fail similar to what hbase has. More info in https://issues.apache.org/jira/browse/HBASE-26617 > Use spotless to format code in phoenix > -------------------------------------- > > Key: PHOENIX-6851 > URL: https://issues.apache.org/jira/browse/PHOENIX-6851 > Project: Phoenix > Issue Type: Improvement > Reporter: Aman Poonia > Assignee: Aman Poonia > Priority: Major > > Similar to what Apache HBase does today, we want to similarly use spotless > plugin to format code in Apache Phoenix. > The goal is to improve code consistency across the project and make it easier > for new contributors to onboard as today it is very difficult for new > contributors (even exitsing one's) to ensure code is properly formatted > across the repository in a consistent manner. > Hence to overcome this hindrance, here is a summary of the proposed plan > based on recent discussions and past experiences: > # Integrate the Spotless plugin and update the code template > ** Integrate the Spotless plugin into the Phoenix project. This will allow > us to standardize code formatting through Maven, reducing reliance on > IDE-specific formatting rules. > ** Update the development template (dev/PhoenixCodeTemplate.xml) to sync the > formatting standards used in HBase. > ** Align the license header with the one used by HBase for consistency. 2) > Apply Spotless to reformat the entire codebase: > # Apply the Spotless plugin to reformat the entire codebase > ** This will be done in a single commit to minimize noise in future patches. > ** No manual changes should be made in this PR, for ease of review > # Add Spotless to the pre-commit checks > ** Integrate Spotless checks into the pre-commit process to ensure code > consistency moving forward. > ** Build is supposed to fail if code does not meet spotless rules > ** We may want to add this step only after the initial reformatting is > complete to avoid build failures and ease of backport to other branches. > Hence we plan to create 3 separate JIRA sub-tasks to handle each of above > mentioned steps independently and repeat for all active branches i.e 5.1, 5.2 > and master. > We plan to take this up once 5.2.1 lands in. > See [https://lists.apache.org/thread/9gbh5xs544h4q4w4xt64oy9osy8g8f81] for > complete discussion on this issue. > CC: [~stoty], [~mnpoonia], [~larsfrancke] -- This message was sent by Atlassian Jira (v8.20.10#820010)