-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
bugUnexpected and reproducible misbehavior.Unexpected and reproducible misbehavior.
Description
New Issue Checklist
- I've Updated SwiftLint to the latest version.
- I've searched for existing GitHub issues.
Bug Description
Previously, with SwiftLint 0.59.1, this code does not trigger a line_length warning when ignores_function_declarations: true:
public class FileDataStore {
public init(persistenceService: PersistenceService, syncService: SyncService, notificationService: NotificationService) throws {
// ...
}
public func doSomething(persistenceService: PersistenceService, syncService: SyncService, notificationService: NotificationService) throws {
// ...
}
}$ swiftlint Modules/Sources/Stores/DataStore/FileDataStore/FileDataStore.swift
Linting Swift files at paths Modules/Sources/Stores/DataStore/FileDataStore/FileDataStore.swift
Linting 'FileDataStore.swift' (1/1)
Done linting! Found 0 violations, 0 serious in 1 file.
After upgrading to SwiftLint 0.61.0, the line_length rule (still with ignores_function_declarations: true) now warns about a violation on the public init line, but not on the public func line.
$ swiftlint Modules/Sources/Stores/DataStore/FileDataStore/FileDataStore.swift
Linting Swift files at paths Modules/Sources/Stores/DataStore/FileDataStore/FileDataStore.swift
Linting 'FileDataStore.swift' (1/1)
/[…]/Modules/Sources/Stores/DataStore/FileDataStore/FileDataStore.swift:2:1: warning: Line Length Violation: Line should be 120 characters or less; currently it has 132 characters (line_length)
Done linting! Found 1 violation, 0 serious in 1 file.
Environment
- SwiftLint version (run
swiftlint versionto be sure): 0.61.0 - Xcode version (run
xcodebuild -versionto be sure): Xcode 16.4 (Build version 16F6) - Installation method used (Homebrew, CocoaPods, building from source, etc): Homebrew
- Configuration file:
only_rules:
- line_length
line_length:
ignores_function_declarations: trueAre you using nested configurations? No
Metadata
Metadata
Assignees
Labels
bugUnexpected and reproducible misbehavior.Unexpected and reproducible misbehavior.