dsmiley commented on code in PR #4569:
URL: https://github.com/apache/solr/pull/4569#discussion_r3520222408


##########
gradle/validation/rat-sources.gradle:
##########
@@ -104,84 +108,99 @@ allprojects {
     description = 'Runs Apache Rat checks.'
 
     ratClasspath.from(rootProject.configurations.ratDeps)
+    
ratConfig.set(rootProject.layout.projectDirectory.file("gradle/validation/rat-config.xml"))
 
     def defaultScanFileTree = project.fileTree(projectDir, {
-      // Only check files tracked by git — skip untracked/gitignored files
-      // (IDE artifacts, AI assistant configs, etc.)
       def trackedFiles = gitTrackedFiles(projectDir)
       if (trackedFiles != null) {
-        exclude { element ->
-          // Allow directories through (they are just containers), exclude 
untracked files
-          !element.isDirectory() && 
!trackedFiles.contains(element.relativePath.pathString)
-        }
+        // Git checkout: only scan files in the git index — naturally excludes 
build
+        // output, gitignored files, and untracked files without explicit 
patterns.
+        include { f -> f.isDirectory() || 
trackedFiles.contains(f.relativePath.pathString) }
+
+        // The following are excluded from the source release, thus no header 
needed
+        exclude "dev-docs"
+        exclude "**/AGENTS.md"
+        exclude "**/.*" // e.g. .gradle, .github, .junie, .gitignore, etc.
+      } else {
+        // Source release (no git): scan everything, exclude generated/ignored 
paths manually.
+        include "**"

Review Comment:
   The no-git path is is the source release, tested by the smoketester. I was 
tempted to make that the only path for RAT, albeit it'd suck to get no PR time 
feedback on an oversight.  So for the source release... we can ensure that the 
smoketester runs RAT by itself before any other source checking... thus nothing 
is generated yet.  But I suppose .gradle is a concern... hmm; I will add an 
exclusion rule for that.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to