[jira] [Comment Edited] (TIKA-4251) [DISCUSS] move to cosium's git-code-format-maven-plugin with google-java-format
[ https://issues.apache.org/jira/browse/TIKA-4251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17859757#comment-17859757 ] Nicholas DiPiazza edited comment on TIKA-4251 at 6/24/24 6:35 PM: -- we could keep everything how it is but: * provide instructions how to run the code formatter on the entire repo with google checkstyle. * run it on the entire codebase and commit the now-fully-formatted repo * advise everyone turn on the automatic code formatting in Intellij/Eclipse so that you automatically have your code formatted. Now that plugin doesn't control us so much, but we still have easy way to stay fully formatted so we stop getting the back-and-forth with maven and CI when we forget to format something. was (Author: ndipiazza): we could keep everything how it is but: * provide instructions how to run the code formatter manually * run it on the entire codebase and commit the now-fully-formatted repo * advise everyone turn on the automatic code formatting in Intellij/Eclipse so that you automatically have your code formatted. Now that plugin doesn't control us so much, but we still have easy way to stay fully formatted so we stop getting the back-and-forth with maven and CI when we forget to format something. > [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)
[jira] [Comment Edited] (TIKA-4251) [DISCUSS] move to cosium's git-code-format-maven-plugin with google-java-format
[ https://issues.apache.org/jira/browse/TIKA-4251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17859739#comment-17859739 ] Tim Allison edited comment on TIKA-4251 at 6/25/24 6:19 PM: Y. I agree. When I started with checkstyle. I had to modify a lot of files. Any recs for mitigating this? was (Author: talli...@mitre.org): Y. I agree. When I started with checkstyle, it modified nearly every file. Any recs for mitigating this? > [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)
[jira] [Comment Edited] (TIKA-4251) [DISCUSS] move to cosium's git-code-format-maven-plugin with google-java-format
[ https://issues.apache.org/jira/browse/TIKA-4251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17860004#comment-17860004 ] Nicholas DiPiazza edited comment on TIKA-4251 at 6/25/24 6:28 PM: -- I think as long as the plugin isn't transparently formatting code after commit, we are mitigating the risk. This becomes a tool you can plugin to a git hook locally and it will produce PRs with formatted code that is going to be reviewed anyway. and the diffs should be very consumable because we eat the 1-time-format cost and now reformatting again should incur no additional changes. was (Author: ndipiazza): I think as long as the plugin isn't transparently formatting code after commit, we are mitigating the risk. This becomes a tool you can plugin to a git hook locally and it will produce PRs with code that is going to be reviewed anyway. and the diffs should be very consumable because we eat the 1-time-format cost and now reformatting again should incur no additional changes. > [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)
[jira] [Comment Edited] (TIKA-4251) [DISCUSS] move to cosium's git-code-format-maven-plugin with google-java-format
[ https://issues.apache.org/jira/browse/TIKA-4251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17860005#comment-17860005 ] Nicholas DiPiazza edited comment on TIKA-4251 at 6/25/24 6:30 PM: -- i guess we don't even need the maven plugin then. we can use intellij to format all java source one time. Then use the "format code" option in the git commit dialog so that you always have formatted commits (given that you used intellij to commit). this provides the "stop having checkstyle back-and-forth that wastes tons of time" issue was (Author: ndipiazza): i guess we don't even need the maven plugin then. we can use intellij to format all java source one time. Then use the "format code" option in the git commit dialog so that you always have formatted commits (given that you used intellij to commit). this provides the "stop having checkstyle back-and-forth that wastes tons of time) issue > [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)
[jira] [Comment Edited] (TIKA-4251) [DISCUSS] move to cosium's git-code-format-maven-plugin with google-java-format
[ https://issues.apache.org/jira/browse/TIKA-4251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17860005#comment-17860005 ] Nicholas DiPiazza edited comment on TIKA-4251 at 6/25/24 6:42 PM: -- i guess we don't even need the maven plugin then. we can use intellij to format all java source one time. Then use the "format code" option in the git commit dialog so that you always have formatted commits (given that you used intellij to commit). eclipse has this option as well to format on save. same thing as long as they are using eclipse, they will never have checkstyle issues. this provides the "stop having checkstyle back-and-forth that wastes tons of time" issue was (Author: ndipiazza): i guess we don't even need the maven plugin then. we can use intellij to format all java source one time. Then use the "format code" option in the git commit dialog so that you always have formatted commits (given that you used intellij to commit). this provides the "stop having checkstyle back-and-forth that wastes tons of time" issue > [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)