From 30c6636ee7755a1bbf96e20c0bf24c03e2776441 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Sun, 29 Sep 2019 15:03:47 -0600 Subject: [PATCH 1/2] Fix some rubocop comments that were showing up in YARD docs. --- lib/faker/default/app.rb | 3 ++- lib/faker/default/internet.rb | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/faker/default/app.rb b/lib/faker/default/app.rb index 6cf3baf947..be131cf82f 100644 --- a/lib/faker/default/app.rb +++ b/lib/faker/default/app.rb @@ -42,6 +42,8 @@ def author parse('app.author') end + # rubocop:disable Metrics/ParameterLists + ## # Produces a String representing a semantic version identifier. # @@ -60,7 +62,6 @@ def author # Faker::App.semantic_version(patch: 5..6) #=> "7.2.6" # # @faker.version 1.4.3 - # rubocop:disable Metrics/ParameterLists def semantic_version(legacy_major = NOT_GIVEN, legacy_minor = NOT_GIVEN, legacy_patch = NOT_GIVEN, major: 0..9, minor: 0..9, patch: 1..9) # rubocop:enable Metrics/ParameterLists warn_for_deprecated_arguments do |keywords| diff --git a/lib/faker/default/internet.rb b/lib/faker/default/internet.rb index 8ac771e9fa..1aa520e837 100644 --- a/lib/faker/default/internet.rb +++ b/lib/faker/default/internet.rb @@ -73,6 +73,8 @@ def username(legacy_specifier = NOT_GIVEN, legacy_separators = NOT_GIVEN, specif end end + # rubocop:disable Metrics/ParameterLists + ## # Produces a randomized string of characters suitable for passwords # @@ -95,8 +97,8 @@ def username(legacy_specifier = NOT_GIVEN, legacy_separators = NOT_GIVEN, specif # Faker::Internet.password(min_length: 10, max_length: 20, mix_case: true, special_characters: true) #=> "*%NkOnJsH4" # # @faker.version 2.1.3 - # rubocop:disable Metrics/ParameterLists def password(legacy_min_length = NOT_GIVEN, legacy_max_length = NOT_GIVEN, legacy_mix_case = NOT_GIVEN, legacy_special_characters = NOT_GIVEN, min_length: 8, max_length: 16, mix_case: true, special_characters: false) + # rubocop:enable Metrics/ParameterLists warn_for_deprecated_arguments do |keywords| keywords << :min_length if legacy_min_length != NOT_GIVEN keywords << :max_length if legacy_max_length != NOT_GIVEN @@ -239,6 +241,7 @@ def ip_v6_cidr "#{ip_v6_address}/#{rand(1..127)}" end + # rubocop:disable Metrics/ParameterLists def url(legacy_host = NOT_GIVEN, legacy_path = NOT_GIVEN, legacy_scheme = NOT_GIVEN, host: domain_name, path: "/#{username}", scheme: 'http') # rubocop:enable Metrics/ParameterLists warn_for_deprecated_arguments do |keywords| From 4e3399f43b7b2322ab79cf992cff9746cd682c19 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Sun, 29 Sep 2019 15:05:13 -0600 Subject: [PATCH 2/2] Fix the Rubocop command in Faker::Avatar as well. --- lib/faker/default/avatar.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/faker/default/avatar.rb b/lib/faker/default/avatar.rb index 1699e5a802..c191e7bd02 100644 --- a/lib/faker/default/avatar.rb +++ b/lib/faker/default/avatar.rb @@ -6,6 +6,8 @@ class << self # @private SUPPORTED_FORMATS = %w[png jpg bmp].freeze + # rubocop:disable Metrics/ParameterLists + ## # Produces a URL for an avatar from robohash.org # @@ -36,7 +38,6 @@ class << self # #=> "https://robohash.org/my-own-slug.bmp?size=50x50&set=set1&bgset=bg1" # # @faker.version 1.4.3 - # rubocop:disable Metrics/ParameterLists def image(legacy_slug = NOT_GIVEN, legacy_size = NOT_GIVEN, legacy_format = NOT_GIVEN, legacy_set = NOT_GIVEN, legacy_bgset = NOT_GIVEN, slug: nil, size: '300x300', format: 'png', set: 'set1', bgset: nil) # rubocop:enable Metrics/ParameterLists warn_for_deprecated_arguments do |keywords|