Fix wrongly reported errors when an unindented line is part of a comment.
This commit is contained in:
@@ -61,7 +61,7 @@ func CheckIndentStyleRule(ruleValue string, line string) *LineCheckResult {
|
||||
}
|
||||
|
||||
if strings.ToLower(ruleValue) == "tab" {
|
||||
if IsIndentedWithSpaces(line) {
|
||||
if IsIndentedWithSpaces(line) && !strings.HasPrefix(line, " *") {
|
||||
return &LineCheckResult{isOk: false, messageIfNotOk: "starts with space instead of tab"}
|
||||
} else if IsIndentedWithMixedTabsAndSpaces(line) && !IsIndentedWithTabsThenCommentLine(line) {
|
||||
return &LineCheckResult{isOk: false, messageIfNotOk: "indented with mix of tabs and spaces instead of just tabs"}
|
||||
|
||||
Reference in New Issue
Block a user