Convert from using --path to using --use-script-input-files #135
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This converts from making a separate call to swiftlint for each file using
--path
to passing all files in at once using--use-script-input-files
.This is how danger/swift and fastlane/swiftlint do it and I believe it is the recommended way of linting specific files.
The biggest motivation for me for doing this is to allow nested configurations. Since passing a single file to swiftlint changes the "root folder" from the location of the main config file to the location of the swift file, swiftlint isn't able to traverse up the tree from the swift file up to the main config file looking for nested
.swiftlint.yml
files. By using--use-script-input-files
instead of--path
, swiftlint is able to find nested config files properly.I suspect this change will have other benefits as well and could possibly have better performance.
Feel free to make or suggest any changes.
Closes #111 (and possibly related to #87)