How do I use swiftlint to lint a single file?

2019-02-22 09:32发布

问题:

I'd like to use swiftlint to lint a single file. How do I accomplish this? Checking the docs on https://github.com/realm/SwiftLint was not helpful.

回答1:

You can also do this with:

swiftlint --path 'path to your file'


回答2:

SCRIPT_INPUT_FILE_COUNT=1 SCRIPT_INPUT_FILE_0="foo.swift" swiftlint lint --use-script-input-files


标签: swiftlint