-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Issue #16836: New Check HexLiteralCase #17233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot,
Please read and watch videos at Starting_Development.
Please make CI green. There are videos on CI handling.
items:
package resources.com.puppycrawl.tools.checkstyle.checks.hexliteralcase; | ||
|
||
public class InputHexLiteralCaseCheck { | ||
int i = 0xabc; // violation 'Should use uppercase hexadecimal digit instead of 'a, b, c'.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove instead of 'a, b, c'
from message of Check, it is confusing.
Should use uppercase hexadecimal letters
.
@@ -5,6 +5,7 @@ descendant.token.sum.max=Общее количество {0} превышает | |||
descendant.token.sum.min=Общее количество {0} меньше, чем минимум {1} для ''{2}''. | |||
final.parameter=Параметр {0} должен быть final. | |||
forbid.escaped.unicode.char=Избегайте использования экранирующих символов Unicode. | |||
hex.Literal=??????? ???????????? ????????????????? ????? ? ??????? ???????? ?????? ''{0}''. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try to use uncode.
same for others.
import com.puppycrawl.tools.checkstyle.api.TokenTypes; | ||
|
||
/** | ||
* <div>Checks that hexadecimal literals are defined using uppercase letters (A–F) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(A�F)
lets avoid unicode here.
* </li> | ||
* </ul> | ||
* | ||
* @since null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10.26.0
@@ -0,0 +1,76 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be template file that will generate src/site/xdoc/checks/misc/hexliteralcase.xml
,please create it.
Issue: #16836
New HexLiteralCase check that verifies hexadecimal number literals contain only uppercase letters (A–F). If any lowercase letters are found, a violation is raised with the message:
Should use uppercase hexadecimal digit instead of ''{0}''
where {0} is replaced with that violated digits.