nicklockwood / nicklockwood/SwiftFormat

Is it possible to fix code made with current Xcode version to be compatible with Swift 3.0

Open
#809 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Swift
Stars
8.9k
Forks
701
Avg merge
14h 25m
Merged PRs (30d)
27

Description

We have UI tests for our macOS app, starting with macOS 10.11, which requires rebuilding the testrunner with a compatible Xcode, version 8.2 in our case, which only supports Swift 3.0. Since we are using the latest Xcode for development, sometimes we leave non-compatible code in the test target to later realise that it doesn't work on older versions. (For example omitting return in a single line calculated property)

We have a .swift-version file inside the folder we want to format for compatibility and a swiftformat.yaml at the project root, it would be nice if swiftformat could fix stuff like that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by checking how SwiftFormat reads the .swift-version file and swiftformat.yaml, then trace formatting for single-line calculated properties such as the omitted return example. Done means the formatter can use the requested Swift version to identify and fix incompatible code in the selected folder, with the behavior verified for the macOS 10.11/Xcode 8.2 case.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.