prettier/plugin-swift

Name: plugin-swift

Owner: Prettier

Description: Prettier Swift Plugin

Created: 2018-01-05 09:45:44.0

Updated: 2018-05-09 18:50:56.0

Pushed: 2018-04-02 18:41:53.0

Homepage: null

Size: 239

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

:construction: Work in Progress! :construction:

Prettier Swift

Swift Plugin for the Opinionated Code Formatter

Gitter Travis npm version code style: prettier Follow+Prettier+on+Twitter

What does it do?

:warning: Warning :warning: This plugin might eat your homework in its early stage. It also depends on Swift's lib/Syntax which is in flux. Please stage or commit your code before performing any in-place formatting.

You can check out how it formatted Artsy's Eidolon.

Prerequisites

You need one of the following:

  1. A snapshot from March 30, 2018 or later,
  2. a recent manual build from Swift's master, or
  3. Swift 4.2 (once it's available as a beta or released completely).

Assuming you picked (1) please follow the installation instructions, which recommend updating your PATH at the end:

CHAIN=swift-DEVELOPMENT-SNAPSHOT-2018-03-30-a.xctoolchain
rt PATH=/Library/Developer/Toolchains/${TOOLCHAIN}/usr/bin/:"${PATH}"

Alternatively you can pass the full path to the swiftc binary via the environment variable PRETTIER_SWIFT_SWIFTC:

CHAIN=swift-DEVELOPMENT-SNAPSHOT-2018-03-30-a.xctoolchain
rt PRETTIER_SWIFT_SWIFTC=/Library/Developer/Toolchains/${TOOLCHAIN}/usr/bin/swiftc
Contributing

If you're interested in contributing to the development of Prettier for Swift, you can follow the CONTRIBUTING guide from Prettier, as it all applies to this repository too.

To test it out on a Swift file:

Install
 add --dev --exact prettier @prettier/plugin-swift
Use
tier --write "**/*.swift"
Maintainers

Marcel Jackwerth

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.