swift

Airbnb's Swift Style Guide

MIT License

Stars
2.4K
Committers
38

Bot releases are hidden (Show)

swift - 1.0.7 Latest Release

Published by calda 6 months ago

What's Changed

Full Changelog: https://github.com/airbnb/swift/compare/1.0.6...1.0.7

swift - 1.0.6

Published by calda 10 months ago

What's Changed

Full Changelog: https://github.com/airbnb/swift/compare/1.0.5...1.0.6

swift - 1.0.5

Published by calda about 1 year ago

What's Changed

Full Changelog: https://github.com/airbnb/swift/compare/1.0.4...1.0.5

swift - 1.0.4

Published by calda over 1 year ago

What's Changed

Swift Package Plugin

Swift Style Guide

Full Changelog: https://github.com/airbnb/swift/compare/1.0.3...1.0.4

swift - 1.0.3

Published by calda almost 2 years ago

What's Changed

Full Changelog: https://github.com/airbnb/swift/compare/1.0.2...1.0.3

swift - 1.0.2

Published by calda about 2 years ago

Swift Style Guide

SPM package plugin

swift -

Published by calda about 2 years ago

  • The package plugin now uses precompiled binary dependencies for SwiftFormat and SwiftLint instead of compiling them from source. This resolves an issue where SPM would reject .package(url: "https://github.com/airbnb/swift", from: "1.0.0") as invalid.
  • The package plugin now automatically infers the package Swift version from the // swift-tools-version comment in your Package.swift file. You can customize this by calling the plugin with a --swift-version argument.
  • Added XcodeCommandPlugin to support using the package plugin in Xcode 14 project workspaces
swift - 1.0.0

Published by calda about 2 years ago

🆕 Swift Package Manager command plugin

This repo now includes a Swift Package Manager command plugin that you can use to automatically reformat or lint your package according to the style guide. To use this command plugin with your package, all you need to do is add this repo as a dependency:

dependencies: [
  .package(url: "https://github.com/airbnb/swift", from: "1.0.0"),
]

and then run the format command plugin in your package directory:

$ swift package format

Usage guide

# Supported in Xcode 14+. Prompts for permission to write to the package directory.
$ swift package format

# When using the Xcode 13 toolchain, or a noninteractive shell, you must use: 
$ swift package --allow-writing-to-package-directory format

# To just lint without reformatting, you can use `--lint`:
$ swift package format --lint

# By default the command plugin runs on the entire package directory.
# You can exclude directories using `exclude`:
$ swift package format --exclude Tests

# Alternatively you can explicitly list the set of paths and/or SPM targets:
$ swift package format --paths Sources Tests Package.swift
$ swift package format --targets AirbnbSwiftFormatTool