-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
enhancementIdeas for improvements of existing features and rules.Ideas for improvements of existing features and rules.
Description
New Issue Checklist
- I've Updated SwiftLint to the latest version.
- I've searched for existing GitHub issues.
Bug Description
When declaring a nested type in its own file, the file_name rule sees a violation if the file is named according to that nested type's fully qualified name. For example, naming the following file Nested.MyType.swift is a violation:
// Nested.MyType.swift
enum Nested {
struct MyType {
}
}$ swiftlint --config config.yaml Nested.MyType.swift
Linting Swift files at paths Nested.MyType.swift
Linting 'Nested.MyType.swift' (1/1)
/tmp/Nested.MyType.swift:1:1: warning: File Name Violation: File name should match a type or extension declared in the file (if any). (file_name)
Done linting! Found 1 violation, 0 serious in 1 file.The file_name rule only allows the above file to be named Nested.swift or MyType.swift.
Environment
- SwiftLint version: 0.57.0
- Xcode version: Xcode 16.0, Build version 16A242d
- Installation method used: Homebrew as well as building from source
- Configuration file:
opt_in_rules:
- file_nameAre you using nested configurations? No
Metadata
Metadata
Assignees
Labels
enhancementIdeas for improvements of existing features and rules.Ideas for improvements of existing features and rules.