Skip to content

Commit

Permalink
Rewrite let_var_whitespace rule with SwiftSyntax (#5367)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplyDanny authored Nov 29, 2023
1 parent ff1e966 commit 8cb2cf9
Show file tree
Hide file tree
Showing 12 changed files with 235 additions and 246 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
* Rewrite `multiline_literal_brackets` rule using SwiftSyntax, fixing some
false positives that would happen when comments are present.
[Marcelo Fabri](https://github.com/marcelofabri)

* Rewrite `let_var_whitespace` rule using SwiftSyntax, fixing false positives
when attributes attached to declarations were spread over multiple lines.
[SimplyDanny](https://github.com/SimplyDanny)
[#4801](https://github.com/realm/SwiftLint/pull/4801)

#### Bug Fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import SwiftSyntax
@SwiftSyntaxRule
struct DeploymentTargetRule {
fileprivate typealias Version = DeploymentTargetConfiguration.Version

var configuration = DeploymentTargetConfiguration()

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import SwiftLintCore

// swiftlint:disable:next blanket_disable_command
// swiftlint:disable let_var_whitespace

@AutoApply
struct DiscouragedDirectInitConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = DiscouragedDirectInitRule
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import SwiftLintCore

// swiftlint:disable:next blanket_disable_command
// swiftlint:disable let_var_whitespace

@AutoApply
struct IndentationWidthConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = IndentationWidthRule
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import SwiftLintCore

// swiftlint:disable:next blanket_disable_command
// swiftlint:disable let_var_whitespace

@AutoApply
struct TestCaseAccessibilityConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = TestCaseAccessibilityRule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ typealias EmptyXCTestMethodConfiguration = UnitTestConfiguration<EmptyXCTestMeth
typealias SingleTestClassConfiguration = UnitTestConfiguration<SingleTestClassRule>
typealias NoMagicNumbersConfiguration = UnitTestConfiguration<NoMagicNumbersRule>

// swiftlint:disable:next blanket_disable_command
// swiftlint:disable let_var_whitespace

@AutoApply
struct UnitTestConfiguration<Parent: Rule>: SeverityBasedRuleConfiguration {
@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import SwiftLintCore

// swiftlint:disable:next blanket_disable_command
// swiftlint:disable let_var_whitespace

@AutoApply
struct UnusedDeclarationConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = UnusedDeclarationRule
Expand Down
Loading

0 comments on commit 8cb2cf9

Please sign in to comment.