Swiftpack.co - kitasuke/SwiftConst as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by kitasuke.
kitasuke/SwiftConst 1.0.0
Find in Swift repeated strings that could be replaced by a constant using SwiftSyntax
⭐️ 36
🕓 4 years ago
.package(url: "https://github.com/kitasuke/SwiftConst.git", from: "1.0.0")

swiftconst

Swift 5.1 Build Status codecov

Overview

Find in Swift repeated strings that could be replaced by a constant using SwiftSyntax.

This is highly inspired by goconst and Swift version of it.

Requirements

Swift 5.1+
Xcode 11.0+ beta

How to use

Installation

Run below command

$ make install
$ swiftconst help

Available Commands

help

Display general or command-specific help

run --path <path> --ignore <path,path...>

Display repeated strings

Examples

$ swiftconst run --ignore "/Users/kitasuke/SwiftConst/Tests/,/Users/kitasuke/SwiftConst/Package.swift"
other occurrence(s) of "error" found in: /Users/kitasuke/SwiftConst/main.swift:7:11
other occurrence(s) of "help" found in: /Users/kitasuke/SwiftConst/main.swift:18:19
other occurrence(s) of "error" found in: /Users/kitasuke/SwiftConst/main.swift:19:28
other occurrence(s) of "help" found in: /Users/kitasuke/SwiftConst/main.swift:21:19

TODOs

  • ☐ Recursive run in subfolders

Acknowledgements

GitHub

link
Stars: 36
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

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