-
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
When a file has a macro
type in it, that type isn't considered by the file_name
rule when determining if the name of the file matches one of the types within.
The following code triggers a file_name
issue within a file named MyMacro.swift
// MyMacro.swift
public macro MyMacro() = #externalMacro(module: "MyMacros", type: "MyMacro")
struct MyStruct {}
Mention the command or other SwiftLint integration method that caused the issue. Include stack traces or command output.
$ swiftlint lint MyMacro.swift
MyMacro.swift:1:1: warning: File Name Violation: File name should match a type or extension declared in the file (if any) (file_name)
Environment
- SwiftLint version (run
swiftlint version
to be sure): 0.58.2 - Xcode version (run
xcodebuild -version
to be sure): 16B40 - Installation method used (Homebrew, CocoaPods, building from source, etc): Homebrew
Metadata
Metadata
Assignees
Labels
bugUnexpected and reproducible misbehavior.Unexpected and reproducible misbehavior.