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


##########
gradle/validation/ast-grep/rules/java-patterns.yml:
##########
@@ -133,3 +133,32 @@ constraints:
 severity: error
 message: Avoid pre-sized arrays in Collection#toArray calls
 note: Prefer `toArray($TYPE[]::new)` or `toArray(new $TYPE[0])`
+---
+# yaml-language-server: 
$schema=https://raw.githubusercontent.com/ast-grep/ast-grep/refs/heads/main/schemas/java_rule.json
+id: raw-global-doc-id-narrowing
+language: java
+rule:
+  any:
+    - pattern: (int) ($DOC - $CTX.docBase)
+    - pattern: (int) ($DOC - docBase)

Review Comment:
   do you mind adding a trivial test? it helps to maintain them and upgrade 
ast-grep and so on.



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