[
https://issues.apache.org/jira/browse/TIKA-4251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18039467#comment-18039467
]
Tim Allison edited comment on TIKA-4251 at 11/19/25 9:05 PM:
-------------------------------------------------------------
For kicks, I tried spotless. A proof of concept is available on the `spotless`
branch: https://github.com/apache/tika/tree/spotless.
I had to fix a few license headers that were below the package statement.
I had to add // @formatter:on/off around a few enums.
I had some version problem with java until I switched to the eclipse formatter.
Other than that, this worked pretty well.
If we're ok with moving forward, I can do this to main and branch_3x so that
they'll both be in sync.
Formatting is automatically applied with a subset of checkstyle checks still
around with: mvn clean install
You can also run `mvn spotless:apply` to make the changes etc...
[~tilman] [~ndipiazza] other fellow devs, wdyt?
was (Author: [email protected]):
For kicks, I tried spotless. A proof of concept is available on the `spotless`
branch.
I had to fix a few license headers that were below the package statement.
I had to add // @formatter:on/off around a few enums.
I had some version problem with java until I switched to the eclipse formatter.
Other than that, this worked pretty well.
If we're ok with moving forward, I can do this to main and branch_3x so that
they'll both be in sync.
Formatting is automatically applied with a subset of checkstyle checks still
around with: mvn clean install
You can also run `mvn spotless:apply` to make the changes etc...
[~tilman] [~ndipiazza] other fellow devs, wdyt?
> [DISCUSS] move to cosium's git-code-format-maven-plugin with
> google-java-format
> -------------------------------------------------------------------------------
>
> Key: TIKA-4251
> URL: https://issues.apache.org/jira/browse/TIKA-4251
> Project: Tika
> Issue Type: Task
> Reporter: Tim Allison
> Priority: Major
>
> I was recently working a bit on incubator-stormcrawler, and I noticed that
> they are using cosium's git-code-format-maven-plugin:
> https://github.com/Cosium/git-code-format-maven-plugin
> I was initially annoyed that I couldn't quickly figure out what I had to fix
> to make the linter happyl, but then I realized there was a magic command:
> {{mvn git-code-format:format-code}} which just fixed the code so that the
> linter passed.
> The one drawback I found is that it does not fix nor does it alert on
> wildcard imports. We could still use checkstyle for that but only have one
> rule for checkstyle.
> The other drawback is that there is not a lot of room for variation from
> google's style. This may actually be a benefit, too, of course.
> I just ran this on {{tika-core}} here:
> https://github.com/apache/tika/tree/google-java-format
> What would you think about making this change for 3.x?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)