AnyLint banner
AnyLint

Open SourceSwiftUtility

AnyLint Overview

Lint any project in any language using Swift and regular expressions. With built-in support for matching and non-matching examples validation & autocorrect replacement. Replaces SwiftLint custom rules & works for other languages as well! 🎉

The most important thing to note is that the first three lines are required for AnyLint to work properly.

All the other code can be adjusted and that's actually where you configure your lint checks (a few examples are provided by default in the blank template). Note that the first two lines declare the file to be a Swift script using swift-sh. Thus, you can run any Swift code and even import Swift packages (see the swift-sh docs) if you need to. The third line makes sure that all violations found in the process of running the code in the completion block are reported properly and exits the script with the proper exit code at the end.

Having this configuration file, you can now run anylint to run your lint checks. By default, if any check fails, the entire command fails and reports the violation reason. To learn more about how to configure your own checks, see the Configuration section below.

If you want to create and run multiple configuration files or if you want a different name or location for the default config file, you can pass the --path option, which can be used multiple times as well like this:

Stay on top of new tools for iOS developers

Subscribe to get a convenient weekly roundup of iOS Dev Tools' newest addition
of helpful and time-saving developer tools, services, and SDKs to get your job done faster.