Skip to content

Commit

Permalink
invert SwiftLint’s default trailing comma rule for compability with S…
Browse files Browse the repository at this point in the history
…wiftFormat

Upon realising this clash, I hoped we could get away with just using
SwiftLint, which does have some style rules. But it doesn’t enforce some
basic things like indentation. I hope that there aren’t further clashes
between the two tools, but we won’t find out until we write more code.
  • Loading branch information
lawrence-forooghian committed Aug 1, 2024
1 parent bcb273e commit aaad153
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@ identifier_name:
type_name: *no_length_checks

generic_type_name: *no_length_checks

# For compatibility with SwiftFormat
trailing_comma:
mandatory_comma: true
13 changes: 8 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,29 @@ let package = Package(
platforms: [
.macOS(.v10_13),
.iOS(.v12),
.tvOS(.v12)
.tvOS(.v12),
],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "AblyChat",
targets: ["AblyChat"])
targets: ["AblyChat"]
),
],
dependencies: [
.package(url: "https://github.com/ably/ably-cocoa", from: "1.2.0"),
.package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", from: "0.55.1"),
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.54.0")
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.54.0"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "AblyChat", dependencies: [.product(name: "Ably", package: "ably-cocoa")], swiftSettings: [.enableExperimentalFeature("StrictConcurrency")]),
name: "AblyChat", dependencies: [.product(name: "Ably", package: "ably-cocoa")], swiftSettings: [.enableExperimentalFeature("StrictConcurrency")]
),
.testTarget(
name: "AblyChatTests",
dependencies: ["AblyChat"])
dependencies: ["AblyChat"]
),
]
)
3 changes: 0 additions & 3 deletions Sources/AblyChat/AblyChat.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
// The Swift Programming Language
// https://docs.swift.org/swift-book

import Ably
1 change: 1 addition & 0 deletions Tests/AblyChatTests/AblyChatTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import XCTest

final class AblyChatTests: XCTestCase {
// swiftlint:disable:next empty_xctest_method
func testExample() throws {
// XCTest Documentation
// https://developer.apple.com/documentation/xctest
Expand Down

0 comments on commit aaad153

Please sign in to comment.