Skip to content

Repository files navigation

SwiftStyle

⚠️ This project is still under active development and breaking changes is a guarantee. 😱

A linter and formatter using SwiftLint and SwiftFormat to enforce code styling. The idea is to have a stand-alone swift package to enforce a team's code styling, by using linting and formatting. The idea came from Airbnb Swift Style Guide and aims to take their existing approach just one step further.

Running executable

swiftstyle --swift-format-path /opt/homebrew/bin/swiftformat --swift-format-config default.swiftformat --swift-lint-path /opt/homebrew/bin/swiftlint --swift-lint-config swiftlint.yml .

During development run:

swift run swiftstyle

Adding package to Xcode

Add the package to Xcode as with any other swift package BUT don't add it to the project. i.e. don't add it the targets, this will cause unexpected errors.

Build Plugin

To run swiftstyle for each build in Xcode add it as a Build Tool Plugin under Build Phases. StyleSwift will then run on each build.

Command Plugin

TODO: Documentation

Releasing a build

  • Update Makefile with version
  • Run make
  • Copy checksum from above command and paste in Package.swift under binary target SwiftStyleBinary
  • Bump version in url in Package.swift under binary target SwiftStyleBinary
  • Commit changes and push
  • Create new release on Github matching new version in Makefile
  • Upload swiftstyle.artifactbundle.zip as resource to the release

NOTES:

Roadmap

See issues for outstanding features/tasks

References

About

A linter and formatter to enforce code styling

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages