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

[action][swiftlint] Added support for --fix mode option #18695

Merged
merged 5 commits into from
May 19, 2021

Conversation

crazymanish
Copy link
Member

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

Description (In this PR)

  • Added support for --fix mode
  • Also, based on the Swiftlint version, autocorrect mode will automatically switch to fix mode & vice-versa.
  • Added unit tests.

Testing Steps

  • Download demo Xcode project with Swiftlint lane in Zip MyApp.zip
  • Run bundle exec fastlane test
    or
  • Update Gemfile and run bundle install with
gem "fastlane", :git => "git@github.com:crazymanish/fastlane.git", :branch => "swiftlint-fix-mode-support"
  • Try below lanes
lane :test_swiftlint_in_autocorrect_mode do
    swiftlint(mode: :autocorrect)
end

lane :test_swiftlint_in_fix_mode do
    swiftlint(mode: :fix)    
end

Screenshot

Screenshot 2021-05-15 at 21 30 15

.
.
Screenshot 2021-05-15 at 19 59 09

Copy link
Collaborator

@minuscorp minuscorp left a comment

Choose a reason for hiding this comment

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

Minor addition but this is very legit! Thank you for the contribution!

fastlane/lib/fastlane/actions/swiftlint.rb Show resolved Hide resolved
@lordcodes
Copy link
Contributor

Looks great, thank you!

Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

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

This looks great! Really love the version checking 😍 Just a few small nit picks otherwise 💯

fastlane/lib/fastlane/actions/swiftlint.rb Outdated Show resolved Hide resolved
fastlane/lib/fastlane/actions/swiftlint.rb Show resolved Hide resolved
fastlane/lib/fastlane/actions/swiftlint.rb Outdated Show resolved Hide resolved
@crazymanish
Copy link
Member Author

This looks great! Really love the version checking 😍 Just a few small nit picks otherwise 💯

Thank you for your review, applied suggestions! 😇

Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

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

This is 🔥 Thank you so much for all the work on this one ❤️ Really appreciate it!

@joshdholtz joshdholtz merged commit 81ce2b1 into fastlane:master May 19, 2021
@crazymanish crazymanish deleted the swiftlint-fix-mode-support branch May 20, 2021 06:51
@fastlane-bot
Copy link

Hey @crazymanish 👋

Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a week, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀

@fastlane-bot
Copy link

Congratulations! 🎉 This was released as part of fastlane 2.184.0 🚀

@fastlane fastlane locked and limited conversation to collaborators Jul 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SwiftLint action - Replace autocorrect with --fix
5 participants