[Technical Questions] Swiftlint file length and body length rules #181
Unanswered
shamit05
asked this question in
Technical Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In what area do you have a technical challenge?
Swift
Description
Hi, I was wondering if it's possible to disable the swiftlint file length and body length rules. Here is our reasoning:
If you include a private variable in the class and need to access it elsewhere, so splitting up the files makes it a pain to access the private variable, but then giving it public access gives another swiftlint error (and is bad programming practice in general). There's a whole discussion post on this here: https://forums.swift.org/t/calling-private-methods-from-extensions-in-separate-files/54029/47. This is due to Swift's type protection system.
Reproduction
Take a look at our https://github.com/CS342/2025-Feedbridge/blob/main/Feedbridge/FeedbridgeStandard.swift file. It violates those two swiftlint properties, but if we remove them, it doesn't make much readability and usability sense to split up FeedbridgeStandard into two different files, because we need shared access to the logger.
Expected behavior
Remove these two warnings.
Additional context
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions