-
Notifications
You must be signed in to change notification settings - Fork 3
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
add static analysis gradle plugins (spotless + palantir, errorprone + nullaway) #2
Conversation
fe3ae67
to
922890c
Compare
1. update .editorconfig to align with palantir 2. remove usage of jspecify (mongo's nullness annotations suffice) 3. remove unnecessary comments
I don't think we should do this, as the driver's null-related annotations are not intended to be part of the driver API. They are just an implementation detail. |
reverted back |
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.
LGTM, but added @rozza for a second set of eyes
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.
LGTM!
Out of interest was the .editorconfig
change a manual change or automatic based on the formatting plugins?
@@ -29,6 +33,11 @@ dependencies { | |||
testImplementation(libs.junit.jupiter) | |||
|
|||
testRuntimeOnly("org.junit.platform:junit-platform-launcher") | |||
|
|||
errorprone(libs.nullaway) | |||
api(libs.jspecify) |
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.
Even though this is documented as right, it seems wrong to have this as an api
dependency - as its really for compile time only. 🤷
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.
I found the following statement at https://jspecify.dev/docs/using/
So let us stick to api
scope for now and always keep it in mind to switch to lower visibility. Currently given almost zero experience on real usage, let us trust the doc. The switch cost should be minor in the future, if needed.
Palantir Intellij plugin is not well-maintained and latest plugin simply
doesn't work in latest Intellij. Yeah, we can invoke gradle task to
reformat automatically. But an .editorconfig ensures the least surprise so
he/she seldom needs to be bothered with deep diving to figure it out why CI
building failed.
…On Mon, Oct 21, 2024, 5:01 a.m. Ross Lawley ***@***.***> wrote:
***@***.**** approved this pull request.
LGTM!
Out of interest was the .editorconfig change a manual change or automatic
based on the formatting plugins?
------------------------------
In build.gradle.kts
<#2 (comment)>
:
> @@ -29,6 +33,11 @@ dependencies {
testImplementation(libs.junit.jupiter)
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
+
+ errorprone(libs.nullaway)
+ api(libs.jspecify)
Even though this is documented as right, it seems wrong to have this as an
api dependency - as its really for compile time only. 🤷
—
Reply to this email directly, view it on GitHub
<#2 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6UYAUDPBTVIVHVPTYCMPDZ4S7E3AVCNFSM6AAAAABPXWWUL2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGOBRGM4DEMBWHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Good point on jspecify scope! It would be great to limit its visibility so
our client won't include it.
On Mon, Oct 21, 2024, 8:35 a.m. Nathan Xu ***@***.***>
wrote:
… Palantir Intellij plugin is not well-maintained and latest plugin simply
doesn't work in latest Intellij. Yeah, we can invoke gradle task to
reformat automatically. But an .editorconfig ensures the least surprise so
he/she seldom needs to be bothered with deep diving to figure it out why CI
building failed.
On Mon, Oct 21, 2024, 5:01 a.m. Ross Lawley ***@***.***>
wrote:
> ***@***.**** approved this pull request.
>
> LGTM!
>
> Out of interest was the .editorconfig change a manual change or
> automatic based on the formatting plugins?
> ------------------------------
>
> In build.gradle.kts
> <#2 (comment)>
> :
>
> > @@ -29,6 +33,11 @@ dependencies {
> testImplementation(libs.junit.jupiter)
>
> testRuntimeOnly("org.junit.platform:junit-platform-launcher")
> +
> + errorprone(libs.nullaway)
> + api(libs.jspecify)
>
> Even though this is documented as right, it seems wrong to have this as
> an api dependency - as its really for compile time only. 🤷
>
> —
> Reply to this email directly, view it on GitHub
> <#2 (review)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AB6UYAUDPBTVIVHVPTYCMPDZ4S7E3AVCNFSM6AAAAABPXWWUL2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGOBRGM4DEMBWHA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
* implement ConnectionProvider * change minimal MongoDB version to 6 * Update src/test/resources/hibernate.properties Co-authored-by: Jeff Yemin <[email protected]> * remove package-info.java in test folder; add copyright to package-info.java in main folder * improve Javadoc for MongoConnectionProvider per review comments * remove unnecessary codec setting stuff * simplify the dummy implementation of the three methods irrelevant to our usage * simplify MongoConnectionProvider per code review comments * remove exception package and move ConfigurationException to cfg package * add missing Javadocs for MongoDialect * add MQL acronym expansion in Javadoc * round #2 code review comments * change mininum mongodb version to v6.3 * use HibernateException instead of ConfigurationException.java * switch MongoDialect minimum db version to 6.0 * Update src/main/java/com/mongodb/hibernate/jdbc/MongoConnectionProvider.java Co-authored-by: Jeff Yemin <[email protected]> * deleted unused constructors in MongoDialect * add Javadoc for the root package-info.java * make more exception messages begin with uppercase * update various gradle plugin to latest versions * add sl4j logging dependencies and logback-test.xml config * fix a static check issue * change default constructor of MongoDialect to end up with null value; override getMinimumSupportedVersion() * some minor improvements * change as per Valentin's excellent code review comments * update SessionFactoryTests as per code review comments * update MongoDialect as per code review comments * update MongoConnectionProvider as per code review comments * delete .editorconfig file and move it to another separate PR * fix a static check style issue * resolve some code review comments * fix style checking issue * minor changes to improve Dialect min version usage * improve mentioning of MongoDB Java Driver in MongoDialect's Javadoc * add transient keyword to MongoClient in MongoConnectionProvider * Update src/main/java/com/mongodb/hibernate/jdbc/MongoConnectionProvider.java Co-authored-by: Valentin Kovalenko <[email protected]> * change as per code review comments * remove database checking logic * fix import style issue * change per some code review comments * add missing 'compileJava' gradle task in evergreen's static-check.sh --------- Co-authored-by: Jeff Yemin <[email protected]> Co-authored-by: Valentin Kovalenko <[email protected]>
https://jira.mongodb.org/browse/HIBERNATE-5
The following static analysis gradle plugins are integrated: