Skip to content

Commit ee7164d

Browse files
committed
Refactor full-width quotation mark check in DDLNode handling to iterate over object names. This improves detection of violations related to full-width double quotation marks in identifiers.
1 parent 58a7973 commit ee7164d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

sqle/driver/mysql/rule/rule.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3734,8 +3734,11 @@ func (g *checkSpacesAroundTheStringVisitor) Leave(n ast.Node) (node ast.Node, ok
37343734
func checkFullWidthQuotationMarks(input *RuleHandlerInput) error {
37353735
switch input.Node.(type) {
37363736
case ast.DDLNode:
3737-
if strings.Contains(input.Node.Text(), "“") {
3738-
addResult(input.Res, input.Rule, input.Rule.Name)
3737+
for _, name := range getObjectNames(input.Node) {
3738+
if strings.ContainsAny(name, `“”`) { // “” are the full-width double quotation marks (U+201C and U+201D)
3739+
addResult(input.Res, input.Rule, input.Rule.Name)
3740+
return nil
3741+
}
37393742
}
37403743
}
37413744
return nil

0 commit comments

Comments
 (0)