Swiftlint: autocorrect individual files

Created on 28 Jan 2016  路  1Comment  路  Source: realm/SwiftLint

I'm interested in writing scripts that autocorrect specific files, but it seems that autocorrect in its current form doesn't accept any arguments. Is this capability somewhere else, or is just not supported at this time?

question

Most helpful comment

You can specify a path to autocorrect to just correct that path:

$ swiftlint help autocorrect
Automatically correct warnings and errors

[--path (string)]
    the path to the file or directory to correct

[--config .swiftlint.yml]
    the path to SwiftLint's configuration file

[--use-script-input-files]
    read SCRIPT_INPUT_FILE* environment variables as files

e.g.

$ swiftlint autocorrect --path just_this_file.swift

>All comments

You can specify a path to autocorrect to just correct that path:

$ swiftlint help autocorrect
Automatically correct warnings and errors

[--path (string)]
    the path to the file or directory to correct

[--config .swiftlint.yml]
    the path to SwiftLint's configuration file

[--use-script-input-files]
    read SCRIPT_INPUT_FILE* environment variables as files

e.g.

$ swiftlint autocorrect --path just_this_file.swift
Was this page helpful?
0 / 5 - 0 ratings