rmuir commented on code in PR #14849:
URL: https://github.com/apache/lucene/pull/14849#discussion_r2168076807


##########
gradle/validation/ast-grep/rules/java-patterns.yml:
##########
@@ -21,3 +21,28 @@ rule:
 severity: error
 message: illegal use of `var` keyword with generic instance creation
 note: add explicit typing on the RHS when using `var`
+---
+# yaml-language-server: 
$schema=https://raw.githubusercontent.com/ast-grep/ast-grep/refs/heads/main/schemas/java_rule.json
+id: javadoc-style-license-header
+language: java
+rule:
+  matches: java-license
+  regex: "^/[*][*]"
+severity: error
+message: license should be a non-javadoc block comment
+---
+# yaml-language-server: 
$schema=https://raw.githubusercontent.com/ast-grep/ast-grep/refs/heads/main/schemas/java_rule.json
+id: license-after-package
+language: java
+rule:
+  kind: package_declaration
+  precedes:
+    matches: java-license
+    # allow anything in between (e.g. import statements)
+    stopBy: end
+ignores:
+  # TODO: something not right with regeneration of this lone parser
+  - "**/StandardSyntaxParser.java"
+  - "**/StandardSyntaxParserTokenManager.java"

Review Comment:
   Beefed up the check a bit and the same parser's tokenmanager has similar 
issues. See comment on the commit, I think maybe this parser hasn't been 
regenerated in a while? Maybe it is just missing from the gradle task...
   
   
https://github.com/apache/lucene/blob/4b47fb1a3113d22bca6cd8c1664529ef2d7f4877/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java#L3-L20



-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to