dweiss commented on a change in pull request #1950:
URL: https://github.com/apache/lucene-solr/pull/1950#discussion_r501473380
##########
File path: gradle/validation/spotless.gradle
##########
@@ -0,0 +1,31 @@
+
+def resources = scriptResources(buildscript)
+
+allprojects { prj ->
+ plugins.withType(JavaPlugin) {
+ prj.apply plugin: 'com.diffplug.spotless'
+
+ spotless {
+ java {
+ licenseHeaderFile file("${resources}/asl-header.txt"), '^(\\s*package)'
+ lineEndings 'UNIX'
+ endWithNewline()
+ googleJavaFormat('1.9')
+
+ // Known problematic files.
+ targetExclude "**/HTMLStripCharFilter.java",
"**/UAX29URLEmailTokenizerImpl.java",
+ "**/PatternParser.java", "**/BuildNavDataFiles.java",
"**/CheckLinksAndAnchors.java",
+ "**/TestSubQueryTransformer.java"
Review comment:
I was thinking the other way around, actually always apply formatting
after they run so that you get the same code in the output after regenerating
these source files. This should be idempotent and have clean formatting too.
I excluded these particular files because they break the formatter... Some
of them have no package and others cause stack overflows -
https://github.com/google/google-java-format/issues/528
##########
File path: gradle/validation/spotless.gradle
##########
@@ -0,0 +1,31 @@
+
+def resources = scriptResources(buildscript)
+
+allprojects { prj ->
+ plugins.withType(JavaPlugin) {
+ prj.apply plugin: 'com.diffplug.spotless'
+
+ spotless {
+ java {
+ licenseHeaderFile file("${resources}/asl-header.txt"), '^(\\s*package)'
+ lineEndings 'UNIX'
+ endWithNewline()
+ googleJavaFormat('1.9')
+
+ // Known problematic files.
+ targetExclude "**/HTMLStripCharFilter.java",
"**/UAX29URLEmailTokenizerImpl.java",
+ "**/PatternParser.java", "**/BuildNavDataFiles.java",
"**/CheckLinksAndAnchors.java",
+ "**/TestSubQueryTransformer.java"
Review comment:
Ok, fair enough. I also suggested elsewhere that we might want to just
move those generated files into a different sourceset so that it's clear they
are generated and they can be wiped easier upon regeneration. Or is there value
in keeping them together, do you think?
##########
File path: gradle/validation/spotless.gradle
##########
@@ -0,0 +1,31 @@
+
+def resources = scriptResources(buildscript)
+
+allprojects { prj ->
+ plugins.withType(JavaPlugin) {
+ prj.apply plugin: 'com.diffplug.spotless'
+
+ spotless {
+ java {
+ licenseHeaderFile file("${resources}/asl-header.txt"), '^(\\s*package)'
+ lineEndings 'UNIX'
+ endWithNewline()
+ googleJavaFormat('1.9')
+
+ // Known problematic files.
+ targetExclude "**/HTMLStripCharFilter.java",
"**/UAX29URLEmailTokenizerImpl.java",
+ "**/PatternParser.java", "**/BuildNavDataFiles.java",
"**/CheckLinksAndAnchors.java",
+ "**/TestSubQueryTransformer.java"
Review comment:
Ok, I'll see what can be done when I get there.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]