Skip to content

Commit 05aad3a

Browse files
committed
Fixing Linting issue
1 parent 0c3f5a0 commit 05aad3a

29 files changed

Lines changed: 18 additions & 12 deletions

Examples/Completed/conditionals/code.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,15 @@ case (-2...2, -2...2):
8282
print("(\(somePoint.0), \(somePoint.1)) is inside the box")
8383
default:
8484
print("(\(somePoint.0), \(somePoint.1)) is outside of the box")
85+
}
86+
87+
// Switch with value binding
88+
let anotherPoint = (2, 0)
89+
switch anotherPoint {
90+
case (let x, 0):
91+
print("on the x-axis with an x value of \(x)")
92+
case (0, let y):
93+
print("on the y-axis with a y value of \(y)")
94+
case let (x, y):
95+
print("somewhere else at (\(x), \(y))")
8596
}

Sources/SyntaxKit/PatternConvertible.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88
// Permission is hereby granted, free of charge, to any person
99
// obtaining a copy of this software and associated documentation
10-
// files (the "Software"), to deal in the Software without
10+
// files (the Software), to deal in the Software without
1111
// restriction, including without limitation the rights to use,
1212
// copy, modify, merge, publish, distribute, sublicense, and/or
1313
// sell copies of the Software, and to permit persons to whom the
@@ -17,7 +17,7 @@
1717
// The above copyright notice and this permission notice shall be
1818
// included in all copies or substantial portions of the Software.
1919
//
20-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20+
// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
2121
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
2222
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
2323
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
disabled_rules:
2+
- file_length
3+
- closure_body_length
4+
- function_body_length

Tests/SyntaxKitTests/BlackjackTests.swift renamed to Tests/SyntaxKitTests/Integration/BlackjackTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ internal struct BlackjackTests {
7070
#expect(normalizedGenerated == normalizedExpected)
7171
}
7272

73-
// swiftlint:disable:next function_body_length
7473
@Test internal func testFullBlackjackCardExample() throws {
75-
// swiftlint:disable:next closure_body_length
7674
let syntax = Struct("BlackjackCard") {
7775
Enum("Suit") {
7876
EnumCase("spades").equals("")

Tests/SyntaxKitTests/CommentTests.swift renamed to Tests/SyntaxKitTests/Integration/CommentTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import Testing
33
@testable import SyntaxKit
44

55
internal struct CommentTests {
6-
// swiftlint:disable:next function_body_length
76
@Test internal func testCommentInjection() {
8-
// swiftlint:disable:next closure_body_length
97
let syntax = Group {
108
Struct("Card") {
119
Variable(.let, name: "rank", type: "Rank")

Tests/SyntaxKitTests/CompleteProtocolsExampleTests.swift renamed to Tests/SyntaxKitTests/Integration/CompleteProtocolsExampleTests.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ import Foundation
3131
import SyntaxKit
3232
import Testing
3333

34-
// swiftlint:disable function_body_length
3534
@Suite internal struct CompleteProtocolsExampleTests {
3635
// MARK: - Helper Functions
3736

3837
private func createProtocolsDSL() -> Group {
39-
// swiftlint:disable:next closure_body_length
4038
Group {
4139
// MARK: - Protocol Definition
4240
Protocol("Vehicle") {
@@ -297,4 +295,3 @@ import Testing
297295
#expect(normalizedCode == normalizedGenerated)
298296
}
299297
}
300-
// swiftlint:enable function_body_length

Tests/SyntaxKitTests/ConditionalsExampleTests.swift renamed to Tests/SyntaxKitTests/Integration/ConditionalsExampleTests.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import Testing
44
@testable import SyntaxKit
55

66
@Suite internal struct ConditionalsExampleTests {
7-
// swiftlint:disable function_body_length
87
@Test("Completed conditionals DSL generates expected Swift code")
98
internal func testCompletedConditionalsExample() throws {
109
// Build DSL equivalent of Examples/Completed/conditionals/dsl.swift
11-
// swiftlint:disable:next closure_body_length
10+
1211
let program = Group {
1312
// MARK: Basic If Statements
1413
Variable(.let, name: "temperature", type: "Int", equals: "25")
@@ -354,5 +353,4 @@ import Testing
354353

355354
#expect(generated == expected)
356355
}
357-
// swiftlint:enable function_body_length
358356
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)