File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
delphi-checks/src/main/java/au/com/integradev/delphi/checks Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
1414### Changed
1515
16+ - Include "found" and "expected" values for issues messages in ` LowercaseKeyword ` .
1617- Exclude ` J ` and ` K ` by default in ` ShortIdentifier ` .
1718
1819## [ 1.6.0] - 2024-05-31
Original file line number Diff line number Diff line change 3434@ DeprecatedRuleKey (ruleKey = "LowerCaseReservedWordsRule" , repositoryKey = "delph" )
3535@ Rule (key = "LowercaseKeyword" )
3636public class LowercaseKeywordCheck extends DelphiCheck {
37- private static final String MESSAGE = "Lowercase this keyword." ;
38-
3937 @ RuleProperty (
4038 key = "excludedKeywords" ,
4139 description = "Comma-delimited list of keywords that this rule ignores (case-insensitive)." )
@@ -53,10 +51,15 @@ public void start(DelphiCheckContext context) {
5351 @ Override
5452 public DelphiCheckContext visit (DelphiNode node , DelphiCheckContext context ) {
5553 if (isIssueNode (node )) {
54+ String actual = node .getToken ().getImage ();
55+ String expected = actual .toLowerCase ();
56+
5657 context
5758 .newIssue ()
5859 .onFilePosition (FilePosition .from (node .getToken ()))
59- .withMessage (MESSAGE )
60+ .withMessage (
61+ String .format (
62+ "Lowercase this keyword (found: \" %s\" expected: \" %s\" )." , actual , expected ))
6063 .report ();
6164 }
6265 return super .visit (node , context );
You can’t perform that action at this time.
0 commit comments