Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert from using --path to using --use-script-input-files #135

Merged
merged 1 commit into from
Jul 29, 2019
Merged

Convert from using --path to using --use-script-input-files #135

merged 1 commit into from
Jul 29, 2019

Conversation

kylefleming
Copy link
Collaborator

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)

Copy link
Owner

@ashfurrow ashfurrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this is impressive work 🙏 The motivation for the changes you outlined in the PR description makes perfect sense, I agree this is a good idea. The implementation and tests look fantastic – thanks for taking the time to cleanup Shellwords and the unit test stubs. The only thing missing is a changelog entry, but I'll do that myself.

Thanks again for contributing to the tool – I'll get this released to RubyGems this afternoon.

@ashfurrow ashfurrow merged commit 38ff6e2 into ashfurrow:master Jul 29, 2019
ashfurrow added a commit that referenced this pull request Jul 29, 2019
@ashfurrow
Copy link
Owner

Okay, that's released as 0.23.0 👍

@kylefleming kylefleming deleted the use-script-input-files branch July 29, 2019 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use --use-script-input-files instead of running on each file
2 participants