chore(grails-data-neo4j): clean up Checkstyle/CodeNarc violations (PR5)#15833
Open
borinquenkid wants to merge 1 commit into
Open
chore(grails-data-neo4j): clean up Checkstyle/CodeNarc violations (PR5)#15833borinquenkid wants to merge 1 commit into
borinquenkid wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR is part of the Neo4j module migration work and focuses on bringing grails-datastore-gorm-neo4j into compliance with the repository’s Checkstyle/CodeNarc gates by applying broad formatting/import cleanups across the module.
Changes:
- Mass formatting and import-order cleanup across Java and Groovy sources (expanding wildcard imports, fixing spacing/indentation, removing stray blank lines).
- Minor refactors consistent with style gates (eg.
Loggerfields madestatic final, generic diamond cleanups likeCollections.emptyMap()). - Small internal reordering/movement of methods and helpers while preserving intended behavior.
Reviewed changes
Copilot reviewed 68 out of 69 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/util/IteratorUtil.java | Whitespace/formatting cleanup in iterator helpers |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/util/EmbeddedNeo4jServer.java | Import ordering, generics cleanup (Collections.emptyMap()), formatting |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/TypeDirectionPair.java | Minor simplification/formatting of equals and method spacing |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/SessionFlushedEvent.java | Import ordering/blank line normalization |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/services/transform/CypherQueryStringTransformer.groovy | Import ordering and formatting of conditional blocks |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/services/implementers/UpdateCypherQueryImplementer.groovy | Import cleanup and formatting in annotation parsing logic |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/services/implementers/StatementResultCypherQueryImplementer.groovy | Import ordering/spacing normalization |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/services/implementers/FindShortestPathImplementer.groovy | Static import expansion and formatting adjustments |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/services/implementers/FindPathCypherQueryImplementer.groovy | Import ordering cleanup |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/services/implementers/FindOneCypherQueryImplementer.groovy | Import ordering cleanup (Java types grouped ahead of Groovy) |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/services/implementers/FindAllCypherQueryImplementer.groovy | Import ordering cleanup (Java types grouped ahead of Groovy) |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/RelationshipUtils.groovy | Formatting of control flow and builder-style code |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/RelationshipPersistentEntity.groovy | Formatting, cast spacing, and minor comment indentation |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/proxy/Neo4jProxyFactory.java | Import ordering cleanup |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/proxy/Neo4jAssociationQueryProxyHandler.java | Import ordering and blank-line cleanup |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/proxy/HashcodeEqualsAwareProxyFactory.java | Import ordering and formatting of nested handler logic |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/Neo4jTransaction.groovy | Import ordering and spacing of guard conditions/log statements |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/Neo4jSession.java | Wildcard import expansion, ordering, minor cleanup (eg. 0L), method move |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/Neo4jMappingContext.java | Import expansion, formatting, and minor simplifications (return entity) |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/Neo4jEntityTraitProvider.groovy | Import ordering and whitespace cleanup |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/Neo4jDatastoreTransactionManager.java | Import ordering and formatting of guard checks |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/Neo4jDatastore.java | Import expansion, logger field normalization, formatting and method reordering |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/mapping/reflect/Neo4jNameUtils.groovy | Spacing cleanup in static helpers |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/mapping/config/RelationshipConfig.groovy | Import ordering cleanup |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/mapping/config/NodeConfig.groovy | Import ordering and semicolon removal |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/mapping/config/DynamicToOneAssociation.java | Formatting + Java pattern-matching instanceof |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/mapping/config/DynamicToManyAssociation.java | Formatting and spacing cleanup |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/mapping/config/DynamicAssociation.java | Minor whitespace/blank line normalization |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/mapping/config/Attribute.groovy | Import ordering cleanup |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/IdGenerator.java | Reordered method vs. enum for style/consistency |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/identity/SnowflakeIdGenerator.java | Import ordering + Logger made static final + formatting |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/GraphPersistentEntity.groovy | Import expansion and formatting across mapping/query helpers |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/GraphGormMappingFactory.groovy | Formatting of control flow |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/GraphClassMapping.groovy | Cast spacing normalization |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/extensions/Neo4jExtensions.groovy | Import ordering + formatting of type coercion helpers |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/engine/RelationshipPendingInsert.java | Wildcard import expansion + logger normalization + formatting |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/engine/RelationshipPendingDelete.java | Import ordering + logger normalization + formatting |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/engine/Neo4jModificationTrackingEntityAccess.groovy | Whitespace normalization |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/engine/Neo4jAssociationQueryExecutor.groovy | Import ordering + formatting in lazy-loading query construction |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/engine/DynamicAssociationSupport.java | Import expansion/ordering + formatting of dynamic association load logic |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/CypherBuilder.java | Import expansion + field finalization + method reordering for style |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/connections/Neo4jEmbeddedConnectionSource.java | Import ordering + spacing cleanup |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/connections/Neo4jConnectionSourceSettingsBuilder.groovy | Import ordering normalization |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/connections/Neo4jConnectionSourceSettings.groovy | Whitespace normalization and enum formatting |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/connections/Neo4jConnectionSourceFactory.java | Import expansion + moved isEmbeddedAvailable() + formatting |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/config/Settings.java | Minor spacing normalization |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/config/Neo4jDriverConfigBuilder.groovy | Import ordering + formatting of fallback logic |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/collection/Neo4jSortedSet.groovy | @Delegate formatting + whitespace/spacing cleanup |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/collection/Neo4jSet.groovy | @Delegate formatting + whitespace/spacing cleanup |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/collection/Neo4jResultList.groovy | Import ordering + spacing cleanup in result decoding paths |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/collection/Neo4jRelationship.groovy | Import ordering + whitespace normalization |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/collection/Neo4jPersistentSortedSet.groovy | @Delegate formatting + spacing cleanup |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/collection/Neo4jPersistentSet.groovy | @Delegate formatting + spacing cleanup |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/collection/Neo4jPersistentList.groovy | Removed stray leading whitespace line + @Delegate formatting |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/collection/Neo4jPath.groovy | Import ordering + spacing/formatting in adapter logic |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/collection/Neo4jList.groovy | @Delegate formatting + spacing cleanup |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/collection/Neo4jAssociationResultList.groovy | Whitespace normalization |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/collection/GraphAdapter.groovy | Import cleanup + formatting of graph adaptation logic |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/api/Neo4jGormStaticApi.groovy | Wildcard import expansion + formatting in query execution helpers |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/grails/neo4j/services/Cypher.groovy | Whitespace normalization |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/grails/neo4j/Relationship.groovy | Generic spacing + formatting of equals/hashCode |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/grails/neo4j/Path.groovy | Generic spacing + interface formatting |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/grails/neo4j/Node.groovy | Whitespace normalization and trailing brace formatting |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/grails/neo4j/Neo4jEntity.groovy | Import ordering + string literal normalization + formatting |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/grails/neo4j/mapping/MappingBuilder.groovy | Whitespace/formatting cleanup in inner mapping-definition builders |
| grails-data-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/grails/neo4j/Direction.groovy | Whitespace normalization and trailing brace formatting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+116
to
+118
| if (isLazyToMany) { | ||
| cypher.append(related.formatId(RelationshipPersistentEntity.TO)) | ||
| .append("RETURN as id") | ||
| } | ||
| else { | ||
| if(!isRelationship) { | ||
| .append("RETURN as id") |
| for (Association association in associations) { | ||
| if (association.isBasic()) continue | ||
|
|
||
| boolean isEager = ((Property) association.mapping.mappedForm).isLazy() |
6edeaa9 to
f807099
Compare
4c91bb3 to
70559eb
Compare
…grails-datastore-gorm-neo4j Fixes all 655 Checkstyle violations across 23 Java files and the remaining CodeNarc violations across 7 Groovy files in the module: import ordering, wildcard import expansion, unused imports, whitespace/paren spacing, blank line separators, trailing newlines, indentation, and operator/separator wrapping. No behavioral changes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
f807099 to
ad411f4
Compare
🚨 TestLens detected 16 failed tests 🚨Here is what you can do:
Test SummaryCI / Functional Tests (Java 21, indy=false) > :grails-test-examples-neo4j-grails3-neo4j-hibernate:integrationTest
CI / Functional Tests (Java 21, indy=false) > :grails-test-examples-neo4j-grails3-neo4j:integrationTest
CI / Functional Tests (Java 21, indy=true) > :grails-test-examples-neo4j-grails3-neo4j-hibernate:integrationTest
CI / Functional Tests (Java 21, indy=true) > :grails-test-examples-neo4j-grails3-neo4j:integrationTest
CI / Functional Tests (Java 21, indy=true) > :grails-test-examples-scaffolding:integrationTest
CI / Functional Tests (Java 25, indy=false) > :grails-test-examples-neo4j-grails3-neo4j-hibernate:integrationTest
CI / Functional Tests (Java 25, indy=false) > :grails-test-examples-neo4j-grails3-neo4j:integrationTest
🏷️ Commit: ad411f4 Test Failures (first 10 of 16)AuthorControllerSpec > Test list authors (:grails-test-examples-neo4j-grails3-neo4j-hibernate:integrationTest in CI / Functional Tests (Java 21, indy=false))AuthorControllerSpec > Test save author (:grails-test-examples-neo4j-grails3-neo4j-hibernate:integrationTest in CI / Functional Tests (Java 21, indy=false))BookControllerSpec > Test list books (:grails-test-examples-neo4j-grails3-neo4j:integrationTest in CI / Functional Tests (Java 21, indy=false))BookControllerSpec > Test list books (:grails-test-examples-neo4j-grails3-neo4j-hibernate:integrationTest in CI / Functional Tests (Java 21, indy=false))BookControllerSpec > Test save book (:grails-test-examples-neo4j-grails3-neo4j:integrationTest in CI / Functional Tests (Java 21, indy=false))AuthorControllerSpec > Test list authors (:grails-test-examples-neo4j-grails3-neo4j-hibernate:integrationTest in CI / Functional Tests (Java 21, indy=true))AuthorControllerSpec > Test save author (:grails-test-examples-neo4j-grails3-neo4j-hibernate:integrationTest in CI / Functional Tests (Java 21, indy=true))BookControllerSpec > Test list books (:grails-test-examples-neo4j-grails3-neo4j-hibernate:integrationTest in CI / Functional Tests (Java 21, indy=true))BookControllerSpec > Test list books (:grails-test-examples-neo4j-grails3-neo4j:integrationTest in CI / Functional Tests (Java 21, indy=true))BookControllerSpec > Test save book (:grails-test-examples-neo4j-grails3-neo4j:integrationTest in CI / Functional Tests (Java 21, indy=true))Muted TestsSelect tests to mute in this pull request:
Reuse successful test results:
Click the checkbox to trigger a rerun:
Learn more about TestLens at testlens.app. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #15832 (PR4 — re-add Neo4j example apps and docs into the monorepo). This is PR5 of the migration: brings
grails-datastore-gorm-neo4jinto compliance with the repo's Checkstyle/CodeNarc gate.grails.neo4j.*,grails.neo4j.mapping.MappingBuilder,grails.neo4j.services.Cypher).GraphGormMappingFactory.groovythat broke Groovy compilation, and a plain class inNeo4jSession.javasilently converted into a Javarecordwith a rewrittenequals()(reverted to the original class — no behavior change intended here).Test plan
./gradlew :grails-datastore-gorm-neo4j:compileGroovy :grails-datastore-gorm-neo4j:compileTestGroovy— clean./gradlew :grails-datastore-gorm-neo4j:codeStyle— 0 Checkstyle violations (down from 655), 0 CodeNarc violations./gradlew :grails-datastore-gorm-neo4j:test— 547 tests, 7 pre-existing failures; confirmed viagit stashcomparison that the same 7 fail identically against the original unformatted code (not a regression from this change)🤖 Generated with Claude Code