Fix SwiftLint violations and install swift-format in CI#4
Open
Fix SwiftLint violations and install swift-format in CI#4
Conversation
Fixes the 11 SwiftLint errors flagged by the strict CI run: - vertical_whitespace_opening_braces: remove blank lines after opening braces in AppDelegate, AboutView, Constants. - vertical_whitespace_closing_braces: remove blank lines before closing braces in AppDelegate, Constants. - legacy_objc_type: switch drawVerticallyCentered from NSString to String. The bridged draw(in:withAttributes:) is available via AppKit, so the callers in IconCreator can drop the NSString wrappers as well. CI: install swift-format via brew before the advisory lint step. Without it the job was failing with exit 127 (command not found) instead of actually linting.
Remove swift-format entirely: - The swift-format job was advisory and duplicated SwiftLint's job with a different, conflicting style (Indentation, Spacing, TrailingComma, OrderedImports all have different opinions from SwiftLint). Maintaining two formatters at once adds noise without strengthening enforcement. - Delete the .swift-format configuration and the CI job. SwiftLint cleanup: - Remove 'anyobject_protocol' from opt_in_rules (no longer a valid rule identifier in SwiftLint). - Remove noisy opt-in rules that fire on patterns we already accept: closure_spacing, vertical_whitespace_opening_braces, vertical_whitespace_closing_braces, lower_acl_than_parent, multiline_arguments. - Configure large_tuple with warning: 3 / error: 4 so small named return tuples stay OK but wide tuples are still flagged. SpaceParser cleanup: - Replace the 3-tuple return of buildSpaces(for:...) with the existing ParseResult struct (now extended with nextIndex). Callers already accessed .spaces / .updatedNames / .nextIndex so this is source-compatible on the call sites.
SpacemanStyle: - Rename .none to .rectangles. '.none' collides with Optional.none at call sites and reads worse than a descriptive name. The raw value (0) stays, so UserDefaults-persisted selections keep working. Build settings: - Add SWIFT_STRICT_CONCURRENCY = minimal explicitly to the Spaceman target (both configs). This makes the current concurrency-checking level visible in the project and gives us a single knob to dial up to 'targeted' and then 'complete' in follow-up work. Entitlements: - Drop com.apple.security.files.user-selected.read-only from the sandbox entitlements and the matching ENABLE_USER_SELECTED_FILES build setting. The app never presents an NSOpenPanel/NSSavePanel, so this entitlement was unused and only expanded the attack surface.
…ncation at the SpaceNameInfo model layer
Previously SpaceObserver.updateSpaceInformation() returned silently on an unusable CGS payload, leaving whatever icon was last drawn in the status bar. Users had no way to tell that the private SPI had broken. Extend SpaceObserverDelegate with didFailToObserveSpaces(), call it from both early-return paths, and render a '?' template icon from IconCreator in response. Addresses audit-improvements §M2.
- @AppStorage("displayStyle") now holds a SpacemanStyle directly via its RawRepresentable(Int) conformance. Callers stop juggling raw Ints, picker tags become type-safe, and the disabled check for the named style no longer has to reach through .rawValue. The on-disk encoding (Int 0..4) is unchanged, so existing UserDefaults values keep working. - Set an accessibilityLabel on NSStatusItem.button so VoiceOver reads the menu-bar item as more than 'image'. - Give the preferences close button an accessibilityLabel.
- Drop the empty applicationWillTerminate stub in AppDelegate. - Show each space as 'N — NAME' in the preferences picker so users can tell which entry they're editing at a glance (audit C2).
- MARKETING_VERSION / CURRENT_PROJECT_VERSION 1.0.0 → 2.0.0. - All GitHub URLs now point to yeapea/Spaceman instead of Jaysce. - SUFeedURL in Info.plist updated accordingly. - Remove jaysce.dev website link from preferences (no longer applies). - Add "Receive beta updates" toggle in preferences, stored under UserDefaults key "betaUpdates". - StatusBar now conforms to SPUUpdaterDelegate and implements feedURLString(for:) to return either the stable appcast (main branch releases) or the beta appcast (develop branch releases at tag beta-latest) based on the toggle. - Feed URLs centralized in Constants.AppInfo.stableFeedURL / betaFeedURL. https://claude.ai/code/session_01GauvgsXYoeqjHgT87ZPUoX
Replace the original author's public key with the newly generated key for the yeapea/Spaceman distribution. https://claude.ai/code/session_01GauvgsXYoeqjHgT87ZPUoX
Triggers on every push to develop (and manual dispatch). Pipeline: 1. Lint (SwiftLint strict) 2. Build + Test 3. Archive → DMG → Sparkle appcast → publish as GitHub pre-release under the fixed tag `beta-latest` The beta appcast lives at: .../releases/download/beta-latest/appcast.xml which is what Constants.AppInfo.betaFeedURL points to. Users who enable the "Receive beta updates" toggle in preferences will see these builds via Sparkle. Version string includes the short commit SHA for traceability (e.g. 2.0.0-beta.a1b2c3d). Only the most recent beta DMG is kept (SPARKLE_MAX_VERSIONS=1) to save release storage. https://claude.ai/code/session_01GauvgsXYoeqjHgT87ZPUoX
Remove Developer ID certificate import, code-sign identity, and APPLE_DEVELOPER_TEAM_ID requirement from both release.yml and beta-release.yml. Set ALLOW_UNSIGNED_ARCHIVE=1 so build_dmg.sh skips code signing entirely. The only remaining secret needed is SPARKLE_PRIVATE_ED_KEY for signing the Sparkle appcast (update integrity, not Gatekeeper). Users will need to right-click → Open on first launch to bypass Gatekeeper. This is standard for open-source macOS apps distributed without an Apple Developer account. https://claude.ai/code/session_01GauvgsXYoeqjHgT87ZPUoX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the 11 SwiftLint errors flagged by the strict CI run:
CI: install swift-format via brew before the advisory lint step. Without it the job was failing with exit 127 (command not found) instead of actually linting.