11

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.

ablarg
  • 2,400
  • 1
  • 24
  • 32

3 Answers3

23

You can also do this with:

swiftlint --path 'path to your file'
Vladyslav Zavalykhatko
  • 15,202
  • 8
  • 65
  • 100
5
SCRIPT_INPUT_FILE_COUNT=1 SCRIPT_INPUT_FILE_0="foo.swift" swiftlint lint --use-script-input-files
ablarg
  • 2,400
  • 1
  • 24
  • 32
5

To lint multiple files at once :

$ swiftlint -- file1.swift file2.swift
Axel Guilmin
  • 11,454
  • 9
  • 54
  • 64