-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHOENIX-7441 Integrate the Spotless plugin and update the code template #2023
base: master
Are you sure you want to change the base?
Conversation
NihalJain
commented
Nov 6, 2024
•
edited
Loading
edited
- Update dev/PhoenixCodeTemplate.xml to use latest format as in hbase.
- Copied license-header file from hbase, the one which phoenix was using was a little different
- Fix file having misplaced package block as we do not want any manual code change in the commit where we run spotless
- Disable upToDateChecking which is true by default since spotless 2.35.0
- See UpToDateChecking ignores java formatter ? diffplug/spotless#1767
- Update dev/PhoenixCodeTemplate.xml to use latest format as in hbase. - Copied license-header file from hbase, the one which phoenix was using was a little different - Fix file having misplaced package block as we do not want any manual code change in the commit where we run spotless
</licenseHeader> | ||
</format> | ||
</formats> | ||
<!-- Spotless considers processing same file twice: a bug! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is to handle spotless 2.35.0+ as java formatting breaks for us w/o below change on newer spotless versions. Refer diffplug/spotless#1767
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon downgrading to 2.30.0 due to java 8, this change should no longer needed but good to have it to ensure we don't break again in future when we move to 2.35.0+
specific language governing permissions and limitations | ||
under the License. | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File copied from HBase repo: https://github.com/apache/hbase/blob/master/dev-support/hbase_eclipse_formatter.xml
pom.xml
Outdated
@@ -168,6 +168,7 @@ | |||
<maven-checkstyle-plugin.version>3.3.0</maven-checkstyle-plugin.version> | |||
<maven-shade-plugin.version>3.6.0</maven-shade-plugin.version> | |||
<mvel2.version>2.5.2.Final</mvel2.version> | |||
<spotless.version>2.43.0</spotless.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might break for JDK 8. 😞
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.43.0:apply (default-cli) on project phoenix: Execution default-cli of goal com.diffplug.spotless:spotless-maven-plugin:2.43.0:apply failed: Unable to load the mojo 'apply' in the plugin 'com.diffplug.spotless:spotless-maven-plugin:2.43.0' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: com/diffplug/spotless/maven/SpotlessApplyMojo has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Downgraded to 2.30.0
I would either discuss the import order changes in the existing dev thread, or open a new one for them. I'm fine with renaming the xml, but if we do that, we also need to update the website, which refers to it. |
PTAL @virajjasani @gjacoby126 |
@stoty Got to this before me and I agree with everything he said: Just copying from HBase seems like a good idea to me as well. This change looks good to me in principle (and thanks for catching that JDK incompatiblity). |