Fix broken #file / #filePath custom SwiftLint rules - #398
Merged
Conversation
Copilot
AI
changed the title
Remove broken #filePath lint rule and fix #file rule in swiftlint.yml
Fix broken #file / #filePath custom SwiftLint rules
Jul 21, 2026
Copilot created this pull request from a session on behalf of
calda
July 21, 2026 20:31
View session
calda
reviewed
Jul 21, 2026
| no_file_literal: | ||
| name: "#file is disallowed" | ||
| regex: "(\\b#file\\b)" | ||
| regex: "(#file\\b)" |
Member
calda
reviewed
Jul 21, 2026
Comment on lines
-41
to
-46
| no_filepath_literal: | ||
| name: "#filePath is disallowed" | ||
| regex: "(\\b#filePath\\b)" | ||
| match_kinds: | ||
| - identifier | ||
| message: "Instead of #filePath, use #fileID." |
Member
There was a problem hiding this comment.
In Airbnb we only use this lint rule for production code (excluding tests), which isn't a use case supported by the package plugin
calda
force-pushed
the
copilot/remove-filepath-rule-update-file-rule
branch
from
July 21, 2026 20:40
8d89c57 to
2aa9006
Compare
calda
marked this pull request as ready for review
July 21, 2026 20:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


The
no_file_literalandno_filepath_literalcustom rules usedmatch_kinds: identifier, but SourceKit tokenizes#file/#filePathaskeyword— so neither rule ever matched anything.no_filepath_literal: No production/non-production distinction in this repo, so blocking#filePathisn't meaningful hereno_file_literal: Changematch_kindstokeyword, fix regex (\bbefore#is a no-op since#isn't a word character), update message to recommend#fileIDby default or#filePathwhen the exact path is needed