-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include rubocop-faker autocorrect in deprecation
Follow up #1714. This is a proposal to make it easy to convert positional arguments to keyword arguments. This approach is based on the experience that factory_bot has provided for upgrades. - thoughtbot/factory_bot@dabacda - thoughtbot/factory_bot#1135 First, I prepared rubocop-faker gem for upgrading with auto-correction. https://github.com/koic/rubocop-faker This PR includes rubocop-faker autocorrect in deprecation. The following is an example. ```console % cat example.rb require 'faker' Faker::Lorem.words(10000, true) ``` ## Before ```console % bundle exec ruby example.rb example.rb:3: Passing `number` with the 1st argument of `Lorem.words` is deprecated. Use keyword argument like `Lorem.words(number: ...)` instead. example.rb:3: Passing `supplemental` with the 2nd argument of `Lorem.words` is deprecated. Use keyword argument like `Lorem.words(supplemental: ...)` instead. ``` ## After ```console % bundle exec ruby example.rb example.rb:3: Passing `number` with the 1st argument of `words` is deprecated. Use keyword argument like `words(number: ...)` instead. example.rb:3: Passing `supplemental` with the 2nd argument of `words` is deprecated. Use keyword argument like `words(supplemental: ...)` instead. To automatically update from positional arguments to keyword arguments, install rubocop-faker and run: rubocop \ --require rubocop-faker \ --only Faker/DeprecatedArguments \ --auto-correct ``` Basically, users can update by copying and pasting the command displayed in the warning, so the upgrade is easy.
- Loading branch information
Showing
47 changed files
with
430 additions
and
854 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.