-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Replace spotless with openrewrite and add more stylistic/cleanup rules #6907
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
base: dev-2.x
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6907 +/- ##
=============================================
- Coverage 72.10% 71.99% -0.12%
+ Complexity 19671 19670 -1
=============================================
Files 2125 2125
Lines 79533 79769 +236
Branches 8051 8052 +1
=============================================
+ Hits 57349 57428 +79
- Misses 19347 19504 +157
Partials 2837 2837 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5ab59a9
to
6cfe91c
Compare
I ran checkstyle locally to test if openrewrite fixed all the issues it was supposed(?) to fix and it found some additional issues but not too many: [ERROR] /home/joel/OpenTripPlanner/application/src/main/java/org/opentripplanner/osm/model/OsmEntity.java:566:7: 'for' construct must use '{}'s. [NeedBraces] [ERROR] /home/joel/OpenTripPlanner/application/src/main/java/org/opentripplanner/osm/model/OsmEntity.java:591:5: 'for' construct must use '{}'s. [NeedBraces] [ERROR] /home/joel/OpenTripPlanner/application/src/main/java/org/opentripplanner/osm/model/OsmEntity.java:593:5: 'for' construct must use '{}'s. [NeedBraces] [ERROR] /home/joel/OpenTripPlanner/application/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/gbfs/v3/GbfsStationInformationMapper.java:8:54: Using the '.*' form of import should be avoided - org.mobilitydata.gbfs.v3_0.station_information.*. [AvoidStarImport] [ERROR] /home/joel/OpenTripPlanner/application/src/main/java/org/opentripplanner/graph_builder/GraphStats.java:161:7: 'for' construct must use '{}'s. [NeedBraces] [ERROR] /home/joel/OpenTripPlanner/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java:181:5: 'for' construct must use '{}'s. [NeedBraces] [ERROR] /home/joel/OpenTripPlanner/application/src/main/java/org/opentripplanner/visualizer/ShowGraph.java:615:7: Unused local variable 'mode'. [UnusedLocalVariable] [ERROR] /home/joel/OpenTripPlanner/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchemaFactory.java:900:13: Unused local variable 'filterByBikeParks'. [UnusedLocalVariable] [ERROR] /home/joel/OpenTripPlanner/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchemaFactory.java:901:13: Unused local variable 'filterByCarParks'. [UnusedLocalVariable] [ERROR] /home/joel/OpenTripPlanner/application/src/main/java/org/opentripplanner/framework/geometry/GeometryUtils.java:223:9: 'for' construct must use '{}'s. [NeedBraces] |
6cfe91c
to
6800266
Compare
``` | ||
|
||
To check for formatting errors, use the profile `prettierCheck`: | ||
To check for prettier formatting errors, use the profile `prettierCheck`: |
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.
Prettier and openrewrite both do formatting changes, that's why I wanted to specify that this command only runs some of them.
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.
Sorry, I didn't realize the title of the section. I've now split the rewrite stuff to be under different title.
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 looked fast through this. The changes are mostly inline with existing OTP conventions - very good.
If we want to run this on a permanent bases is something else, I support optIn and just a warning in the build. That allows us to run this periodically, and not on every commit in our local environment.
This avoids need to run rewrite twice in some cases
6800266
to
32007fc
Compare
I updated this pr so that openrewrite is not run by default (although it is still checked by CI). I also made the CI check simpler. |
Summary
This is an alternative to #6901. Might also integrate checkstyle in a separate pr.
Issue
Related to last week's conference discussions and #6913.
Unit tests
No
Documentation
TODO
Changelog
Not sure