mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-26 01:03:56 +00:00
macos: lint Swift files using SwiftLint
SwiftLint <https://realm.github.io/SwiftLint/> is both a linter and formatting. It's a popular way to spot issues and enforce a consistent style. Our SwiftLint configuration lives in macos/.swiftlint.yml, where is is automatically discovered. It's very configurable, and I made an initial pass as some basic, weakly-opinionated rules. The "TODO" section lists rules that currently have violations but can be easily (auto)fixed in follow-up commits. Our integration is CLI-based. Similar to our other support tools, we expect developers to install `swiftlint` via nix or e.g. Homebrew. This is documented in HACKING.md. We also have an optional Xcode integration, for in-editor feedback. When `swiftlint` is available, it's run as a script-based Build Phase. SwiftLint supports an auto-fix mode (--fix). Agents are aware of this via AGENTS.md. The rules are enforced using a (nix-based) CI job.
This commit is contained in:
@@ -66,6 +66,7 @@
|
||||
poop,
|
||||
typos,
|
||||
shellcheck,
|
||||
swiftlint,
|
||||
uv,
|
||||
wayland,
|
||||
wayland-scanner,
|
||||
@@ -198,6 +199,9 @@ in
|
||||
|
||||
# for benchmarking
|
||||
poop
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
swiftlint
|
||||
];
|
||||
|
||||
# This should be set onto the rpath of the ghostty binary if you want
|
||||
|
||||
Reference in New Issue
Block a user