How airbnb/swift works
Project Type and Purpose
• This is an open-source Swift Package Manager (SPM) plugin and CLI tool (“Airbnb Swift Format Tool”) that enforces the Airbnb Swift style guide by invoking SwiftFormat and SwiftLint on any Swift package.
• It’s not a web service or microservice architecture, but a developer tool that integrates into SPM (via a command plugin) and into CI (via GitHub Actions).
File‐Tree Analysis
• Top-level build & metadata files:
• Package.swift / Package.resolved → defines the SPM package, its executable and plugin targets
• Gemfile / Rakefile → Ruby scripts for auxiliary tasks (e.g. release automation)
• .github/actions & .github/workflows → CI definitions using GitHub Actions
• Plugins/FormatSwift → code for the SwiftPM plugin (Plugin.swift, CommandContext.swift) that hooks into swift package format
• Sources/AirbnbSwiftFormatTool → the executable target implementing the “format” command:
• AirbnbSwiftFormatTool.swift + Command.swift → entrypoint and command dispatch
• Configuration assets (airbnb.swiftformat, swiftlint.yml)
• Tests/AirbnbSwiftFormatToolTests → unit tests exercising the CLI logic
• resources/xcode_settings.bash → auxiliary script to bootstrap Xcode settings
README Insights
• The README is both the style guide and user manual: it documents usage of the SPM command plugin (swift package format) and the underlying philosophy of the style rules.