`explicit_type_interface` not applied within `guard` statements
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
Research direction
Start by tracing how explicit_type_interface analyzes variable declarations and how the Swift syntax visitor handles guard let bindings; the issue provides a minimal reproducer and a lint command to run. Confirm the sample triggers a violation after the change, and run the rule's related tests to check existing behavior.
Written by the indexing model from the issue text.
Description
New Issue Checklist
- I've Updated SwiftLint to the latest version.
- I've searched for existing GitHub issues.
Bug Description
The explicit_type_interface rule is not applied within guard statements.
guard let x = (nil as Bool?) else { // doesn't trigger a violation
fatalError()
}
$ swiftlint lint --only-rule explicit_type_interface path/to/file.swift
Environment
- SwiftLint version: 0.65.1
- Dominant language
- Swift
- Stars
- 19.8k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from realm/SwiftLint
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
`duplicate_imports` deletes `@testable import X` when `import X` is also presentPossibly taken @Akhrameev claimed this 47 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
`--working-directory` has no effect since 0.65.0Possibly taken @haruna-miyamoto claimed this 57 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
discussion enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
realm/SwiftLint#6622 · 3 comments ·
Maintainers usually reply within 1 day
-
vscode-swiftlint repository is archivedMay be free again A pull request for this issue was closed without being merged. Opendocumentation question
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
realm/SwiftLint#6541 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
area: energy area: panel enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Pallepadehat/WatchMyBattery#11 ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
thecharydev/catnotch#41 ·
Maintainers usually reply within 1 day
-
🎉 Add GinkgoPossibly taken @usual2970 claimed this today. Openaddition
Difficulty 1/5 Under an hour Newbie friendliness 76/100
jaywcjlove/awesome-mac#4442 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
DeveloperAcademy-POSTECH/2026-C6-A03-KIIKICK-iOS#76 ·
Maintainers usually reply within 1 day
-
[java] TestClassWithoutTestCases: document that abstract classes and interfaces are not checkedOpen
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 2 days