How do I use swiftlint to lint a single file?

后端 未结 3 1169
悲哀的现实
悲哀的现实 2021-01-17 18:36

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.

相关标签:
3条回答
  • 2021-01-17 18:50

    To lint multiple files at once :

    $ swiftlint -- file1.swift file2.swift
    
    0 讨论(0)
  • 2021-01-17 19:05

    You can also do this with:

    swiftlint --path 'path to your file'
    
    0 讨论(0)
  • 2021-01-17 19:06
    SCRIPT_INPUT_FILE_COUNT=1 SCRIPT_INPUT_FILE_0="foo.swift" swiftlint lint --use-script-input-files
    
    0 讨论(0)
提交回复
热议问题