SwiftLint
Copilot instructions20k starsChanged 2 years agoMITView on GitHub
You are working on SwiftLint, a linter for Swift code that enforces coding style and conventions. It helps maintain a clean and consistent codebase by identifying and reporting issues in Swift files. It can even automatically fix some of these issues. Linting rules are defined in Source/SwiftLintBuiltInRules/Rules. If someone mentions a rule by its identifier that is in "snakecase" (e.g., rulename), you can usually find the rule's implementation file named "UpperCamelCaseRule.swift" (e.g., <RuleName>Rule.swift) in one of the sub-folders depending on…
We split this copilot-instructions.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
All changes need to pass swift test as well as running SwiftLint on itself.
≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are working on SwiftLint, a linter for Swift code that enforces coding style and conventions. It helps maintain a clean and consistent codebase by identifying and reporting issues in Swift files. It can even automatically fix some of these issues.
Linting rules are defined in Source/SwiftLintBuiltInRules/Rules. If someone mentions a rule by its identifier that is in "snake_case" (e.g., rule_name), you can usually find the rule's implementation file named "UpperCamelCaseRule.swift" (e.g., <RuleName>Rule.swift) in one of the sub-folders depending on the rule's kind. Specific configurations for rules are located in the RuleConfigurations folder, which contains files named as <RuleName>Configuration.swift (e.g., IdentifierNameConfiguration.swift).
User-facing changes must be documented in the CHANGELOG.md file, which is organized by version. New entries always go into the "Main" section. They give credit to the person who has made the change and they reference the issue which has been fixed by the change.
All changes on configuration options must be reflected in Tests/IntegrationTests/Resources/default_rule_configurations.yml. This can be achieved by running swift run swiftlint-dev rules register. Running this command is also necessary when new rules got added or removed to (un-)register them from/in the list of built-in rules and tests verifying all examples in rule descriptions.
For some rules, there are dedicated tests in Tests/BuiltInRulesTests. However, they are typically not required as all the examples in the rule descriptions are automatically tested. The examples in the rule descriptions are also used to generate documentation for the rules. If an example presents a very pathological case, that's helpful for testing but not for user documentation, you can add the excludeFromDocumentation: true parameter to the example initializer. Important is that all examples in the rule description are verified by running <RuleName>RuleGeneratedTests for rule modified rules.
The functionality of configurations does not need to be tested explicitly either. But all options should be verified in the provided examples with the configuration: parameter as well.
All changes need to pass swift test as well as running SwiftLint on itself. The command swift run swiftlint run in the root directory of the project does that.
Trending
Quiet since August.about the whole repository
Who's talking about realm/SwiftLint
- Stack Overflow“SwiftLint: Exclude file for specific rule”Stack Overflow · Aug 14, 2017 · 117 votes
- swiftlang/swift-syntax“Distribute a prebuilt swift-syntax binary”GitHub · Jan 9, 2024 · 98 reactions
- firebase/firebase-ios-sdk“App Store Connect warnings that API usage is not being declared by Firebase ”GitHub · Mar 14, 2024 · 74 reactions
- Stack Overflow“SwiftLint: Exclude file for specific rule”Stack Overflow · Dec 29, 2016 · 29 votes
- Stack Overflow“Disable some SwiftLint rules for test target/unit tests files”Stack Overflow · Sep 19, 2018 · 20 votes
The biggest 5 of 84 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 84
Talked about on GitHub, Stack Overflow, Hacker News, the web and Bluesky (84 times).
On GitHub · 45
- Jan 9, 2024Distribute a prebuilt swift-syntax binary — swiftlang/swift-syntax98 reactions · 68 comments
- Mar 14, 2024App Store Connect warnings that API usage is not being declared by Firebase — firebase/firebase-ios-sdk74 reactions · 77 comments
- Jan 26, 2024Support Swift — diffplug/spotless12 reactions
- Jul 14, 2020Optionally support emitting errors and test failures using Github Actions reporter format (like SwiftLint) — cpisciotta/xcbeautify11 reactions · 9 comments
- Mar 9, 2023Feature Request: Support for "Run Build Tool Plug-ins" — nicklockwood/SwiftFormat8 reactions
40 more on GitHub
- Jul 9, 2020Prefer AnyObject over class in protocol definitions — airbnb/swift8 reactions · 2 comments
- Oct 17, 2016Add SwiftLint support — vapor/vapor7 reactions · 1 comment
- Aug 6, 2023Sentry CLI installed via Homebrew, used in Xcode Build Phase gives 'not installed' message (iOS SDK) — getsentry/sentry-docs5 reactions · 4 comments
- Dec 9, 2018Build fails with swiftlint 0.29.1 — facebookarchive/facebook-swift-sdk5 reactions · 4 comments
- Feb 24, 2025CL - Added SwiftLint Plugins — masterfabric-mobile/swift-camp4 reactions
- Jun 24, 2021How to use SwiftLint in SPM project — onmyway133/blog4 reactions
- Sep 30, 2020Distribution via CocoaPods — MakeAWishFoundation/SwiftyMockyCLI4 reactions · 8 comments
- Jul 1, 2020Add swiftlint — actions/runner-images4 reactions · 7 comments
- Sep 15, 2016Popular formulae with bottling trouble on 10.12 — Homebrew/homebrew-core4 reactions · 50 comments
- May 27, 2024Support artifact bundle for macOS — mikeger/XcodeSelectiveTesting3 reactions · 6 comments
- Jan 18, 2024How to add dependencies only for debug version in Package.swift — swiftlang/swift-package-manager3 reactions
- Jul 30, 2017[SourceKit] Add documentation range in structure (SR-2487) — swiftlang/swift3 reactions · 7 comments
- Feb 20, 2017Add Code Linting — bizz84/SwiftyStoreKit3 reactions · 5 comments
- Oct 30, 2016Formulae without Sierra bottles — Homebrew/homebrew-core3 reactions · 5 comments
- Jan 6, 2026Update SwiftLint invocation to work with its 0.60.0 Docker img — Automattic/a8c-ci-toolkit-buildkite-plugin2 reactions
- Oct 15, 2025swiftlint: 0.61.0 -> 0.62.1 — NixOS/nixpkgs2 reactions · 3 comments
- Dec 24, 2024RuleIdea: RedundantSendable — nicklockwood/SwiftFormat2 reactions · 1 comment
- Aug 19, 2024swiftlint: 0.55.1 -> 0.56.1 — NixOS/nixpkgs2 reactions
- May 27, 2024Fix Swiftlint hash — ashfurrow/danger-ruby-swiftlint2 reactions · 2 comments
- Oct 11, 2023Remote Config randomly returns wrong values — firebase/firebase-ios-sdk2 reactions · 6 comments
- Aug 9, 2023Git Clone 후 .swiftlint.yml 파일 재생성 방법 — IERO-6/DRBS-HomeComing2 reactions
- Mar 26, 2023Feature Request: detect unneeded `open`s and missing `final`s — peripheryapp/periphery2 reactions · 3 comments
- Feb 2, 2023[해결] m1 맥에서 SwiftLint BuildScript 실패 이슈 — Nexters/momo-iOS2 reactions
- Feb 24, 2022Fix mismatched SwiftLint hash — ashfurrow/danger-ruby-swiftlint2 reactions · 1 comment
- Aug 12, 2021[STEP 1] Alan — yagom-academy/ios-my-magical-hand2 reactions
- Nov 9, 2020SwiftLint has changed calculation of the root path — norio-nomura/action-swiftlint2 reactions · 1 comment
- Dec 26, 2018 Cycle in dependencies between targets 'RxDataSources' and 'RxCocoa'; building could produce unreliable results. — RxSwiftCommunity/RxDataSources2 reactions · 2 comments
- Dec 29, 2017Feature Request: Distribute OCLint through CocoaPods — oclint/oclint2 reactions · 2 comments
- Sep 26, 2017Enforce Swift style and conventions — GitHawkApp/GitHawk2 reactions · 4 comments
- Oct 1, 2016Formulae without Sierra bottles — Homebrew/homebrew-core2 reactions · 8 comments
- Jun 8, 2026Reduce Claude metadata refresh CPU — st0012/cctop1 reaction
- Apr 27, 2026pretty print artifact download progress — swiftlang/swift-package-manager1 reaction · 5 comments
- Apr 14, 2026swiftlint: 0.62.1 -> 0.63.2 — NixOS/nixpkgs1 reaction · 1 comment
- Jan 27, 2026chore(deps): bump github.com/realm/swiftlint from 0.63.1 to 0.63.2 — crmitchelmore/justspeaktoit1 reaction · 4 comments
- Aug 16, 2025Swiftlint — a-25/ios-mcp-code-quality-server1 reaction
- Apr 20, 2025Use of SwiftLint — HanashiDev/Haltestellenmonitor-v31 reaction
- Apr 20, 2025Bug: "Extract app intents metadata" fails on Xcode 16.3 — MobileNativeFoundation/rules_xcodeproj1 reaction · 5 comments
- Oct 24, 2024Check availability context before issuing a deprecation warning — swiftlang/swift1 reaction · 1 comment
- Jul 21, 2021Swiftlint and .swiftlint.yml in submodule — norio-nomura/action-swiftlint1 reaction
- Jun 17, 2017Integrate SwiftLint — s/SwiftBot1 reaction
On Stack Overflow · 28
- Aug 14, 2017SwiftLint: Exclude file for specific rule117 votes
- Dec 29, 2016SwiftLint: Exclude file for specific rule29 votes
- Sep 19, 2018Disable some SwiftLint rules for test target/unit tests files20 votes · 4 answers
- Dec 5, 2017SwiftLint: Exclude file for specific rule14 votes
- Aug 12, 2016How do I use swiftlint to lint a single file?12 votes · 3 answers
23 more on Stack Overflow
- Mar 24, 2022Swiftlint Autocorrect Does Not Modify File9 votes
- Jan 10, 2018Swiftlint Autocorrect Does Not Modify File6 votes · 2 answers
- Sep 7, 2021Why is SwiftLint whitelist_rules not working on my project?4 votes
- Mar 15, 2019Case insensitive Dictionary in Swift4 votes
- Oct 5, 2021What should be the path of SwiftLint when installed with Swift Package Dependency3 votes · 1 answer
- Apr 3, 2016Regex for swiftlint custom rule3 votes · 2 answers
- Apr 27, 2023Require multiline parameters and arguments to start on a new line after the opening parenthesis2 votes
- Sep 21, 2017How to find the kind of subview object the view is containing in it?2 votes
- Sep 21, 2017Swift: Get all subviews of a specific type and add to an array2 votes
- Feb 10, 2022Error after installing the SPM package of Realm/SwiftLint: no such file or directory1 vote
- Jul 29, 2021How to make my Github action fail if there is an error1 vote
- Aug 26, 2020Is it possible to make fixable errors/warnings with SwiftLint?1 vote
- Mar 19, 2020swift-lint custom warning for UIWebview use1 vote
- Jun 12, 2018SwiftLint: Could not cast value of type 'Swift.Int64' to 'Swift.String', Build SwiftLint1 vote
- Jan 10, 2018Xcode autocorrection tool?1 vote
- May 30, 2023SwiftLint exclude, disabled rule not working?0 votes
- Oct 29, 2022SwiftLint exclude, disabled rule not working?0 votes · 1 answer
- Nov 18, 2021how to run SwiftLint on uncommitted files for m10 votes · 1 answer
- Nov 18, 2021Enable SwiftLint only for the new files0 votes
- Dec 20, 2018Suppressing variable name length from protocols in frameworks0 votes
- Mar 14, 2017Error pod 'SwiftLint'0 votes
- Jun 5, 2015Is it possible to make the use of unnecessary semicolons a compile-time warning/error?0 votes
- Aug 22, 2020Is it possible to make fixable errors/warnings with SwiftLint?-1 votes · 1 answer
On Hacker News · 4
- May 26, 2015An experimental tool to enforce Swift style and conventions9 points · 1 comment
- May 24, 2021SwiftLint: Configurable Linter for Swift Sources2 points
- Nov 9, 2020SwiftLint: Add `Inclusive_language` Rule2 points · 1 comment
- May 28, 2021SwiftLint: Configurable Linter for Swift Sources1 point
On the web · 4
- Aug 21, 2026SwiftLint download — google.com
- Jul 9, 2023added swiftlint plugin is not recognised by xcode — google.com
- Nov 29, 2022SwiftLint on a Swift Package — google.com
- Mar 3, 2016Setting up SwiftLint on Travis CI — google.com
On Bluesky · 3
- Oct 27, 2025Si vous développez en Swift, alors SwiftLint pourrait vous aider. C'est un linter sous licence MIT qui vous aidera à garder votre base de… — @ponceto91.bsky.social7 likes and reposts
- Feb 25, 2026SwiftLint enforces Swift style conventions with 19.5K stars - the de facto standard linter that integrates seamlessly into Xcode and… — @arifsolmaz.bsky.social2 likes and reposts · 1 reply
- Dec 1, 20242/ SwiftLint Tired of messy code? SwiftLint enforces Swift style and conventions, keeping your code clean and consistent. A must-have for… — @codingjet.bsky.social0 likes and reposts · 1 reply
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

