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.
Swift 5.1+
Xcode 11.0+ beta
Run below command
$ make install
$ swiftconst help
Display general or command-specific help
Display repeated strings
$ 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
- Recursive run in subfolders