This is an automated email from the ASF dual-hosted git repository.
gian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new b3c32d00392 Add checkstyle rule to prohibit class names that begin
with `_` and `$` (#18155)
b3c32d00392 is described below
commit b3c32d00392cab29420a2efea98b6a80fc78543d
Author: Abhishek Radhakrishnan <[email protected]>
AuthorDate: Wed Jun 18 17:09:15 2025 -0400
Add checkstyle rule to prohibit class names that begin with `_` and `$`
(#18155)
* Include _* and $* as java class names can start with those characters.
Add these character regexes for completeness.
This ensures all allowed starting characters for java classes are covered.
* Add checkstyle rule to prohibit class names that begin with _ and $
---
.github/workflows/ci.yml | 2 +-
codestyle/checkstyle.xml | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 70da61e9449..3b9edb61565 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- pattern: [ "A*,G*,R*", "B*,O*,S*,X*,Y*,Z*", "C*,E*", "D*,J*,K*",
"F*,H*,U*", "I*,N*,T*", "L*,Q*,W*", "M*,P*,V*"]
+ pattern: [ "A*,G*,R*", "B*,O*,S*,X*,Y*,Z*", "C*,E*", "D*,J*,K*",
"F*,H*,U*", "I*,N*,T*", "L*,Q*,W*", "M*,P*,V*,_*,$*"]
uses: ./.github/workflows/worker.yml
with:
script: .github/scripts/run-unit-tests.sh -Dtest='${{ matrix.pattern }}'
-Dmaven.test.failure.ignore=true
diff --git a/codestyle/checkstyle.xml b/codestyle/checkstyle.xml
index 41b77b0b7e1..2be3aa292bf 100644
--- a/codestyle/checkstyle.xml
+++ b/codestyle/checkstyle.xml
@@ -31,7 +31,10 @@
<module name="NewlineAtEndOfFile"/>
<module name="FileTabCharacter"/>
-
+ <module name="RegexpOnFilename">
+ <property name="fileNamePattern" value="^([_$]).*"/>
+ <property name="fileExtensions" value="java"/>
+ </module>
<!-- Added as per the issue #7384 - Prohibit @author tags in Javadoc -->
<module name="RegexpSingleline">
<property name="format" value="^\s*\*\s*@author" />
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]