-
-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved Tooling and Coding Standards #1090
base: main
Are you sure you want to change the base?
Conversation
…'s SwiftFormat, updated lint rules and other improvements.
…d remove the 'thebentern' scripts as that can now be handed in the Local.xcconfig local overrides.
…rKit and Associated Domains so you can build without issues using a non-premium or Personal Developer Account.
…es that depends on an externally installed SwiftLint binary.
…lint distribution.
…nd update README coding standards section.
This looks good, can you split the swift lint stuff out? |
Hi @garthvh , I assume with the SwiftLint stuff you mean the SwiftLint configuration that's causing the 3855 warnings? Sure, I can revert to the previous lint rules. I realize the number of warnings can be overwhelming, just note though that there are warnings (errors) in there that flag problematic or crash prone code, which you'll miss out on. |
… and keep the new proposed rules as '.swiftlint-proposed.yml'.
In the above ☝️ commit I have:
|
TLDR
This PR improves the tooling, extends the SwiftLint rules and introduces Swift Format rules.
These changes make it easier to get up and running and contribute to the project while introducing a common code style and coding standard (which is currently largely missing).
What changed?
This PR:
git config core.hooksPath
).swiftlint-proposed.yml
for potentially later uptakeSwiftLintBuildToolPlugin
build phase plugin rather than relying on an externally managedswiftlint
installation.pre-commit
hook to:swiftlint --fix
)SwiftLintBuildToolPlugin
's binaryswiftlint
distribution rather than relying on an externally Homebrew managedSwiftLint
installation.Common.xcconfig
for shared configurationDebug.xcconfig
forDebug
configurationRelease.xcconfig
forRelease
configurationLocal.xcconfig
thebenternify.sh
andunthebenternify.sh
) as that can now be handled through the externalized configuration (they may require updates, I am not sure what the values should be).MeshtasticDebug.entitlements
(which is by default not used) which does not contain the following entitlements:WeatherKit
CarKit
Associated Domains
README.md
with updated instructionsWhy did it change?
After cloning the project you run into compilation failures as development team and bundle identifier are hardcoded and personal / non-premium Apple Developer accounts do not allow some of the entitlements.
Looking at the code, there didn't appear to be a uniform standard, and most of the settings seemed to be optimized for very large external widescreen displays where, IMHO, they should be optimized for MacBook Pro screens to improve readability.
The changes in this PR make it easier to get started and contribute to the project.
Side notes
Aside from the scope of this PR there's room for improvement:
@ViewBuilder
s (composition)How is this tested?
These are primarily non-testable changes.
Screenshots/Videos (when applicable)
If your Apple Developer Account is a personal / non-premium Apple Developer Account, you cannot compile as
WeatherKit
,CarKit
andAssociated Domains
require a premium subscription. In that case you can update the Debug entitlements toMesthtasticDebug.entitlements
which does not containWeatherKit
,CarKit
andAssociated Domains
so it will allow you to compile the app:The updated

SwinftLint
rules for a common code style / coding standards will unfortunately introduce quite a number of new warnings. Some of these new warnings are really errors, but as there were so many errors they have for now been downgraded to warnings:Added a

logo.png
for Sourcetree Git client:Added a header template containing the right copyright and license information:
Checklist