Make custom rule `rule_id` more specific

This commit is contained in:
Danny Mösch 2023-03-11 14:44:17 +01:00
parent bd77cbcf6e
commit 1940e0e2d2
2 changed files with 1 additions and 2 deletions

View File

@ -73,7 +73,7 @@ custom_rules:
included: Source/SwiftLintFramework/Rules/.+/\w+\.swift
name: Rule ID
message: Rule IDs must be all lowercase, snake case and not end with `rule`
regex: identifier:\s*("\w+_rule"|"\S*[^a-z_]\S*")
regex: ^\s+identifier:\s*("\w+_rule"|"\S*[^a-z_]\S*")
severity: error
fatal_error:
name: Fatal Error

View File

@ -147,7 +147,6 @@ private extension PreferSelfTypeOverTypeOfSelfRule {
correctionPositions.append(function.positionAfterSkippingLeadingTrivia)
// swiftlint:disable:next rule_id
let base = IdentifierExprSyntax(identifier: "Self")
let baseWithTrivia = base
.with(\.leadingTrivia, function.leadingTrivia ?? .zero)