This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

macos: add root-level .swiftlint.yml

In order to support running from both the repository root and from
within Xcode project, and to keep things generally organized, our
primary .swiftlint.yml configuration file lives under macos/.

This change introduces a root-level .swiftlint.yml which limits the file
scope to macos/ and then includes macos/.swiftlint.yml for the rest of
the directives.

This unlocks a few benefits:

- We no longer need to pass an explicit `macos` path argument in any of
our invocations. SwiftLint will do the right thing when run either
from the repository root or from within the macos/ directory.
- It lets us easily exclude the macos/build/ directory (and re-enable
the 'deployment_target' rule). In the previous setup, this was more
challenging than you'd expect due to SwiftLint's path resolution rules
and required passing even more arguments like `--working-directory`.

The only downside is adding a new file to the repository root, but that
feels like the right trade-off given the benefits and conveniences.

+13 -7
+2 -1
.github/workflows/test.yml
··· 23 23 with: 24 24 filters: | 25 25 macos: 26 + - '.swiftlint.yml' 26 27 - 'macos/**' 27 28 28 29 required: ··· 963 964 useDaemon: false # sometimes fails on short jobs 964 965 965 966 - name: swiftlint check 966 - run: nix develop -c swiftlint lint --strict macos 967 + run: nix develop -c swiftlint lint --strict 967 968 968 969 alejandra: 969 970 if: github.repository == 'ghostty-org/ghostty'
+2
.swiftlint.yml
··· 1 + included: macos 2 + child_config: macos/.swiftlint.yml
+1 -1
AGENTS.md
··· 8 8 - **Test (Zig):** `zig build test` 9 9 - **Test filter (Zig)**: `zig build test -Dtest-filter=<test name>` 10 10 - **Formatting (Zig)**: `zig fmt .` 11 - - **Formatting (Swift)**: `swiftlint lint --fix macos` 11 + - **Formatting (Swift)**: `swiftlint lint --fix` 12 12 - **Formatting (other)**: `prettier -w .` 13 13 14 14 ## Directory Structure
+1
CODEOWNERS
··· 137 137 /dist/macos/ @ghostty-org/macos 138 138 /pkg/apple-sdk/ @ghostty-org/macos 139 139 /pkg/macos/ @ghostty-org/macos 140 + /.swiftlint.yml @ghostty-org/macos 140 141 141 142 # Renderer 142 143 /src/renderer.zig @ghostty-org/renderer
+3 -3
HACKING.md
··· 194 194 the repo root before you commit: 195 195 196 196 ``` 197 - swiftlint lint --fix macos 197 + swiftlint lint --fix 198 198 ``` 199 199 200 200 Make sure your SwiftLint version matches the version in [devShell.nix](https://github.com/ghostty-org/ghostty/blob/main/nix/devShell.nix). ··· 202 202 Nix users can use the following command to format with SwiftLint: 203 203 204 204 ``` 205 - nix develop -c swiftlint lint --fix macos 205 + nix develop -c swiftlint lint --fix 206 206 ``` 207 207 208 208 To check for violations without auto-fixing: 209 209 210 210 ``` 211 - nix develop -c swiftlint lint --strict macos 211 + nix develop -c swiftlint lint --strict 212 212 ``` 213 213 214 214 ### Updating the Zig Cache Fixed-Output Derivation Hash
+3 -1
macos/.swiftlint.yml
··· 2 2 # 3 3 check_for_updates: false 4 4 5 + excluded: 6 + - build 7 + 5 8 disabled_rules: 6 9 - cyclomatic_complexity 7 10 - file_length ··· 13 16 - type_body_length 14 17 15 18 # TODO 16 - - deployment_target 17 19 - for_where 18 20 - force_cast 19 21 - line_length
+1 -1
macos/Ghostty.xcodeproj/project.pbxproj
··· 509 509 ); 510 510 runOnlyForDeploymentPostprocessing = 0; 511 511 shellPath = /bin/sh; 512 - shellScript = "[[ -z \"$GITHUB_ACTIONS\" ]] || exit 0;\n\nSWIFTLINT=\"\"\nif command -v swiftlint >/dev/null 2>&1; then\n SWIFTLINT=\"$(command -v swiftlint)\"\nelif [[ -f \"/opt/homebrew/bin/swiftlint\" ]]; then\n SWIFTLINT=\"/opt/homebrew/bin/swiftlint\"\nfi\n\nif [[ -n \"$SWIFTLINT\" ]]; then\n \"$SWIFTLINT\" lint --quiet \"$SRCROOT\"\nfi\n"; 512 + shellScript = "[[ -z \"$GITHUB_ACTIONS\" ]] || exit 0;\n\nSWIFTLINT=\"\"\nif command -v swiftlint >/dev/null 2>&1; then\n SWIFTLINT=\"$(command -v swiftlint)\"\nelif [[ -f \"/opt/homebrew/bin/swiftlint\" ]]; then\n SWIFTLINT=\"/opt/homebrew/bin/swiftlint\"\nfi\n\nif [[ -n \"$SWIFTLINT\" ]]; then\n \"$SWIFTLINT\" lint --quiet\nfi\n"; 513 513 showEnvVarsInLog = 0; 514 514 }; 515 515 /* End PBXShellScriptBuildPhase section */