Skip to content

Example implementation of Command and Build Plugins for Apple's swift-format, showcasing practical integrations.

Notifications You must be signed in to change notification settings

yusuga/AppleSwiftFormatPluginExample

Repository files navigation

AppleSwiftFormatPluginExample

Overview

This repository demonstrates the implementation of Command and Build Plugins for Apple's swift-format. It serves as a practical guide for integrating these plugins into your own Swift projects, showcasing easy-to-follow examples.

Command Plugin result

$ make lint
🛠️ lint
Building for debugging...
Build complete! (1.14s)
Sources/Model/ExampleModel.swift:12:1: warning: [Indentation] unindent by 2 spaces
error: swift-format invocation failed: NSTaskTerminationReason(rawValue: 1):1
make: *** [lint] Error 1

Build Plugin result

Getting Started

Prerequisites

  • Xcode 15.0.1 or later

Installation

Clone the repository:

$ git clone https://github.com/yourusername/AppleSwiftFormatPluginExample.git

Navigate to the project directory:

$ cd AppleSwiftFormatPluginExample

Set up the environment and open the Xcode project:

$ make app

Usage

There is already one violation of swift-format, so building in Xcode will confirm that an Xcode Warning is displayed.

The Command Plugin can be executed with $ make lint, $ make format.

Acknowledgements

Information about artifact bundles

Information about Build Plugin

For a detailed explanation in Japanese

About

Example implementation of Command and Build Plugins for Apple's swift-format, showcasing practical integrations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published