Ryu0118/[email protected]
$ brew install Ryu0118/sorter/sorter
USAGE: sorter [--file <file>] [--project <project>] [--rule-path <rule-path>] [--rules <rules>]
OPTIONS:
-f, --file <file> Swift file path you want to sort
-p, --project <project> Project Path you want to sort
--rule-path <rule-path> Explicitly specify the path to the file in which the
rules to be enabled are listed
--rules <rules> Specify the rule. To specify multiple rules, write
rules separated by commas.
-h, --help Show help information.
Create a file named sorter
in the root directory of the project,
and list the rules you want to enable there as follows
import
enum_case
- import
- enum_case
$ sorter -f test.swift
$ sorter -p ~/MyProject
$ sorter -p ~/MyProject --rules import,enum_case
$ sorter -p ~/MyProject --rule-path ~/MyProject/sorter
- Sort by access modifiers
- Sort switch cases
- Sort dependencies in Package.swift
- Sort imports separately for standard and external libraries
- Build Tool Plugin