Skip to content

Conversation

@dsmiley
Copy link
Contributor

@dsmiley dsmiley commented Jan 5, 2026

Review this commit by commit, not all at once. The "tidy" one is the big one; maybe skim it a little. I'd prefer to land 3 commits :

  • tidy + "Use { not ( when passing lambdas" squashed into it.
  • add the commit hash of the above commit to .git-blame-ignore-revs
  • spotless.gradle changes to invoke the formatting on gradle files

The tidying -- prefer to land this on not only main, branch_10x, and branch_10_0.
To reduce risk, branch_10_0 doesn't need spotless.gradle.

BTW Lucene has been doing this for awhile now. I took the same configuration choices. Didn't take its build code because they shifted to Java based Gradle plugins.

Copy link
Contributor

@epugh epugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

Copy link
Contributor

@malliaridis malliaridis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding lint checks and linting on these files was on my bucket list. It's nice to see these files being formatted with consistent indentations now. 😄

I've added a few comments as thoughts while going over some formatting cases. But overall it looks good to me as is already. :)

Comment on lines +324 to +335
opts << [
'-overview',
project.file("${srcDirs[0]}/overview.html")
]
opts << [
'-sourcepath',
srcDirs.join(File.pathSeparator)
]
opts << [
'-subpackages',
'org.apache.solr'
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious what rule was applied here that caused the line breaks. It doesn't look like max line length to me, as we are under 50 characters in some of these lines. I would assume "chop down arrays when more than 1" would be the rule here, but it did not format the values below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes no sense to me -- which is sad because one would expect consistency to be a virtue of a formatter

Comment on lines 67 to +76
text = text.replaceAll(
/package (.+)/,
'''package $1
'''package $1
import javax.annotation.processing.Generated;
import org.apache.lucene.queryparser.charstream.CharStream;'''.trim())
text = text.replace(
"/** Token Manager. */",
'''/** Token Manager. */
"/** Token Manager. */",
'''/** Token Manager. */
@Generated("JavaCC")'''
)
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part does not look very consistent, one case has the closing parentheses at the end, the other in a new line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. I manually adjusted the closing parenthesis and the formatter didn't fight me on it. So consider this one spot fixed.

Comment on lines +107 to +110
public void close() {
// no-op. we close this stream manually.
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there is some kind of inconsistency here with the spaces. We have 6 spaces indentation for some reason here, I believe a result of two different rules with different indentation. Is this expected?

Plus, I believe the closing curly bracket should be on the same indentation as the line that contains the opening bracket?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RE indentation: wow... ugh...

RE braces: I don't see the issue

Comment on lines +30 to +32
withSignedArtifacts = {

->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting to so that this is a valid format. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that newline is weird

@dsmiley
Copy link
Contributor Author

dsmiley commented Jan 7, 2026

I really appreciate the detailed inspection @malliaridis ! I am too dissatisfied with inexplicable inconsistencies to accept this as-is. Furthermore, this formatter is very slow. It takes a good deal longer than java and there's way more java. The Lucene project made it disable-able because of how slow it is.

I think instead I'm simply going to have IntelliJ do a one-off reformat of all the gradle files, according to the rules we have in .editorconfig that I added some months back. I just did this right now and I'm not seeing inexplicable things at the spots you drew attention to. I'll do a new PR, as the approach is different.

@dsmiley dsmiley closed this Jan 7, 2026
@dsmiley
Copy link
Contributor Author

dsmiley commented Jan 7, 2026

I stashed aside a simpler spotless config to do very basic things line removing trailing whitespace, ending newline, no tabs. I'll defer that for later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants