Swiftpack.co -  Package - jhauberg/xcdoctor
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
jhauberg/xcdoctor
Keep a healthy Xcode project
.package(url: "https://github.com/jhauberg/xcdoctor.git", from: "0.5.1")

xcdoctor

A command-line tool that helps diagnosing your Xcode project for common defects.

Latest release (0.5.1) Download the latest stable release.
Issue tracker Contribute your bugs, comments or feature requests.

Installation

Dependency Description Version License
swift-argument-parser Describe and manage a command-line interface. 0.4.1 Apache License 2.0

Install manually

Requires Swift 5+

First, build the program:

$ swift build --configuration release

Then, copy the executable to /usr/local/bin (or add it to $PATH):

$ cd .build/release
$ cp -f xcdoctor /usr/local/bin/xcdoctor

Run without installation

You can run xcdoctor without having to install it first:

$ swift run xcdoctor ~/path/to/my/Project.xcodeproj

Install using Mint

$ mint install jhauberg/xcdoctor

Usage

If xcdoctor was installed as expected, you can then run xcdoctor from anywhere:

$ xcdoctor --help
USAGE: xcdoctor <xcodeproj> [--verbose]

ARGUMENTS:
  <xcodeproj>             A path to an Xcode project file.

                          You can put in a path to a directory to automatically
                          look for a project at that location, or "." to look
                          for a project in the current working directory.

OPTIONS:
  -v, --verbose           Show diagnostic messages.
  -h, --help              Show help information.
  --version               Show the version.

At this point, you can direct xcdoctor to your Xcode project to initiate an examination:

$ xcdoctor ~/path/to/my/Project.xcodeproj

Add the --verbose flag to see an indication of progress during examination.

Note that xcdoctor is only able to examine .xcodeproj files. If your project is based on Swift Package Manager (like xcdoctor itself), you can generate an .xcodeproj using swift package generate-xcodeproj.

Examination

The purpose of an examination is to discover and identify defects in an Xcode project.

This process includes resolving and validating file/group references, determining unused resources and more. For a complete list of checks, see Diagnosis.swift.

No files are touched during an examination; the user must manually take action on any reported defects.

Diagnosis

If, during an examination, a defect is discovered, xcdoctor will form a diagnosis for each defect, including advice on how to treat it.

The diagnoses are reported in reverse order of significance, such that the last reported diagnosis is more important than the first.

Diagnoses should be handled in this order, starting with the last reported one. Treating a significant defect could have a cascading effect on less significant diagnoses (sometimes even treating them completely).


This is a Free and Open-Source Software project released under the MIT License.

GitHub

link
Stars: 32
Last commit: 3 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco