-
Notifications
You must be signed in to change notification settings - Fork 0
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 code formatter and linter #140
Conversation
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.
A good change! Always preferred a consistent code style. The formatting of the comments is mostly ok, but there are also strange formatting in a few places. I left some remarks.
Reviewed 442 of 442 files at r1, all commit messages.
Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @Huulivoide)
src/main/java/fi/hsl/jore/importer/config/jooq/converter/date_range/DateRange.java
line 29 at r1 (raw file):
// See section 8.17.7: // > The built-in range types int4range, int8range, and daterange all use a canonical form // that includes the
This needs manual intervention. Use of >
does not go as originally intended.
src/main/java/fi/hsl/jore/importer/feature/batch/line/support/LineImportRepository.java
line 88 at r1 (raw file):
// TODO: At the moment we don't have any updatable fields in the NETWORK_LINES tables, // but this may change when we decide how to handle e.g. PublicTransportDestination // fields
inconsistent indentation
src/main/java/fi/hsl/jore/importer/feature/batch/route_link/RouteLinksReader.java
line 108 at r1 (raw file):
return ImmutableReaderState.copyOf(this) // We _must_ update the attributes, because while some of the fields (joined // from the
The lines could be joined in a better way. Only two short words on one line.
src/main/java/fi/hsl/jore/importer/feature/batch/route_link/RoutePointConstructor.java
line 33 at r1 (raw file):
entity.routeLinks() // The order number property is NOT guaranteed to be strictly incremental by // 1,
Here again. This could be more readable. Needs manual intervention.
src/main/java/fi/hsl/jore/importer/feature/mapmatching/dto/request/MapMatchingRequestBuilder.java
line 91 at r1 (raw file):
+ " the route" + " point is" + " stop point"
Whoops! Not the most readable form. :D
src/main/java/fi/hsl/jore/importer/feature/network/route_point/repository/RoutePointExportRepository.java
line 76 at r1 (raw file):
.and( length( SCHEDULED_STOP_POINTS
Feels a bit too sparse, but probably nothing can be done with this style configuration...
src/test/java/fi/hsl/jore/importer/feature/batch/link/support/TransitTypeToNetworkTypeMapperTest.java
line 24 at r1 (raw file):
public void testEachNetworkTypeSupported() { // Note that at the moment there is a comprehensive 1:1 mapping from // TransitType->NetworkType,
These lines could be joined in a better way.
daf9d90
to
f62158a
Compare
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.
Reviewed 286 of 286 files at r2, all commit messages.
Reviewable status: all files reviewed, 9 unresolved discussions (waiting on @Huulivoide)
pom.xml
line 712 at r2 (raw file):
</cleanthat> <!-- Format the code according to Plantir code style. -->
typo => "Palantir"
.github/workflows/spotless.yml
line 24 at r2 (raw file):
- name: Cache Maven packages uses: actions/cache@v3
=> actions/cache@v4
. v4
is the most recent version.
f62158a
to
82aa5a5
Compare
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.
Reviewable status: 445 of 449 files reviewed, 8 unresolved discussions (waiting on @jarkkoka)
.github/workflows/spotless.yml
line 24 at r2 (raw file):
Previously, jarkkoka (Jarkko Kaura) wrote…
=>
actions/cache@v4
.v4
is the most recent version.
Done.
src/main/java/fi/hsl/jore/importer/feature/batch/line/support/LineImportRepository.java
line 88 at r1 (raw file):
Previously, jarkkoka (Jarkko Kaura) wrote…
inconsistent indentation
Done.
src/main/java/fi/hsl/jore/importer/feature/batch/route_link/RouteLinksReader.java
line 108 at r1 (raw file):
Previously, jarkkoka (Jarkko Kaura) wrote…
The lines could be joined in a better way. Only two short words on one line.
Done.
src/main/java/fi/hsl/jore/importer/feature/batch/route_link/RoutePointConstructor.java
line 33 at r1 (raw file):
Previously, jarkkoka (Jarkko Kaura) wrote…
Here again. This could be more readable. Needs manual intervention.
Done.
src/main/java/fi/hsl/jore/importer/feature/mapmatching/dto/request/MapMatchingRequestBuilder.java
line 91 at r1 (raw file):
Previously, jarkkoka (Jarkko Kaura) wrote…
Whoops! Not the most readable form. :D
Done.
src/main/java/fi/hsl/jore/importer/feature/network/route_point/repository/RoutePointExportRepository.java
line 76 at r1 (raw file):
Previously, jarkkoka (Jarkko Kaura) wrote…
Feels a bit too sparse, but probably nothing can be done with this style configuration...
Done.
src/test/java/fi/hsl/jore/importer/feature/batch/link/support/TransitTypeToNetworkTypeMapperTest.java
line 24 at r1 (raw file):
Previously, jarkkoka (Jarkko Kaura) wrote…
These lines could be joined in a better way.
Done.
src/main/java/fi/hsl/jore/importer/config/jooq/converter/date_range/DateRange.java
line 29 at r1 (raw file):
Previously, jarkkoka (Jarkko Kaura) wrote…
This needs manual intervention. Use of
>
does not go as originally intended.
Done.
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.
Reviewed 161 of 442 files at r1, 284 of 286 files at r2, 4 of 4 files at r3, all commit messages.
Reviewable status: all files reviewed, 8 unresolved discussions (waiting on @jarkkoka)
Codebase is already following the wast majority of the enabled rules/mutators. Config uses Composite mutators, that map to the following list of mutators: * ArithmethicAssignment * ArraysDotStream * AvoidMultipleUnaryOperators * AvoidUncheckedExceptionsInSignatures * CastMathOperandsBeforeAssignement * CollectionIndexOfToContains * CollectionToOptional * ComparisonWithNaN * CreateTempFilesUsingNio * EmptyControlStatement * EnumsWithoutEquals * ForEachAddToStreamCollectToCollection * ForEachIfBreakElseToStreamTakeWhile * ForEachIfBreakToStreamFindFirst * ForEachIfToIfStreamAnyMatch * ForEachToIterableForEach * GuavaImmutableMapBuilderOverVarargs * GuavaInlineStringsRepeat * GuavaInlineStringsRepeat * GuavaStringsIsNullOrEmpty * LambdaIsMethodReference * LambdaReturnsSingleStatement * LiteralsFirstInComparisons * LocalVariableTypeInference * LoopIntRangeToIntStreamForEach * ModifierOrder * ObjectEqualsForPrimitives * ObjectsHashCodePrimitive * OptionalNotEmpty * OptionalWrappedIfToFilter * OptionalWrappedVariableToMap * PrimitiveWrapperInstantiation * RedundantLogicalComplementsInStream * RemoveAllToClearCollection * RemoveExplicitCallToSuper * SimplifyBooleanExpression * SimplifyBooleanInitialization * SimplifyStartsWith * StreamAnyMatch * StreamFlatMapStreamToFlatMap * StreamForEachNestingForLoopToFlatMap * StreamMapIdentity * StreamWrappedIfToFilter * StreamWrappedMethodRefToMap * StreamWrappedVariableToMap * StringIndexOfToContains * StringReplaceAllWithQuotableInput * StringToString * ThreadRunToThreadStart * UnnecessaryBoxing * UnnecessaryFullyQualifiedName * UnnecessaryImport * UnnecessaryLambdaEnclosingParameters * UnnecessaryModifier * UnnecessarySemicolon * UseCollectionIsEmpty * UseIndexOfChar * UseStringIsEmpty * UseTextBlocks
82aa5a5
to
6773353
Compare
Add Spotless with Palantir style for Java formatting
Add Cleanthat to Spotless config
Codebase is already following the wast majority of the enabled rules/mutators. Config uses Composite mutators, that map to the following list of mutators:
This change is