From 774e658937dcd8bb258cee0ad9fb924aa094cf76 Mon Sep 17 00:00:00 2001 From: Ian Maia Date: Mon, 30 Oct 2023 15:30:03 +0100 Subject: [PATCH] Update Rubocop to not allow Ruby 3.1 hash values and value arguments omission --- .rubocop.yml | 7 +- Rakefile | 2 +- .../android/android_betabuild_prechecks.rb | 2 +- .../android/android_create_avd_action.rb | 4 +- .../android_download_translations_action.rb | 4 +- .../actions/android/android_firebase_test.rb | 4 +- .../android/android_send_app_size_metrics.rb | 6 +- .../android/android_update_release_notes.rb | 2 +- .../common/buildkite_annotate_action.rb | 4 +- .../common/check_translation_progress.rb | 10 +-- .../actions/common/close_milestone_action.rb | 2 +- .../common/copy_branch_protection_action.rb | 4 +- .../common/create_new_milestone_action.rb | 4 +- .../actions/common/create_release_action.rb | 10 +-- .../actions/common/get_prs_between_tags.rb | 12 ++-- .../common/promo_screenshots_action.rb | 2 +- .../common/remove_branch_protection_action.rb | 2 +- .../common/set_branch_protection_action.rb | 4 +- .../actions/common/setfrozentag_action.rb | 2 +- .../actions/common/upload_to_s3.rb | 8 +-- .../configure_add_files_to_copy_action.rb | 2 +- ...s_download_strings_files_from_glotpress.rb | 2 +- .../actions/ios/ios_final_tag.rb | 2 +- .../actions/ios/ios_get_store_app_sizes.rb | 4 +- .../actions/ios/ios_lint_localizations.rb | 4 +- .../actions/ios/ios_send_app_size_metrics.rb | 2 +- .../actions/ios/ios_update_release_notes.rb | 2 +- .../helper/android/android_emulator_helper.rb | 4 +- .../helper/android/android_localize_helper.rb | 2 +- .../android/android_tools_path_helper.rb | 2 +- .../helper/app_size_metrics_helper.rb | 4 +- .../wpmreleasetoolkit/helper/ci_helper.rb | 2 +- .../wpmreleasetoolkit/helper/git_helper.rb | 4 +- .../wpmreleasetoolkit/helper/github_helper.rb | 8 +-- .../helper/interactive_prompt_reminder.rb | 4 +- .../helper/ios/ios_l10n_linter_helper.rb | 2 +- .../helper/metadata_download_helper.rb | 2 +- .../wpmreleasetoolkit/models/configuration.rb | 10 +-- .../models/file_reference.rb | 2 +- .../models/firebase_test_runner.rb | 8 +-- .../calculators/date_version_calculator.rb | 2 +- .../marketing_version_calculator.rb | 2 +- .../semantic_version_calculator.rb | 2 +- rakelib/changelog_parser.rake | 4 +- spec/abstract_version_calculator_spec.rb | 10 +-- spec/an_localize_libs_action_spec.rb | 10 +-- spec/android_send_app_size_metrics_spec.rb | 4 +- spec/android_version_file_spec.rb | 4 +- spec/buildkite_annotate_action_spec.rb | 2 +- spec/check_localization_progress_spec.rb | 10 +-- spec/configure_helper_spec.rb | 2 +- spec/copy_branch_protection_action_spec.rb | 24 +++---- spec/date_build_code_calculator_spec.rb | 2 +- spec/date_version_calculator_spec.rb | 6 +- spec/derived_build_code_formatter_spec.rb | 4 +- spec/file_reference_spec.rb | 2 +- spec/firebase_device_spec.rb | 2 +- spec/firebase_test_runner_spec.rb | 20 +++--- spec/four_part_build_code_formatter_spec.rb | 2 +- spec/get_prs_between_tags_spec.rb | 12 ++-- spec/git_helper_spec.rb | 16 ++--- spec/github_helper_spec.rb | 42 +++++------ spec/ios_bump_version_release_spec.rb | 2 +- ...nload_strings_files_from_glotpress_spec.rb | 6 +- ...os_generate_strings_file_from_code_spec.rb | 10 +-- spec/ios_get_app_version_spec.rb | 12 ++-- spec/ios_get_build_number_spec.rb | 8 +-- spec/ios_git_helper_spec.rb | 4 +- spec/ios_l10n_helper_spec.rb | 16 ++--- spec/ios_send_app_size_metrics_spec.rb | 6 +- spec/ios_version_file_spec.rb | 8 +-- spec/marketing_version_calculator_spec.rb | 6 +- ...otype_build_details_comment_action_spec.rb | 18 ++--- spec/remove_branch_protection_action_spec.rb | 12 ++-- spec/semantic_version_calculator_spec.rb | 2 +- spec/set_branch_protection_action_spec.rb | 70 +++++++++---------- spec/simple_build_code_calculator_spec.rb | 2 +- spec/simple_build_code_formatter_spec.rb | 2 +- spec/spec_helper.rb | 2 +- spec/upload_to_s3_spec.rb | 8 +-- 80 files changed, 275 insertions(+), 270 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 1d3add0b1..8b263b19d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -55,7 +55,12 @@ Style/StringConcatenation: # for more discussion Style/FetchEnvVar: Enabled: false - + +# Rule enforced after migrating to Ruby 3, to prevent the new syntax which allows for hash values and keyword arguments +# omission, such as `myMethod(x:, y:)` and `h = { a:, b: }`. +Style/HashSyntax: + EnforcedShorthandSyntax: never + ########## Gemspec Rules # This was turned on by default after updating Rubocop to `1.50.2`. We want to disable this for now because diff --git a/Rakefile b/Rakefile index a1a836702..b4d036d3e 100644 --- a/Rakefile +++ b/Rakefile @@ -56,7 +56,7 @@ task :new_release do Console.header 'Update `VERSION` constant in `version.rb`...' update_version_constant(VERSION_FILE, new_version) Console.header 'Updating CHANGELOG...' - parser.update_for_new_release(new_version:) + parser.update_for_new_release(new_version: new_version) # Commit and push Console.header 'Commit and push changes...' diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb index 2b1a11318..803e40d2c 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb @@ -42,7 +42,7 @@ def self.run(params) # Check user overwrite unless params[:base_version].nil? - overwrite_version = get_user_build_version(version: params[:base_version], message:) + overwrite_version = get_user_build_version(version: params[:base_version], message: message) release_version = overwrite_version[0] alpha_release_version = overwrite_version[1] end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_avd_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_avd_action.rb index 4a72b36ae..8fd4c1416 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_avd_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_avd_action.rb @@ -16,9 +16,9 @@ def self.run(params) helper.create_avd( api: api_level, device: device_model, - system_image:, + system_image: system_image, name: avd_name, - sdcard: + sdcard: sdcard ) end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb index 5ee6f6204..df43a09d8 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb @@ -11,11 +11,11 @@ def self.run(params) res_dir = File.join(project_root_folder || '.', params[:res_dir]) Fastlane::Helper::Android::LocalizeHelper.create_available_languages_file( - res_dir:, + res_dir: res_dir, locale_codes: [params[:source_locale]] + params[:locales].map { |h| h[:android] } ) Fastlane::Helper::Android::LocalizeHelper.download_from_glotpress( - res_dir:, + res_dir: res_dir, glotpress_project_url: params[:glotpress_url], glotpress_filters: params[:status_filter].map { |s| { status: s } }, locales_map: params[:locales] diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_firebase_test.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_firebase_test.rb index 6889e8b15..31799dddd 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_firebase_test.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_firebase_test.rb @@ -33,14 +33,14 @@ def self.run(params) project_id: params[:project_id], apk_path: params[:apk_path], test_apk_path: params[:test_apk_path], - device:, + device: device, test_targets: params[:test_targets], type: params[:type] ) # Download all of the outputs from the job to the local machine FirebaseTestRunner.download_result_files( - result:, + result: result, destination: test_dir, project_id: params[:project_id], key_file_path: params[:key_file] diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_send_app_size_metrics.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_send_app_size_metrics.rb index 183f4f37e..075f528a7 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_send_app_size_metrics.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_send_app_size_metrics.rb @@ -42,18 +42,18 @@ def self.run(params) unless params[:aab_path].nil? generate_split_apks(aab_path: params[:aab_path]) do |apk| split_name = File.basename(apk, '.apk') - add_apk_size_metrics(helper: metrics_helper, apkanalyzer_bin:, apk:, split_name:) + add_apk_size_metrics(helper: metrics_helper, apkanalyzer_bin: apkanalyzer_bin, apk: apk, split_name: split_name) end end unless params[:universal_apk_path].nil? - add_apk_size_metrics(helper: metrics_helper, apkanalyzer_bin:, apk: params[:universal_apk_path], split_name: UNIVERSAL_APK_SPLIT_NAME) + add_apk_size_metrics(helper: metrics_helper, apkanalyzer_bin: apkanalyzer_bin, apk: params[:universal_apk_path], split_name: UNIVERSAL_APK_SPLIT_NAME) end end # Send the payload metrics_helper.send_metrics( to: api_url, - api_token:, + api_token: api_token, use_gzip: params[:use_gzip_content_encoding] ) end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_release_notes.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_release_notes.rb index 60e4b7c79..5924acdfc 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_release_notes.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_release_notes.rb @@ -13,7 +13,7 @@ def self.run(params) path = params[:release_notes_file_path] next_version = Fastlane::Helper::Android::VersionHelper.calc_next_release_short_version(params[:new_version]) - Fastlane::Helper::ReleaseNotesHelper.add_new_section(path:, section_title: next_version) + Fastlane::Helper::ReleaseNotesHelper.add_new_section(path: path, section_title: next_version) Fastlane::Helper::GitHelper.commit(message: "Release Notes: add new section for next version (#{next_version})", files: path) UI.message 'Done.' diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_annotate_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_annotate_action.rb index e8850fd59..2b0b2f34f 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_annotate_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_annotate_action.rb @@ -14,8 +14,8 @@ def self.run(params) else # Add new annotation using `buildkite-agent` extra_params = { - context:, - style: + context: context, + style: style }.compact.flat_map { |k, v| ["--#{k}", v] } sh('buildkite-agent', 'annotate', *extra_params, params[:message]) end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb index e02c82987..ff0a092b4 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb @@ -15,7 +15,7 @@ def self.run(params) unless under_threshold_langs.empty? check_results( - under_threshold_langs:, + under_threshold_langs: under_threshold_langs, threshold: params[:min_acceptable_translation_percentage], skip_confirm: params[:skip_confirm] ) @@ -37,7 +37,7 @@ def self.check_translations(glotpress_url:, language_codes:, abort_on_violations under_threshold_langs = [] data = begin - Fastlane::Helper::GlotPressHelper.get_translation_status_data(glotpress_url:) + Fastlane::Helper::GlotPressHelper.get_translation_status_data(glotpress_url: glotpress_url) rescue StandardError nil end @@ -47,8 +47,8 @@ def self.check_translations(glotpress_url:, language_codes:, abort_on_violations UI.message("> Getting translation status for #{language_code}") progress = begin Fastlane::Helper::GlotPressHelper.get_translation_status( - data:, - language_code: + data: data, + language_code: language_code ) rescue StandardError -1 @@ -60,7 +60,7 @@ def self.check_translations(glotpress_url:, language_codes:, abort_on_violations end UI.message("Language #{language_code} is #{progress}% translated.") - under_threshold_langs.push({ lang: language_code, progress: }) if progress < threshold + under_threshold_langs.push({ lang: language_code, progress: progress }) if progress < threshold end under_threshold_langs diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/close_milestone_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/close_milestone_action.rb index 708a811bc..72cbecfa6 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/close_milestone_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/close_milestone_action.rb @@ -15,7 +15,7 @@ def self.run(params) UI.user_error!("Milestone #{milestone_title} not found.") if milestone.nil? - github_helper.update_milestone(repository:, number: milestone[:number], state: 'closed') + github_helper.update_milestone(repository: repository, number: milestone[:number], state: 'closed') end def self.description diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/copy_branch_protection_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/copy_branch_protection_action.rb index ad373c83f..8263577e2 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/copy_branch_protection_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/copy_branch_protection_action.rb @@ -13,7 +13,7 @@ def self.run(params) response = begin github_helper.get_branch_protection( - repository:, + repository: repository, branch: from_branch ) rescue Octokit::NotFound @@ -24,7 +24,7 @@ def self.run(params) response = begin github_helper.set_branch_protection( - repository:, + repository: repository, branch: to_branch, **settings ) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb index bd0e8f6a5..505814e22 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb @@ -26,10 +26,10 @@ def self.run(params) UI.message("Next milestone: #{newmilestone_number} due on #{newmilestone_duedate}.") github_helper.create_milestone( - repository:, + repository: repository, title: newmilestone_number, due_date: newmilestone_duedate, - days_until_submission:, + days_until_submission: days_until_submission, days_until_release: number_of_days_from_code_freeze_to_release ) end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb index 635e3ffee..f294a362b 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb @@ -24,13 +24,13 @@ def self.run(params) github_helper = Fastlane::Helper::GithubHelper.new(github_token: params[:github_token]) url = github_helper.create_release( - repository:, - version:, + repository: repository, + version: version, target: params[:target], description: release_notes, - assets:, - prerelease:, - is_draft: + assets: assets, + prerelease: prerelease, + is_draft: is_draft ) UI.success("Successfully created GitHub Release. You can see it at '#{url}'") url diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_between_tags.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_between_tags.rb index 20f00ad47..e4a7724ae 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_between_tags.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_between_tags.rb @@ -16,11 +16,11 @@ def self.run(params) github_helper = Fastlane::Helper::GithubHelper.new(github_token: gh_token) changelog = begin github_helper.generate_release_notes( - repository:, - tag_name:, - previous_tag:, - target_commitish:, - config_file_path: + repository: repository, + tag_name: tag_name, + previous_tag: previous_tag, + target_commitish: target_commitish, + config_file_path: config_file_path ) rescue StandardError => e error_msg = "❌ Error computing the list of PRs since #{previous_tag || 'last release'}: `#{e.message}`" @@ -31,7 +31,7 @@ def self.run(params) previous_release_link = if previous_tag.nil? 'last release' else - link = github_helper.get_release_url(repository:, tag_name: previous_tag) + link = github_helper.get_release_url(repository: repository, tag_name: previous_tag) "[#{previous_tag}](#{link})" end changelog diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb index 4aeda482d..0ec1960fe 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb @@ -13,7 +13,7 @@ def self.run(params) config = helper.read_config(params[:config_file]) - helper.check_fonts_installed!(config:) unless params[:skip_font_check] + helper.check_fonts_installed!(config: config) unless params[:skip_font_check] translation_directories = subdirectories_for_path(params[:metadata_folder]) image_directories = subdirectories_for_path(params[:orig_folder]) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/remove_branch_protection_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/remove_branch_protection_action.rb index 8bb85cd5c..5df37656e 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/remove_branch_protection_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/remove_branch_protection_action.rb @@ -10,7 +10,7 @@ def self.run(params) github_helper = Fastlane::Helper::GithubHelper.new(github_token: params[:github_token]) github_helper.remove_branch_protection( - repository:, + repository: repository, branch: branch_name ) rescue Octokit::NotFound diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/set_branch_protection_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/set_branch_protection_action.rb index e40fda071..361f2199b 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/set_branch_protection_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/set_branch_protection_action.rb @@ -11,7 +11,7 @@ def self.run(params) settings = if params[:keep_existing_settings_unchanged] Fastlane::Helper::GithubHelper.branch_protection_api_response_to_normalized_hash( - github_helper.get_branch_protection(repository:, branch: branch_name) + github_helper.get_branch_protection(repository: repository, branch: branch_name) ) else {} @@ -58,7 +58,7 @@ def self.run(params) # API Call - See https://docs.github.com/en/rest/branches/branch-protection#update-branch-protection response = github_helper.set_branch_protection( - repository:, + repository: repository, branch: branch_name, **settings ) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setfrozentag_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setfrozentag_action.rb index f739c4e9e..ca5e5d5d8 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setfrozentag_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setfrozentag_action.rb @@ -29,7 +29,7 @@ def self.run(params) end UI.message("New milestone: #{mile_title}") - github_helper.update_milestone(repository:, number: milestone[:number], title: mile_title) + github_helper.update_milestone(repository: repository, number: milestone[:number], title: mile_title) end def self.is_frozen(milestone) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/upload_to_s3.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/upload_to_s3.rb index b9647bc04..22fbe4030 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/upload_to_s3.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/upload_to_s3.rb @@ -42,8 +42,8 @@ def self.run(params) File.open(file_path, 'rb') do |file| Aws::S3::Client.new.put_object( body: file, - bucket:, - key: + bucket: bucket, + key: key ) rescue Aws::S3::Errors::ServiceError => e UI.crash!("Unable to upload file to S3: #{e.message}") @@ -58,8 +58,8 @@ def self.run(params) def self.file_is_already_uploaded?(bucket, key) response = Aws::S3::Client.new.head_object( - bucket:, - key: + bucket: bucket, + key: key ) response[:content_length].positive? rescue Aws::S3::Errors::NotFound diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb index 9570d04a9..95cdeacd2 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb @@ -55,7 +55,7 @@ def self.add_file encrypt = UI.confirm('Encrypt file?:') - Fastlane::Helper::ConfigureHelper.add_file(source:, destination:, encrypt:) + Fastlane::Helper::ConfigureHelper.add_file(source: source, destination: destination, encrypt: encrypt) end def self.secret_store_dir diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_download_strings_files_from_glotpress.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_download_strings_files_from_glotpress.rb index 28d817176..6eab435ab 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_download_strings_files_from_glotpress.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_download_strings_files_from_glotpress.rb @@ -19,7 +19,7 @@ def self.run(params) project_url: params[:project_url], locale: glotpress_locale, filters: params[:filters], - destination: + destination: destination ) # Do a quick check of the downloaded `.strings` file to ensure it looks valid validate_strings_file(destination) unless params[:skip_file_validation] diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_final_tag.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_final_tag.rb index d33289605..51c0b805f 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_final_tag.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_final_tag.rb @@ -12,7 +12,7 @@ def self.run(params) Fastlane::Helper::GitHelper.create_tag(version) - other_action.ios_clear_intermediate_tags(version:) + other_action.ios_clear_intermediate_tags(version: version) end ##################################################### diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb index 26d3e84f6..10b9b20c0 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb @@ -18,10 +18,10 @@ def self.run(params) case params[:format] when 'csv' - csv = Helper.format_csv(app_sizes, devices:) + csv = Helper.format_csv(app_sizes, devices: devices) UI.message "Result (CSV)\n\n#{csv}\n" when 'markdown' - tables = Helper.format_markdown(app_sizes, devices:) + tables = Helper.format_markdown(app_sizes, devices: devices) tables.each do |table| UI.message "Result (Markdown)\n\n#{table}\n" end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb index 54a36a787..01f9fdde6 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb @@ -14,7 +14,7 @@ def self.run(params) end end - report(violations:, base_lang: params[:base_lang]) + report(violations: violations, base_lang: params[:base_lang]) break unless !violations.empty? && params[:allow_retry] && UI.confirm(RETRY_MESSAGE) end @@ -53,7 +53,7 @@ def self.find_duplicated_keys(params) language = File.basename(File.dirname(file), '.lproj') path = File.join(params[:input_dir], file) - file_type = Fastlane::Helper::Ios::L10nHelper.strings_file_type(path:) + file_type = Fastlane::Helper::Ios::L10nHelper.strings_file_type(path: path) if file_type == :text duplicates = Fastlane::Helper::Ios::StringsFileValidationHelper.find_duplicated_keys(file: path) duplicate_keys[language] = duplicates.map { |key, value| "`#{key}` was found at multiple lines: #{value.join(', ')}" } unless duplicates.empty? diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_send_app_size_metrics.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_send_app_size_metrics.rb index 065c30232..dd891108a 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_send_app_size_metrics.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_send_app_size_metrics.rb @@ -44,7 +44,7 @@ def self.run(params) # Send the payload metrics_helper.send_metrics( to: api_url, - api_token:, + api_token: api_token, use_gzip: params[:use_gzip_content_encoding] ) end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb index 99e311c25..fbf31d381 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb @@ -13,7 +13,7 @@ def self.run(params) path = params[:release_notes_file_path] next_version = Fastlane::Helper::Ios::VersionHelper.calc_next_release_version(params[:new_version]) - Fastlane::Helper::ReleaseNotesHelper.add_new_section(path:, section_title: next_version) + Fastlane::Helper::ReleaseNotesHelper.add_new_section(path: path, section_title: next_version) Fastlane::Helper::GitHelper.commit(message: "Release Notes: add new section for next version (#{next_version})", files: path) UI.message 'Done.' diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_emulator_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_emulator_helper.rb index ea3768811..141d0899b 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_emulator_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_emulator_helper.rb @@ -21,7 +21,7 @@ def initialize # @return [String] The `sdkmanager` package specifier that has been installed # def install_system_image(api:) - package = system_image_package(api:) + package = system_image_package(api: api) UI.message("Installing System Image for Android #{api} (#{package})") Actions.sh(@tools.sdkmanager, '--install', package) @@ -39,7 +39,7 @@ def install_system_image(api:) # @return [String] The device name (i.e. either `name` if provided, or the derived `_API_` if provided `name` was `nil``) # def create_avd(api:, device:, system_image: nil, name: nil, sdcard: '512M') - package = system_image || system_image_package(api:) + package = system_image || system_image_package(api: api) device_name = name || "#{device.gsub(' ', '_').capitalize}_API_#{api}" UI.message("Creating AVD `#{device_name}` (#{device}, API #{api})") diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb index ef7a76a43..74d6b6048 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb @@ -243,7 +243,7 @@ def self.download_from_glotpress(res_dir:, glotpress_project_url:, locales_map:, locales_map.each do |lang_codes| all_xml_documents = glotpress_filters.map do |filters| UI.message "Downloading translations for '#{lang_codes[:android]}' from GlotPress (#{lang_codes[:glotpress]}) [#{filters}]..." - download_glotpress_export_file(project_url: glotpress_project_url, locale: lang_codes[:glotpress], filters:) + download_glotpress_export_file(project_url: glotpress_project_url, locale: lang_codes[:glotpress], filters: filters) end.compact next if all_xml_documents.empty? diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_tools_path_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_tools_path_helper.rb index 59b8202a5..7d31aca45 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_tools_path_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_tools_path_helper.rb @@ -39,7 +39,7 @@ def find_tool_path(binary:, search_paths:) # @return [String] The absolute path of the tool if found. # @raise [FastlaneCore::Interface::FastlaneError] If the tool couldn't be found. def find_tool_path!(binary:, search_paths:) - bin_path = find_tool_path(binary:, search_paths:) + bin_path = find_tool_path(binary: binary, search_paths: search_paths) UI.user_error!("Unable to find path for #{binary} in #{search_paths.inspect}. Verify you installed the proper Android tools.") if bin_path.nil? bin_path end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/app_size_metrics_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/app_size_metrics_helper.rb index 9dc08ce21..f200a160a 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/app_size_metrics_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/app_size_metrics_helper.rb @@ -22,7 +22,7 @@ def initialize(metadata = {}) # @param [Hash] hash The metadata common to all the metrics of the payload built by that helper instance. Can be any arbitrary set of key/value pairs # def metadata=(hash) - @metadata = (hash.compact || {}).map { |key, value| { name: key.to_s, value: } } + @metadata = (hash.compact || {}).map { |key, value| { name: key.to_s, value: value } } end # Adds a single metric to the group of metrics @@ -32,7 +32,7 @@ def metadata=(hash) # @param [Hash] metadata The arbitrary dictionary of metadata to associate to that metric entry # def add_metric(name:, value:, metadata: nil) - metric = { name:, value: } + metric = { name: name, value: value } metadata = metadata&.compact || {} # Remove nil values if any (and use empty Hash if nil was provided) metric[:meta] = metadata.map { |meta_key, meta_value| { name: meta_key.to_s, value: meta_value } } unless metadata.empty? @metrics.append(metric) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/ci_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/ci_helper.rb index 105109ae2..f448df8be 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/ci_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/ci_helper.rb @@ -80,7 +80,7 @@ def trigger_job(branch:, parameters: nil) Net::HTTP.start(command_uri.host, command_uri.port, use_ssl: true) do |http| request = Net::HTTP::Post.new(command_uri.request_uri, headers) - body = { branch:, parameters: } + body = { branch: branch, parameters: parameters } request.body = body.to_json response = http.request(request) return response diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb index 12b712129..0496cb17f 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb @@ -16,7 +16,7 @@ module GitHelper # def self.is_git_repo?(path: Dir.pwd) # If the path doesn't exist, find its first ancestor. - path = first_existing_ancestor_of(path:) + path = first_existing_ancestor_of(path: path) # Get the path's directory, so we can look in it for the Git folder dir = path.directory? ? path : path.dirname @@ -220,7 +220,7 @@ def self.ensure_on_branch!(branch_name) # # @return [Bool] True if the given path is ignored or outside a Git repository, false otherwise. def self.is_ignored?(path:) - return true unless is_git_repo?(path:) + return true unless is_git_repo?(path: path) Actions.sh('git', 'check-ignore', path) do |status, _, _| status.success? diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb index d5b9b6850..8985faf6b 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb @@ -127,7 +127,7 @@ def create_release(repository:, version:, description:, assets:, prerelease:, is version, # tag name name: version, # release name target_commitish: target || Git.open(Dir.pwd).log.first.sha, - prerelease:, + prerelease: prerelease, draft: is_draft, body: description ) @@ -154,10 +154,10 @@ def generate_release_notes(repository:, tag_name:, previous_tag:, target_commiti api_url = "#{repo_path}/releases/generate-notes" res = client.post( api_url, - tag_name:, - target_commitish:, # Only used if no git tag named `tag_name` exists yet + tag_name: tag_name, + target_commitish: target_commitish, # Only used if no git tag named `tag_name` exists yet previous_tag_name: previous_tag, - config_file_path: + config_file_path: config_file_path ) res.body end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/interactive_prompt_reminder.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/interactive_prompt_reminder.rb index d528e9bf1..09e97c58f 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/interactive_prompt_reminder.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/interactive_prompt_reminder.rb @@ -75,7 +75,7 @@ def self.monkey_patch_interactive_prompts_with_reminder(after: DEFAULT_PROMPT_RE old_method = instance_method(method_name) define_method(method_name) do |*args| - FastlaneCore::Shell.with_reminder(after:, message:) { old_method.bind(self).call(*args) } + FastlaneCore::Shell.with_reminder(after: after, message: message) { old_method.bind(self).call(*args) } end end end @@ -89,5 +89,5 @@ def self.monkey_patch_interactive_prompts_with_reminder(after: DEFAULT_PROMPT_RE delays = ENV['FASTLANE_PROMPT_REMINDER_DELAYS']&.split(',')&.map(&:to_i) || FastlaneCore::Shell::DEFAULT_PROMPT_REMINDER_DELAYS FastlaneCore::UI.verbose("Monkey-patching the UI interactive methods to add a reminder (#{delays.inspect}, #{message.inspect})") - FastlaneCore::Shell.monkey_patch_interactive_prompts_with_reminder(after: delays, message:) + FastlaneCore::Shell.monkey_patch_interactive_prompts_with_reminder(after: delays, message: message) end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb index 63836245e..d7e1e89ef 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb @@ -62,7 +62,7 @@ def install_swiftgen! # def run(input_dir:, base_lang: DEFAULT_BASE_LANG, only_langs: nil) check_swiftgen_installed || install_swiftgen! - find_diffs(input_dir:, base_lang:, only_langs:) + find_diffs(input_dir: input_dir, base_lang: base_lang, only_langs: only_langs) end ################## diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb index 4eead17e3..aa73a845d 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb @@ -21,7 +21,7 @@ def initialize(target_folder, target_files, auto_retry) def download(target_locale, glotpress_url, is_source) uri = URI(glotpress_url) response = Net::HTTP.get_response(uri) - handle_glotpress_download(response:, locale: target_locale, is_source:) + handle_glotpress_download(response: response, locale: target_locale, is_source: is_source) end # Parse JSON data and update the local files diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/models/configuration.rb b/lib/fastlane/plugin/wpmreleasetoolkit/models/configuration.rb index 066be47cc..c1bc33124 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/models/configuration.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/models/configuration.rb @@ -23,17 +23,17 @@ def save_to_file(path) end def add_file_to_copy(source, destination, encrypt: false) - file = FileReference.new(file: source, destination:, encrypt:) + file = FileReference.new(file: source, destination: destination, encrypt: encrypt) files_to_copy << file end def to_hash { - project_name:, - branch:, - pinned_hash:, + project_name: project_name, + branch: branch, + pinned_hash: pinned_hash, files_to_copy: files_to_copy.map(&:to_hash), - file_dependencies: + file_dependencies: file_dependencies } end end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/models/file_reference.rb b/lib/fastlane/plugin/wpmreleasetoolkit/models/file_reference.rb index e12bf1352..9874a183d 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/models/file_reference.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/models/file_reference.rb @@ -74,7 +74,7 @@ def encryption_key end def to_hash - { file:, destination:, encrypt: } + { file: file, destination: destination, encrypt: encrypt } end end end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_test_runner.rb b/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_test_runner.rb index d1a0c7cb2..8310b4253 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_test_runner.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_test_runner.rb @@ -27,7 +27,7 @@ def self.run_tests(project_id:, apk_path:, test_apk_path:, device:, test_targets params = { project: project_id, - type:, + type: type, app: apk_path, test: test_apk_path, 'test-targets': test_targets, @@ -42,7 +42,7 @@ def self.run_tests(project_id:, apk_path:, test_apk_path:, device:, test_targets Action.sh("#{command} 2>&1 | tee #{log_file_path}") # Make the file object available to other tasks - result = FirebaseTestLabResult.new(log_file_path:) + result = FirebaseTestLabResult.new(log_file_path: log_file_path) Fastlane::Actions.lane_context[:FIREBASE_TEST_LOG_FILE] = result result @@ -64,7 +64,7 @@ def self.download_result_files(result:, destination:, project_id:, key_file_path FileUtils.mkdir_p(destination) unless File.directory?(destination) storage = Google::Cloud::Storage.new( - project_id:, + project_id: project_id, credentials: key_file_path ) @@ -74,7 +74,7 @@ def self.download_result_files(result:, destination:, project_id:, key_file_path # Download the files UI.header "Downloading Results Files to #{destination}" - files_to_download.each { |file| download_file(file:, destination:) } + files_to_download.each { |file| download_file(file: file, destination: destination) } end # Download a Google Cloud Storage file to the local machine, creating intermediate directories as needed. diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/date_version_calculator.rb b/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/date_version_calculator.rb index fbaa89246..795e6da2c 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/date_version_calculator.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/date_version_calculator.rb @@ -28,7 +28,7 @@ def next_release_version(version:) new_version else - next_minor_version(version:) + next_minor_version(version: version) end end end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/marketing_version_calculator.rb b/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/marketing_version_calculator.rb index 092653e65..686bc3617 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/marketing_version_calculator.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/marketing_version_calculator.rb @@ -18,7 +18,7 @@ class MarketingVersionCalculator < AbstractVersionCalculator def next_release_version(version:) UI.user_error!('Marketing Versioning: The minor version cannot be greater than 9') if version.minor > 9 - version.minor == 9 ? next_major_version(version:) : next_minor_version(version:) + version.minor == 9 ? next_major_version(version: version) : next_minor_version(version: version) end end end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/semantic_version_calculator.rb b/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/semantic_version_calculator.rb index 66f52cbb5..6e29da361 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/semantic_version_calculator.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/semantic_version_calculator.rb @@ -13,7 +13,7 @@ class SemanticVersionCalculator < AbstractVersionCalculator # @return [AppVersion] The next semantic release version. # def next_release_version(version:) - next_minor_version(version:) + next_minor_version(version: version) end end end diff --git a/rakelib/changelog_parser.rake b/rakelib/changelog_parser.rake index 6ba0046f2..cc7ab00ea 100644 --- a/rakelib/changelog_parser.rake +++ b/rakelib/changelog_parser.rake @@ -18,12 +18,12 @@ class ChangelogParser prev_subtitle = nil loop do (lines, next_level, next_subtitle) = advance_to_next_header(level: 2..3) - subsections.append({ title: prev_subtitle, lines: }) unless lines.reject { |l| l.chomp.empty? || l.chomp == EMPTY_PLACEHOLDER }.empty? + subsections.append({ title: prev_subtitle, lines: lines }) unless lines.reject { |l| l.chomp.empty? || l.chomp == EMPTY_PLACEHOLDER }.empty? prev_subtitle = next_subtitle break if next_level < 3 end - @pending_section = { lines_before: lines_before_first_section, subsections:, next_title: prev_subtitle } + @pending_section = { lines_before: lines_before_first_section, subsections: subsections, next_title: prev_subtitle } prev_subtitle end diff --git a/spec/abstract_version_calculator_spec.rb b/spec/abstract_version_calculator_spec.rb index 60e30bf48..e26f1eafb 100644 --- a/spec/abstract_version_calculator_spec.rb +++ b/spec/abstract_version_calculator_spec.rb @@ -4,7 +4,7 @@ describe 'calculates the next version number' do it 'increments the major version by 1 and sets the minor, patch, and build number to 0' do version = Fastlane::Models::AppVersion.new(19, 20, 21, 22) - bumped_version = described_class.new.next_major_version(version:) + bumped_version = described_class.new.next_major_version(version: version) # Test that the original version is not modified expect(version.to_s).to eq('19.20.21.22') @@ -13,7 +13,7 @@ it 'increments the minor version by 1 and sets the patch and build number to 0' do version = Fastlane::Models::AppVersion.new(19, 20, 21, 22) - bumped_version = described_class.new.next_minor_version(version:) + bumped_version = described_class.new.next_minor_version(version: version) # Test that the original version is not modified expect(version.to_s).to eq('19.20.21.22') @@ -22,7 +22,7 @@ it 'increments the patch version by 1 and sets the build number to 0' do version = Fastlane::Models::AppVersion.new(19, 20, 21, 22) - bumped_version = described_class.new.next_patch_version(version:) + bumped_version = described_class.new.next_patch_version(version: version) # Test that the original version is not modified expect(version.to_s).to eq('19.20.21.22') @@ -31,7 +31,7 @@ it 'increments the build number by 1' do version = Fastlane::Models::AppVersion.new(19, 20, 21, 22) - bumped_version = described_class.new.next_build_number(version:) + bumped_version = described_class.new.next_build_number(version: version) # Test that the original version is not modified expect(version.to_s).to eq('19.20.21.22') @@ -42,7 +42,7 @@ describe 'calculates the previous version number' do it 'decrements the patch version by 1 and sets the build number to 0' do version = Fastlane::Models::AppVersion.new(13, 2, 1, 3) - previous_version = described_class.new.previous_patch_version(version:) + previous_version = described_class.new.previous_patch_version(version: version) # Test that the original version is not modified expect(version.to_s).to eq('13.2.1.3') diff --git a/spec/an_localize_libs_action_spec.rb b/spec/an_localize_libs_action_spec.rb index 3586048d0..e3d97b586 100644 --- a/spec/an_localize_libs_action_spec.rb +++ b/spec/an_localize_libs_action_spec.rb @@ -32,7 +32,7 @@ def write_android_xml(path, lines) File.write(lib2_strings_path, android_xml_with_lines(['test from lib 2'])) run_described_fastlane_action( - app_strings_path:, + app_strings_path: app_strings_path, libs_strings_path: [ { library: 'lib_1', strings_path: lib1_strings_path, exclusions: [] }, { library: 'lib_2', strings_path: lib2_strings_path, exclusions: [] }, @@ -67,7 +67,7 @@ def write_android_xml(path, lines) File.write(lib_strings_path, android_xml_with_lines(lib_xml_lines)) run_described_fastlane_action( - app_strings_path:, + app_strings_path: app_strings_path, libs_strings_path: [ { library: 'lib', strings_path: lib_strings_path, exclusions: [] }, ] @@ -108,7 +108,7 @@ def write_android_xml(path, lines) File.write(lib2_strings_path, android_xml_with_lines(lib2_xml_lines)) run_described_fastlane_action( - app_strings_path:, + app_strings_path: app_strings_path, libs_strings_path: [ { library: 'lib1', strings_path: lib1_strings_path, source_id: 'lib1-id' }, { library: 'lib2', strings_path: lib2_strings_path, source_id: 'lib2-id' }, @@ -157,7 +157,7 @@ def write_android_xml(path, lines) File.write(lib2_strings_path, android_xml_with_lines(lib2_xml_lines)) run_described_fastlane_action( - app_strings_path:, + app_strings_path: app_strings_path, libs_strings_path: [ { library: 'lib1', strings_path: lib1_strings_path, source_id: 'lib1', add_ignore_attr: true }, { library: 'lib2', strings_path: lib2_strings_path, source_id: 'lib2' }, @@ -201,7 +201,7 @@ def write_android_xml(path, lines) File.write(lib_strings_path, android_xml_with_lines(lib_xml_lines)) run_described_fastlane_action( - app_strings_path:, + app_strings_path: app_strings_path, libs_strings_path: [ { library: 'lib', strings_path: lib_strings_path, exclusions: ['override-missing'] }, ] diff --git a/spec/android_send_app_size_metrics_spec.rb b/spec/android_send_app_size_metrics_spec.rb index 3f536f9e8..2f0455587 100644 --- a/spec/android_send_app_size_metrics_spec.rb +++ b/spec/android_send_app_size_metrics_spec.rb @@ -49,8 +49,8 @@ def test_app_size_action(fake_aab_size:, fake_apks:, fake_universal_apk_sizes:, # Act action_params = { api_url: File.join('file://localhost/', output_file), - aab_path:, - universal_apk_path:, + aab_path: aab_path, + universal_apk_path: universal_apk_path, **other_action_args }.compact code = run_described_fastlane_action(action_params) diff --git a/spec/android_version_file_spec.rb b/spec/android_version_file_spec.rb index 9162fa5d9..cd21f84cb 100644 --- a/spec/android_version_file_spec.rb +++ b/spec/android_version_file_spec.rb @@ -131,7 +131,7 @@ CONTENT with_tmp_file(named: 'version.properties', content: existing_content) do |tmp_file_path| - described_class.new(version_properties_path: tmp_file_path).write_version(version_name:, version_code:) + described_class.new(version_properties_path: tmp_file_path).write_version(version_name: version_name, version_code: version_code) current_content = File.read(tmp_file_path) expect(current_content).to eq(expected_content.strip) @@ -153,7 +153,7 @@ CONTENT with_tmp_file(named: 'version.properties', content: existing_content) do |tmp_file_path| - described_class.new(version_properties_path: tmp_file_path).write_version(version_name:, version_code:) + described_class.new(version_properties_path: tmp_file_path).write_version(version_name: version_name, version_code: version_code) current_content = File.read(tmp_file_path) expect(current_content).to eq(expected_content.strip) diff --git a/spec/buildkite_annotate_action_spec.rb b/spec/buildkite_annotate_action_spec.rb index fa98be7a4..f042acee7 100644 --- a/spec/buildkite_annotate_action_spec.rb +++ b/spec/buildkite_annotate_action_spec.rb @@ -17,7 +17,7 @@ expect(FastlaneCore::UI).not_to receive(:user_error!) cmd = run_described_fastlane_action( context: 'ctx', - style:, + style: style, message: 'message' ) expect(cmd).to eq("buildkite-agent annotate --context ctx --style #{style} message") diff --git a/spec/check_localization_progress_spec.rb b/spec/check_localization_progress_spec.rb index c3726fe6f..d9275d98d 100644 --- a/spec/check_localization_progress_spec.rb +++ b/spec/check_localization_progress_spec.rb @@ -336,11 +336,11 @@ def generate_glotpress_response_header def generate_glotpress_response_for_language(lang:, lang_code:, current:, fuzzy:, waiting:, untranslated:, progress:) res = "\n" - res << generate_glotpress_response_header_for_language(lang:, lang_code:, progress:) - res << generate_glotpress_response_for_language_status(lang_code:, status_main: 'translated', status: 'current', string_count: current) - res << generate_glotpress_response_for_language_status(lang_code:, status_main: 'fuzzy', status: 'fuzzy', string_count: fuzzy) - res << generate_glotpress_response_for_language_status(lang_code:, status_main: 'untranslated', status: 'untranslated', string_count: waiting) - res << generate_glotpress_response_for_language_status(lang_code:, status_main: 'waiting', status: 'waiting', string_count: untranslated) + res << generate_glotpress_response_header_for_language(lang: lang, lang_code: lang_code, progress: progress) + res << generate_glotpress_response_for_language_status(lang_code: lang_code, status_main: 'translated', status: 'current', string_count: current) + res << generate_glotpress_response_for_language_status(lang_code: lang_code, status_main: 'fuzzy', status: 'fuzzy', string_count: fuzzy) + res << generate_glotpress_response_for_language_status(lang_code: lang_code, status_main: 'untranslated', status: 'untranslated', string_count: waiting) + res << generate_glotpress_response_for_language_status(lang_code: lang_code, status_main: 'waiting', status: 'waiting', string_count: untranslated) res << '' end diff --git a/spec/configure_helper_spec.rb b/spec/configure_helper_spec.rb index 2afb5457d..ab01e1372 100644 --- a/spec/configure_helper_spec.rb +++ b/spec/configure_helper_spec.rb @@ -17,7 +17,7 @@ expect(Fastlane::UI).to receive(:user_error!) - described_class.add_file(source: 'path/to/source', destination:, encrypt: true) + described_class.add_file(source: 'path/to/source', destination: destination, encrypt: true) end end end diff --git a/spec/copy_branch_protection_action_spec.rb b/spec/copy_branch_protection_action_spec.rb index f541b20db..99a0d76e1 100644 --- a/spec/copy_branch_protection_action_spec.rb +++ b/spec/copy_branch_protection_action_spec.rb @@ -41,9 +41,9 @@ def stub_response(hash) run_described_fastlane_action( repository: repo, - from_branch:, - to_branch:, - github_token: + from_branch: from_branch, + to_branch: to_branch, + github_token: github_token ) end @@ -53,9 +53,9 @@ def stub_response(hash) expect do run_described_fastlane_action( repository: repo, - from_branch:, - to_branch:, - github_token: + from_branch: from_branch, + to_branch: to_branch, + github_token: github_token ) end.to raise_error(FastlaneCore::Interface::FastlaneError, "Branch `#{from_branch}` of repository `#{repo}` was not found.") end @@ -66,9 +66,9 @@ def stub_response(hash) expect do run_described_fastlane_action( repository: repo, - from_branch:, - to_branch:, - github_token: + from_branch: from_branch, + to_branch: to_branch, + github_token: github_token ) end.to raise_error(FastlaneCore::Interface::FastlaneError, "Branch `#{from_branch}` does not have any branch protection set up.") end @@ -82,9 +82,9 @@ def stub_response(hash) expect do run_described_fastlane_action( repository: repo, - from_branch:, - to_branch:, - github_token: + from_branch: from_branch, + to_branch: to_branch, + github_token: github_token ) end.to raise_error(FastlaneCore::Interface::FastlaneError, "Branch `#{to_branch}` of repository `#{repo}` was not found.") end diff --git a/spec/date_build_code_calculator_spec.rb b/spec/date_build_code_calculator_spec.rb index 046afdb27..28a5cdb44 100644 --- a/spec/date_build_code_calculator_spec.rb +++ b/spec/date_build_code_calculator_spec.rb @@ -5,7 +5,7 @@ it 'returns an AppVersion object with the build number set to today\'s date' do allow(DateTime).to receive(:now).and_return(DateTime.new(2024, 4, 15)) version = Fastlane::Models::AppVersion.new(19, 3, 1, 1) - formatted_version = described_class.new.next_build_code(version:) + formatted_version = described_class.new.next_build_code(version: version) # Test that the original version is not modified expect(version.to_s).to eq('19.3.1.1') expect(formatted_version.to_s).to eq('19.3.1.20240415') diff --git a/spec/date_version_calculator_spec.rb b/spec/date_version_calculator_spec.rb index 6493d2ae3..c0b4a53fd 100644 --- a/spec/date_version_calculator_spec.rb +++ b/spec/date_version_calculator_spec.rb @@ -6,7 +6,7 @@ it 'increments the minor version number without prompting the user' do allow(Time).to receive(:now).and_return(Time.new(2024, 4, 15)) version = Fastlane::Models::AppVersion.new(2024, 13, 1, 1) - bumped_version = described_class.new.next_release_version(version:) + bumped_version = described_class.new.next_release_version(version: version) # Test that the original version is not modified expect(version.to_s).to eq('2024.13.1.1') expect(bumped_version.to_s).to eq('2024.14.0.0') @@ -19,7 +19,7 @@ allow(Time).to receive(:now).and_return(Time.new(2023, 12, 3)) allow(FastlaneCore::UI).to receive(:confirm).and_return(true) version = Fastlane::Models::AppVersion.new(2023, 30, 1, 2) - bumped_version = described_class.new.next_release_version(version:) + bumped_version = described_class.new.next_release_version(version: version) # Test that the original version is not modified expect(version.to_s).to eq('2023.30.1.2') expect(bumped_version.to_s).to eq('2024.1.0.0') @@ -31,7 +31,7 @@ allow(Time).to receive(:now).and_return(Time.new(2023, 12, 1)) allow(FastlaneCore::UI).to receive(:confirm).and_return(false) version = Fastlane::Models::AppVersion.new(2023, 30, 1, 2) - bumped_version = described_class.new.next_release_version(version:) + bumped_version = described_class.new.next_release_version(version: version) # Test that the original version is not modified expect(version.to_s).to eq('2023.30.1.2') expect(bumped_version.to_s).to eq('2023.31.0.0') diff --git a/spec/derived_build_code_formatter_spec.rb b/spec/derived_build_code_formatter_spec.rb index 2f9cf2f50..46dfcce4c 100644 --- a/spec/derived_build_code_formatter_spec.rb +++ b/spec/derived_build_code_formatter_spec.rb @@ -4,13 +4,13 @@ describe 'derives a build code from an AppVersion object' do it 'derives the build code from version numbers that are single digits' do version = Fastlane::Models::AppVersion.new(1, 2, 3, 4) - build_code_string = described_class.new.build_code(version:) + build_code_string = described_class.new.build_code(version: version) expect(build_code_string.to_s).to eq('101020304') end it 'derives the build code from version numbers that are two digits' do version = Fastlane::Models::AppVersion.new(12, 34, 56, 78) - build_code_string = described_class.new.build_code(version:) + build_code_string = described_class.new.build_code(version: version) expect(build_code_string.to_s).to eq('112345678') end end diff --git a/spec/file_reference_spec.rb b/spec/file_reference_spec.rb index 2100b1bff..689616819 100644 --- a/spec/file_reference_spec.rb +++ b/spec/file_reference_spec.rb @@ -128,6 +128,6 @@ def stub_path_as_ignored(path:, ignored:) allow(Fastlane::Helper::GitHelper).to receive(:is_ignored?) - .with(path:) + .with(path: path) .and_return(ignored) end diff --git a/spec/firebase_device_spec.rb b/spec/firebase_device_spec.rb index 8e2344d6a..dd15f0625 100644 --- a/spec/firebase_device_spec.rb +++ b/spec/firebase_device_spec.rb @@ -14,7 +14,7 @@ end def create_model(model: 'Nexus5', version: 27, locale: 'en', orientation: 'portrait') - described_class.new(model:, version:, locale:, orientation:) + described_class.new(model: model, version: version, locale: locale, orientation: orientation) end describe 'initialization' do diff --git a/spec/firebase_test_runner_spec.rb b/spec/firebase_test_runner_spec.rb index c76d93e82..92ebcfcdd 100644 --- a/spec/firebase_test_runner_spec.rb +++ b/spec/firebase_test_runner_spec.rb @@ -76,12 +76,12 @@ def run_tests(project_id: 'foo-bar-baz', apk_path: default_file, test_apk_path: default_file, device: 'device', test_targets: nil, type: 'instrumentation') Fastlane::Actions.lane_context[:FIREBASE_TEST_LOG_FILE_PATH] = runner_temp_file described_class.run_tests( - project_id:, - apk_path:, - test_apk_path:, - device:, - test_targets:, - type: + project_id: project_id, + apk_path: apk_path, + test_apk_path: test_apk_path, + device: device, + test_targets: test_targets, + type: type ) end end @@ -100,10 +100,10 @@ def run_tests(project_id: 'foo-bar-baz', apk_path: default_file, test_apk_path: def run_download(result: passed_test_log, destination: '/tmp/test', project_id: 'foo-bar-baz', key_file_path: 'invalid') described_class.download_result_files( - result:, - destination:, - project_id:, - key_file_path: + result: result, + destination: destination, + project_id: project_id, + key_file_path: key_file_path ) end end diff --git a/spec/four_part_build_code_formatter_spec.rb b/spec/four_part_build_code_formatter_spec.rb index 7f92a7372..c065f3c76 100644 --- a/spec/four_part_build_code_formatter_spec.rb +++ b/spec/four_part_build_code_formatter_spec.rb @@ -4,7 +4,7 @@ describe 'formats an AppVersion object as a four part build code' do it 'returns the four part build code as a string' do version = Fastlane::Models::AppVersion.new(1, 2, 3, 4) - build_code_string = described_class.new.build_code(version:) + build_code_string = described_class.new.build_code(version: version) expect(build_code_string.to_s).to eq('1.2.3.4') end end diff --git a/spec/get_prs_between_tags_spec.rb b/spec/get_prs_between_tags_spec.rb index 15c60c1f2..ad27285ff 100644 --- a/spec/get_prs_between_tags_spec.rb +++ b/spec/get_prs_between_tags_spec.rb @@ -60,9 +60,9 @@ def test_with_params(target_commitish: nil, previous_tag: nil, configuration_fil github_token: test_token, repository: test_repo, tag_name: test_tag_name, - target_commitish:, - previous_tag:, - configuration_file_path: + target_commitish: target_commitish, + previous_tag: previous_tag, + configuration_file_path: configuration_file_path ) # Assert @@ -120,9 +120,9 @@ def test_with_params(target_commitish: nil, previous_tag: nil, configuration_fil github_token: test_token, repository: test_repo, tag_name: test_tag_name, - target_commitish:, - previous_tag:, - configuration_file_path: + target_commitish: target_commitish, + previous_tag: previous_tag, + configuration_file_path: configuration_file_path ) # Assert diff --git a/spec/git_helper_spec.rb b/spec/git_helper_spec.rb index 5b4963957..3a814a59f 100644 --- a/spec/git_helper_spec.rb +++ b/spec/git_helper_spec.rb @@ -49,7 +49,7 @@ `git -C #{dir} init --initial-branch main || git -C #{dir} init` path = File.join(dir, 'a', 'b') `mkdir -p #{path}` - expect(described_class.is_git_repo?(path:)).to be true + expect(described_class.is_git_repo?(path: path)).to be true end end @@ -101,7 +101,7 @@ files = ['file 1', 'file 2', 'file 3'] expect_shell_command('git', 'add', files[0], files[1], files[2]) expect_shell_command('git', 'commit', '-m', @message) - described_class.commit(message: @message, files:) + described_class.commit(message: @message, files: files) end it 'adds all pending file changes before commit if :all is provided as `files`' do @@ -118,7 +118,7 @@ dummy_file_path: path, add_file_to_gitignore: false ) - expect(described_class.is_ignored?(path:)).to be false + expect(described_class.is_ignored?(path: path)).to be false end context 'when the path is in the .gitignore' do @@ -132,7 +132,7 @@ add_file_to_gitignore: true, commit_gitignore: false ) - expect(described_class.is_ignored?(path:)).to be true + expect(described_class.is_ignored?(path: path)).to be true end it 'returns true when the .gitignore has no uncommitted changes' do @@ -141,7 +141,7 @@ add_file_to_gitignore: true, commit_gitignore: true ) - expect(described_class.is_ignored?(path:)).to be true + expect(described_class.is_ignored?(path: path)).to be true end end @@ -149,7 +149,7 @@ # We need the ability to tell if a path result is ignored, regardless of whether it exists yet. it 'returns false for files not yet created but part of the repository' do setup_git_repo - expect(described_class.is_ignored?(path:)).to be false + expect(described_class.is_ignored?(path: path)).to be false end it 'returns true when the path is outside the repository folder' do @@ -157,14 +157,14 @@ path = File.join(@path, '..', 'dummy.txt') setup_git_repo(dummy_file_path: path, add_file_to_gitignore: false) - expect(described_class.is_ignored?(path:)).to be true + expect(described_class.is_ignored?(path: path)).to be true end # This is sort of redundant given the previous example already ensures the same logic. # But, we'll be using paths starting with `~` as part of our configurations, so it felt appopriate to explicitly ensure this important use case is respected. it 'returns true when the path is in the home folder ' do path = '~/a/path' - expect(described_class.is_ignored?(path:)).to be true + expect(described_class.is_ignored?(path: path)).to be true end end end diff --git a/spec/github_helper_spec.rb b/spec/github_helper_spec.rb index 0b8734dbd..1f3225e96 100644 --- a/spec/github_helper_spec.rb +++ b/spec/github_helper_spec.rb @@ -40,7 +40,7 @@ def download_file_from_tag(download_folder:) helper = described_class.new(github_token: 'Fake-GitHubToken-123') - helper.download_file_from_tag(repository: test_repo, tag: test_tag, file_path: test_file, download_folder:) + helper.download_file_from_tag(repository: test_repo, tag: test_tag, file_path: test_file, download_folder: download_folder) end end @@ -67,12 +67,12 @@ def download_file_from_tag(download_folder:) end def mock_milestone(title) - { title: } + { title: title } end def get_last_milestone(repository:) helper = described_class.new(github_token: 'Fake-GitHubToken-123') - helper.get_last_milestone(repository:) + helper.get_last_milestone(repository: repository) end end @@ -130,7 +130,7 @@ def comment_on_pr end def mock_comment(body: ' Test', user_id: 1234) - instance_double('Comment', id: 1234, body:, user: instance_double('User', id: user_id)) + instance_double('Comment', id: 1234, body: body, user: instance_double('User', id: user_id)) end end @@ -225,7 +225,7 @@ def get_milestone(milestone_name:) } expect(client).to receive(:create_milestone).with(test_repo, test_milestone_number, options) - create_milestone(due_date:, days_until_submission: 4, days_until_release: 7) + create_milestone(due_date: due_date, days_until_submission: 4, days_until_release: 7) end it 'computes the correct dates when submission and release dates are in the same day' do @@ -236,7 +236,7 @@ def get_milestone(milestone_name:) } expect(client).to receive(:create_milestone).with(test_repo, test_milestone_number, options) - create_milestone(due_date:, days_until_submission: 1, days_until_release: 1) + create_milestone(due_date: due_date, days_until_submission: 1, days_until_release: 1) end it 'computes the correct dates when the due date is on the verge of a DST day change' do @@ -252,7 +252,7 @@ def get_milestone(milestone_name:) } expect(client).to receive(:create_milestone).with(test_repo, test_milestone_number, options) - create_milestone(due_date:, days_until_submission: 2, days_until_release: 3) + create_milestone(due_date: due_date, days_until_submission: 2, days_until_release: 3) end end @@ -269,7 +269,7 @@ def get_milestone(milestone_name:) } expect(client).to receive(:create_milestone).with(test_repo, test_milestone_number, options) - create_milestone(due_date:, days_until_submission: 2, days_until_release: 3) + create_milestone(due_date: due_date, days_until_submission: 2, days_until_release: 3) end end @@ -285,7 +285,7 @@ def get_milestone(milestone_name:) } expect(client).to receive(:create_milestone).with(test_repo, test_milestone_number, options) - create_milestone(due_date:, days_until_submission: 2, days_until_release: 3) + create_milestone(due_date: due_date, days_until_submission: 2, days_until_release: 3) end end @@ -299,7 +299,7 @@ def get_milestone(milestone_name:) } expect(client).to receive(:create_milestone).with(test_repo, test_milestone_number, options) - create_milestone(due_date:, days_until_submission: 140, days_until_release: 146) + create_milestone(due_date: due_date, days_until_submission: 140, days_until_release: 146) end end @@ -313,7 +313,7 @@ def get_milestone(milestone_name:) } expect(client).to receive(:create_milestone).with(test_repo, test_milestone_number, options) - create_milestone(due_date:, days_until_submission: 216, days_until_release: 217) + create_milestone(due_date: due_date, days_until_submission: 216, days_until_release: 217) end end @@ -328,7 +328,7 @@ def get_milestone(milestone_name:) } expect(client).to receive(:create_milestone).with(test_repo, test_milestone_number, options) - create_milestone(due_date:, days_until_submission: 60, days_until_release: 61) + create_milestone(due_date: due_date, days_until_submission: 60, days_until_release: 61) end end @@ -343,25 +343,25 @@ def get_milestone(milestone_name:) } expect(client).to receive(:create_milestone).with(test_repo, test_milestone_number, options) - create_milestone(due_date:, days_until_submission: 60, days_until_release: 61) + create_milestone(due_date: due_date, days_until_submission: 60, days_until_release: 61) end end it 'raises an error if days_until_submission is less than or equal zero' do due_date = '2022-10-20T08:00:00Z'.to_time.utc - expect { create_milestone(due_date:, days_until_submission: 0, days_until_release: 5) } + expect { create_milestone(due_date: due_date, days_until_submission: 0, days_until_release: 5) } .to raise_error(FastlaneCore::Interface::FastlaneError, 'days_until_submission must be greater than zero.') end it 'raises an error if days_until_release is less than or equal zero' do due_date = '2022-10-20T08:00:00Z'.to_time.utc - expect { create_milestone(due_date:, days_until_submission: 12, days_until_release: -8) } + expect { create_milestone(due_date: due_date, days_until_submission: 12, days_until_release: -8) } .to raise_error(FastlaneCore::Interface::FastlaneError, 'days_until_release must be greater than zero.') end it 'raises an error if days_until_submission is greater than days_until_release' do due_date = '2022-10-20T08:00:00Z'.to_time.utc - expect { create_milestone(due_date:, days_until_submission: 14, days_until_release: 3) } + expect { create_milestone(due_date: due_date, days_until_submission: 14, days_until_release: 3) } .to raise_error(FastlaneCore::Interface::FastlaneError, 'days_until_release must be greater or equal to days_until_submission.') end @@ -370,9 +370,9 @@ def create_milestone(due_date:, days_until_submission:, days_until_release:) helper.create_milestone( repository: test_repo, title: test_milestone_number, - due_date:, - days_until_submission:, - days_until_release: + due_date: due_date, + days_until_submission: days_until_submission, + days_until_release: days_until_release ) end end @@ -435,9 +435,9 @@ def create_release(is_draft:, assets: []) version: test_tag, target: test_target, description: test_description, - assets:, + assets: assets, prerelease: false, - is_draft: + is_draft: is_draft ) end end diff --git a/spec/ios_bump_version_release_spec.rb b/spec/ios_bump_version_release_spec.rb index 73219001b..fe273ea35 100644 --- a/spec/ios_bump_version_release_spec.rb +++ b/spec/ios_bump_version_release_spec.rb @@ -22,7 +22,7 @@ expect(Fastlane::Helper::Ios::GitHelper).to receive(:commit_version_bump) run_described_fastlane_action( - default_branch: + default_branch: default_branch ) end end diff --git a/spec/ios_download_strings_files_from_glotpress_spec.rb b/spec/ios_download_strings_files_from_glotpress_spec.rb index a940db1d8..8b9db9b08 100644 --- a/spec/ios_download_strings_files_from_glotpress_spec.rb +++ b/spec/ios_download_strings_files_from_glotpress_spec.rb @@ -7,7 +7,7 @@ let(:locales_subset) { { 'fr-FR': 'fr', 'zh-cn': 'zh-Hans' } } def gp_stub(locale:, query:) - stub_request(:get, "#{gp_fake_url}/#{locale}/default/export-translations/").with(query:) + stub_request(:get, "#{gp_fake_url}/#{locale}/default/export-translations/").with(query: query) end describe 'downloading export files from GlotPress' do @@ -26,7 +26,7 @@ def test_gp_download(filters:, tablename:, expected_gp_params:) locales: locales_subset, download_dir: tmp_dir, table_basename: tablename, - filters: + filters: filters }.compact) # Assert @@ -95,7 +95,7 @@ def test_gp_download(filters:, tablename:, expected_gp_params:) run_described_fastlane_action( project_url: gp_fake_url, locales: { 'fr-FR': 'fr' }, - download_dir: + download_dir: download_dir ) end diff --git a/spec/ios_generate_strings_file_from_code_spec.rb b/spec/ios_generate_strings_file_from_code_spec.rb index 158c6acd7..0d4346e4e 100644 --- a/spec/ios_generate_strings_file_from_code_spec.rb +++ b/spec/ios_generate_strings_file_from_code_spec.rb @@ -143,7 +143,7 @@ def test_genstrings(params:, expected_dir_name:, expected_logs: nil, expected_fa test_genstrings( params: { paths: [app_src_dir, pods_src_dir], quiet: true, swiftui: false }, expected_dir_name: 'expected-pods-noswiftui', - expected_logs: + expected_logs: expected_logs ) end @@ -156,7 +156,7 @@ def test_genstrings(params:, expected_dir_name:, expected_logs: nil, expected_fa test_genstrings( params: { paths: [app_src_dir, pods_src_dir], quiet: false, swiftui: false }, expected_dir_name: 'expected-pods-noswiftui', - expected_logs: + expected_logs: expected_logs ) end @@ -168,7 +168,7 @@ def test_genstrings(params:, expected_dir_name:, expected_logs: nil, expected_fa test_genstrings( params: { paths: [app_src_dir, pods_src_dir], quiet: true, swiftui: false, routines: 'PodLocalizedString', fail_on_error: false }, expected_dir_name: 'expected-custom-routine', - expected_logs:, + expected_logs: expected_logs, expected_failures: [] ) end @@ -181,7 +181,7 @@ def test_genstrings(params:, expected_dir_name:, expected_logs: nil, expected_fa test_genstrings( params: { paths: [app_src_dir, pods_src_dir], quiet: true, swiftui: false, routines: 'PodLocalizedString', fail_on_error: true }, expected_dir_name: 'expected-custom-routine', - expected_logs:, + expected_logs: expected_logs, expected_failures: [expected_logs.last] ) end @@ -195,7 +195,7 @@ def test_genstrings(params:, expected_dir_name:, expected_logs: nil, expected_fa test_genstrings( params: { paths: [app_src_dir, pods_src_dir], quiet: false, swiftui: false, fail_on_error: true }, expected_dir_name: 'expected-pods-noswiftui', - expected_logs:, + expected_logs: expected_logs, expected_failures: [] ) end diff --git a/spec/ios_get_app_version_spec.rb b/spec/ios_get_app_version_spec.rb index eda850a8f..0355fd175 100644 --- a/spec/ios_get_app_version_spec.rb +++ b/spec/ios_get_app_version_spec.rb @@ -9,7 +9,7 @@ VERSION_LONG = 6.30.0 CONTENT - expect_version(xcconfig_mock_content:, expected_version: '6.30') + expect_version(xcconfig_mock_content: xcconfig_mock_content, expected_version: '6.30') end it 'parses the xcconfig file format correctly and gets the public hotfix version' do @@ -19,7 +19,7 @@ VERSION_LONG = 6.30.1 CONTENT - expect_version(xcconfig_mock_content:, expected_version: '6.30.1') + expect_version(xcconfig_mock_content: xcconfig_mock_content, expected_version: '6.30.1') end it 'parses the xcconfig with keys without spacing and gets the public version' do @@ -29,7 +29,7 @@ VERSION_LONG=6.30.0 CONTENT - expect_version(xcconfig_mock_content:, expected_version: '6.30') + expect_version(xcconfig_mock_content: xcconfig_mock_content, expected_version: '6.30') end it 'parses the xcconfig with keys without spacing and gets the public hotfix version' do @@ -39,7 +39,7 @@ VERSION_LONG=6.30.1 CONTENT - expect_version(xcconfig_mock_content:, expected_version: '6.30.1') + expect_version(xcconfig_mock_content: xcconfig_mock_content, expected_version: '6.30.1') end it 'fails to extract the version from an xcconfig file with an invalid format' do @@ -49,7 +49,7 @@ CONTENT expect do - expect_version(xcconfig_mock_content:, expected_version: 'n/a') + expect_version(xcconfig_mock_content: xcconfig_mock_content, expected_version: 'n/a') end.to raise_error(FastlaneCore::Interface::FastlaneError) end @@ -70,7 +70,7 @@ CONTENT expect do - expect_version(xcconfig_mock_content:, expected_version: 'n/a') + expect_version(xcconfig_mock_content: xcconfig_mock_content, expected_version: 'n/a') end.to raise_error(FastlaneCore::Interface::FastlaneError) end diff --git a/spec/ios_get_build_number_spec.rb b/spec/ios_get_build_number_spec.rb index 2db7f12c6..dadba9c8d 100644 --- a/spec/ios_get_build_number_spec.rb +++ b/spec/ios_get_build_number_spec.rb @@ -10,7 +10,7 @@ BUILD_NUMBER=1940 CONTENT - expect_build_number(xcconfig_mock_content:, expected_build_number: '1940') + expect_build_number(xcconfig_mock_content: xcconfig_mock_content, expected_build_number: '1940') end it 'parses an xcconfig file with keys with spaces and returns the correct build number' do @@ -20,7 +20,7 @@ BUILD_NUMBER = 1940 CONTENT - expect_build_number(xcconfig_mock_content:, expected_build_number: '1940') + expect_build_number(xcconfig_mock_content: xcconfig_mock_content, expected_build_number: '1940') end it 'parses an xcconfig file with an invalid format and returns a nil build number' do @@ -30,7 +30,7 @@ BUILD_NUMBER 1940 CONTENT - expect_build_number(xcconfig_mock_content:, expected_build_number: nil) + expect_build_number(xcconfig_mock_content: xcconfig_mock_content, expected_build_number: nil) end it 'parses an xcconfig file with no build number and returns a nil build number' do @@ -39,7 +39,7 @@ // a comment CONTENT - expect_build_number(xcconfig_mock_content:, expected_build_number: nil) + expect_build_number(xcconfig_mock_content: xcconfig_mock_content, expected_build_number: nil) end it 'throws an error when the xcconfig file does not exist' do diff --git a/spec/ios_git_helper_spec.rb b/spec/ios_git_helper_spec.rb index eacdf8a43..7c2f35c01 100644 --- a/spec/ios_git_helper_spec.rb +++ b/spec/ios_git_helper_spec.rb @@ -8,14 +8,14 @@ ENV[key] = nil expect(FastlaneCore::UI).to receive(:user_error!) - described_class.get_from_env!(key:) + described_class.get_from_env!(key: key) end it 'returns the value when in the environment' do ENV[key] = 'abc123' expect(FastlaneCore::UI).not_to receive(:user_error!) - expect(described_class.get_from_env!(key:)).to eq('abc123') + expect(described_class.get_from_env!(key: key)).to eq('abc123') end end end diff --git a/spec/ios_l10n_helper_spec.rb b/spec/ios_l10n_helper_spec.rb index a6cdebf9b..997f7a3fc 100644 --- a/spec/ios_l10n_helper_spec.rb +++ b/spec/ios_l10n_helper_spec.rb @@ -50,7 +50,7 @@ def file_encoding(path) Dir.mktmpdir('a8c-release-toolkit-l10n-helper-tests-') do |tmp_dir| output_file = File.join(tmp_dir, 'output.strings') - described_class.merge_strings(paths:, output_path: output_file) + described_class.merge_strings(paths: paths, output_path: output_file) expect(File.read(output_file)).to eq(File.read(fixture('expected-merged.strings'))) expect(file_encoding(output_file)).to eq(Encoding::UTF_8) end @@ -62,7 +62,7 @@ def file_encoding(path) Dir.mktmpdir('a8c-release-toolkit-l10n-helper-tests-') do |tmp_dir| paths.each { |f| FileUtils.cp(f, tmp_dir) } paths = paths.to_h { |f| [File.join(tmp_dir, File.basename(f)), nil] } - described_class.merge_strings(paths:, output_path: paths.keys.first) + described_class.merge_strings(paths: paths, output_path: paths.keys.first) expect(File.read(paths.keys.first)).to eq(File.read(fixture('expected-merged.strings'))) end end @@ -82,7 +82,7 @@ def file_encoding(path) } Dir.mktmpdir('a8c-release-toolkit-l10n-helper-tests-') do |tmp_dir| output_file = File.join(tmp_dir, 'output.strings') - duplicates = described_class.merge_strings(paths:, output_path: output_file) + duplicates = described_class.merge_strings(paths: paths, output_path: output_file) expect(File.read(output_file)).to eq(File.read(fixture('expected-merged-prefixed.strings'))) # We should also not find duplicates anymore, given that `key1` and `key2` (duplicates from `Localizable-utf16.strings` # and `non-latin-utf16.strings` files) will now be prefixed differently, and thus made different during merge @@ -94,7 +94,7 @@ def file_encoding(path) paths = { fixture('Localizable-utf16.strings') => nil, fixture('non-latin-utf16.strings') => nil } Dir.mktmpdir('a8c-release-toolkit-l10n-helper-tests-') do |tmp_dir| output_file = File.join(tmp_dir, 'output.strings') - duplicates = described_class.merge_strings(paths:, output_path: output_file) + duplicates = described_class.merge_strings(paths: paths, output_path: output_file) expect(duplicates).to eq(%w[key1 key2]) end end @@ -104,7 +104,7 @@ def file_encoding(path) Dir.mktmpdir('a8c-release-toolkit-l10n-helper-tests-') do |tmp_dir| output_file = File.join(tmp_dir, 'output.strings') expect do - described_class.merge_strings(paths:, output_path: output_file) + described_class.merge_strings(paths: paths, output_path: output_file) end.to raise_exception(RuntimeError, "The file `#{paths.keys[1]}` is in xml format but we currently only support merging `.strings` files in text format.") end end @@ -114,7 +114,7 @@ def file_encoding(path) Dir.mktmpdir('a8c-release-toolkit-l10n-helper-tests-') do |tmp_dir| output_file = File.join(tmp_dir, 'output.strings') expect do - described_class.merge_strings(paths:, output_path: output_file) + described_class.merge_strings(paths: paths, output_path: output_file) end.to raise_exception(RuntimeError, "The file `#{paths.keys[1]}` does not exist or is of unknown format.") end end @@ -178,7 +178,7 @@ def file_encoding(path) Dir.mktmpdir('a8c-release-toolkit-l10n-helper-tests-') do |tmp_dir| output_file = File.join(tmp_dir, 'output.strings') # 3. Generate XML strings file from the filtered hash - described_class.generate_strings_file_from_hash(translations:, output_path: output_file) + described_class.generate_strings_file_from_hash(translations: translations, output_path: output_file) expect(File.read(output_file)).to eq(File.read(expected_file)) end end @@ -242,7 +242,7 @@ def file_encoding(path) # Note: in practice it seems that GlotPress's `.strings` exports are using UTF-8 (but served as `application/octet-stream`) # but it does not hurt to ensure the download to a file can work with UTF-16 (and copy the binary stream verbatim) body = File.read(fixture('Localizable-utf16.strings')) - stub = stub_request(:get, "#{gp_fake_url}/fr/default/export-translations/").with(query: { format: 'strings' }).to_return(body:) + stub = stub_request(:get, "#{gp_fake_url}/fr/default/export-translations/").with(query: { format: 'strings' }).to_return(body: body) dest = File.join(tmp_dir, 'export.strings') # Act described_class.download_glotpress_export_file(project_url: gp_fake_url, locale: 'fr', filters: nil, destination: dest) diff --git a/spec/ios_send_app_size_metrics_spec.rb b/spec/ios_send_app_size_metrics_spec.rb index 4de1fbd9c..0fb1389b4 100644 --- a/spec/ios_send_app_size_metrics_spec.rb +++ b/spec/ios_send_app_size_metrics_spec.rb @@ -15,7 +15,7 @@ def test_app_size_action(fake_ipa_size:, expected_payload:, **other_action_args) # Act code = run_described_fastlane_action( api_url: File.join('file://localhost/', output_file), - ipa_path:, + ipa_path: ipa_path, **other_action_args ) @@ -89,9 +89,9 @@ def test_app_size_action(fake_ipa_size:, expected_payload:, **other_action_args) expected = JSON.parse(File.read(expected_fixture)) test_app_size_action( - fake_ipa_size:, + fake_ipa_size: fake_ipa_size, expected_payload: expected, - app_thinning_plist_path:, + app_thinning_plist_path: app_thinning_plist_path, app_name: 'wordpress', build_type: 'internal', app_version: '19.8.0.2', diff --git a/spec/ios_version_file_spec.rb b/spec/ios_version_file_spec.rb index 518ba3ef5..37177af3b 100644 --- a/spec/ios_version_file_spec.rb +++ b/spec/ios_version_file_spec.rb @@ -22,9 +22,9 @@ with_tmp_file(named: 'test.xcconfig', content: existing_content) do |tmp_file_path| described_class.new(xcconfig_path: tmp_file_path).write( - version_short:, - version_long:, - build_number: + version_short: version_short, + version_long: version_long, + build_number: build_number ) current_content = File.read(tmp_file_path) @@ -38,7 +38,7 @@ version_short = '1.2.3' it 'raises an error' do - expect { described_class.new(xcconfig_path: file_path).write(version_short:) } + expect { described_class.new(xcconfig_path: file_path).write(version_short: version_short) } .to raise_error(FastlaneCore::Interface::FastlaneError, ".xcconfig file not found at this path: #{file_path}") end end diff --git a/spec/marketing_version_calculator_spec.rb b/spec/marketing_version_calculator_spec.rb index 44858d92e..ef463c32a 100644 --- a/spec/marketing_version_calculator_spec.rb +++ b/spec/marketing_version_calculator_spec.rb @@ -6,13 +6,13 @@ it 'raises an error when the minor version is greater than 9' do version = Fastlane::Models::AppVersion.new(13, 10, 1, 1) expect do - described_class.new.next_release_version(version:) + described_class.new.next_release_version(version: version) end.to raise_error(FastlaneCore::Interface::FastlaneError), 'Marketing Versioning: The minor version cannot be greater than 9' end it 'increments the minor version when the minor version is less than 9' do version = Fastlane::Models::AppVersion.new(13, 5, 1, 1) - bumped_version = described_class.new.next_release_version(version:) + bumped_version = described_class.new.next_release_version(version: version) # Test that the original version is not modified expect(version.to_s).to eq('13.5.1.1') expect(bumped_version.to_s).to eq('13.6.0.0') @@ -22,7 +22,7 @@ context 'when the minor number is 9' do it 'increments the major version and sets the minor version to 0 ' do version = Fastlane::Models::AppVersion.new(13, 9, 1, 1) - bumped_version = described_class.new.next_release_version(version:) + bumped_version = described_class.new.next_release_version(version: version) # Test that the original version is not modified expect(version.to_s).to eq('13.9.1.1') expect(bumped_version.to_s).to eq('14.0.0.0') diff --git a/spec/prototype_build_details_comment_action_spec.rb b/spec/prototype_build_details_comment_action_spec.rb index ca6c7e6a6..9891b613d 100644 --- a/spec/prototype_build_details_comment_action_spec.rb +++ b/spec/prototype_build_details_comment_action_spec.rb @@ -132,7 +132,7 @@ app_center_org_name: 'My-Org', app_center_app_name: 'My-App', app_center_release_id: '1337', - metadata: + metadata: metadata ) expect(comment).to include 'App Name My App' expect(comment).to include 'Version:Short28.1' @@ -168,7 +168,7 @@ app_center_org_name: 'BestOrg', app_center_app_name: 'BestApp', app_center_release_id: '8888', - metadata:, + metadata: metadata, footnote: 'Note: Google Sign-In in not available in those builds' ) @@ -201,7 +201,7 @@ app_center_app_name: 'BestApp', app_center_release_id: '8888', download_url: 'https://bestfront.cloudfront.net/feed42/bestapp-pr1357-a1b2c3f.apk', - metadata: + metadata: metadata ) expect(comment).to eq <<~EXPECTED_COMMENT @@ -235,7 +235,7 @@ app_center_app_name: 'BestApp', app_center_release_id: '1234', fold: true, - metadata:, + metadata: metadata, footnote: 'Note: Google Sign-In in not available in those builds' ) @@ -309,7 +309,7 @@ comment = run_described_fastlane_action( app_display_name: 'My App', app_center_org_name: 'My-Org', - metadata: + metadata: metadata ) expect(comment).to include 'Version42.3' # explicitly provided, overriding the implicit value expect(comment).not_to include 'Version28.7' # otherwise implicitly added if it were not overridden @@ -378,7 +378,7 @@ comment = run_described_fastlane_action( app_display_name: 'The Best App', app_center_org_name: 'BestOrg', - metadata:, + metadata: metadata, footnote: 'Note: Google Sign-In in not available in those builds' ) @@ -434,7 +434,7 @@ app_display_name: 'The Best App', app_center_org_name: 'BestOrg', fold: true, - metadata:, + metadata: metadata, footnote: 'Note: Google Sign-In in not available in those builds' ) @@ -514,7 +514,7 @@ comment = run_described_fastlane_action( app_display_name: 'The Best App', download_url: 'https://bestfront.cloudfront.net/feed42/bestapp-pr1357-a1b2c3f.apk', - metadata:, + metadata: metadata, footnote: 'Note: Google Sign-In in not available in those builds' ) @@ -547,7 +547,7 @@ app_display_name: 'The Best App', download_url: 'https://bestfront.cloudfront.net/feed42/bestapp-pr1357-a1b2c3f.apk', fold: true, - metadata:, + metadata: metadata, footnote: 'Note: Google Sign-In in not available in those builds' ) diff --git a/spec/remove_branch_protection_action_spec.rb b/spec/remove_branch_protection_action_spec.rb index 5f4791921..06254a599 100644 --- a/spec/remove_branch_protection_action_spec.rb +++ b/spec/remove_branch_protection_action_spec.rb @@ -22,8 +22,8 @@ run_described_fastlane_action( repository: repo, - branch:, - github_token: + branch: branch, + github_token: github_token ) end @@ -36,8 +36,8 @@ run_described_fastlane_action( repository: repo, - branch:, - github_token: + branch: branch, + github_token: github_token ) end @@ -48,8 +48,8 @@ expect do run_described_fastlane_action( repository: repo, - branch:, - github_token: + branch: branch, + github_token: github_token ) end.to raise_error FastlaneCore::Interface::FastlaneError, "Branch `#{branch}` of repository `#{repo}` was not found." end diff --git a/spec/semantic_version_calculator_spec.rb b/spec/semantic_version_calculator_spec.rb index 23cc05b46..af649197c 100644 --- a/spec/semantic_version_calculator_spec.rb +++ b/spec/semantic_version_calculator_spec.rb @@ -4,7 +4,7 @@ describe 'calculates the next release version when using semantic versioning' do it 'increments the minor version' do version = Fastlane::Models::AppVersion.new(13, 5, 1, 1) - bumped_version = described_class.new.next_release_version(version:) + bumped_version = described_class.new.next_release_version(version: version) # Test that the original version is not modified expect(version.to_s).to eq('13.5.1.1') expect(bumped_version.to_s).to eq('13.6.0.0') diff --git a/spec/set_branch_protection_action_spec.rb b/spec/set_branch_protection_action_spec.rb index a9abef9a9..835377ab5 100644 --- a/spec/set_branch_protection_action_spec.rb +++ b/spec/set_branch_protection_action_spec.rb @@ -31,15 +31,15 @@ def fixture(file) dismiss_stale_reviews: false, require_code_owner_reviews: false }, - restrictions: + restrictions: restrictions } expect(client).to receive(:protect_branch).with(repo, branch, expected_options) run_described_fastlane_action( repository: repo, - branch:, - github_token:, + branch: branch, + github_token: github_token, **additional_options ) end @@ -52,16 +52,16 @@ def fixture(file) dismiss_stale_reviews: false, require_code_owner_reviews: false }, - restrictions: + restrictions: restrictions } expect(client).to receive(:protect_branch).with(repo, branch, expected_options) run_described_fastlane_action( repository: repo, - branch:, + branch: branch, required_ci_checks: [], - github_token:, + github_token: github_token, **additional_options ) end @@ -81,16 +81,16 @@ def fixture(file) dismiss_stale_reviews: false, require_code_owner_reviews: false }, - restrictions: + restrictions: restrictions } expect(client).to receive(:protect_branch).with(repo, branch, expected_options) run_described_fastlane_action( repository: repo, - branch:, + branch: branch, required_ci_checks: %w[check1 check2 check3], - github_token:, + github_token: github_token, **additional_options ) end @@ -103,16 +103,16 @@ def fixture(file) require_code_owner_reviews: false, required_approving_review_count: 3 }, - restrictions: + restrictions: restrictions } expect(client).to receive(:protect_branch).with(repo, branch, expected_options) run_described_fastlane_action( repository: repo, - branch:, + branch: branch, required_approving_review_count: 3, - github_token:, + github_token: github_token, **additional_options ) end @@ -124,16 +124,16 @@ def fixture(file) dismiss_stale_reviews: false, require_code_owner_reviews: false }, - restrictions: + restrictions: restrictions } expect(client).to receive(:protect_branch).with(repo, branch, expected_options) run_described_fastlane_action( repository: repo, - branch:, + branch: branch, enforce_admins: true, - github_token:, + github_token: github_token, **additional_options ) end @@ -145,7 +145,7 @@ def fixture(file) dismiss_stale_reviews: false, require_code_owner_reviews: false }, - restrictions:, + restrictions: restrictions, allow_force_pushes: true } @@ -153,9 +153,9 @@ def fixture(file) run_described_fastlane_action( repository: repo, - branch:, + branch: branch, allow_force_pushes: true, - github_token:, + github_token: github_token, **additional_options ) end @@ -167,7 +167,7 @@ def fixture(file) dismiss_stale_reviews: false, require_code_owner_reviews: false }, - restrictions:, + restrictions: restrictions, lock_branch: true } @@ -175,9 +175,9 @@ def fixture(file) run_described_fastlane_action( repository: repo, - branch:, + branch: branch, lock_branch: true, - github_token:, + github_token: github_token, **additional_options ) end @@ -241,8 +241,8 @@ def fixture(file) run_described_fastlane_action( repository: repo, - branch:, - github_token: + branch: branch, + github_token: github_token ) end @@ -254,9 +254,9 @@ def fixture(file) run_described_fastlane_action( repository: repo, - branch:, + branch: branch, required_ci_checks: [], - github_token: + github_token: github_token ) end @@ -272,9 +272,9 @@ def fixture(file) run_described_fastlane_action( repository: repo, - branch:, + branch: branch, required_ci_checks: %w[new/check1 new/check2 new/check3], - github_token: + github_token: github_token ) end @@ -287,9 +287,9 @@ def fixture(file) run_described_fastlane_action( repository: repo, - branch:, + branch: branch, required_approving_review_count: 3, - github_token: + github_token: github_token ) end @@ -302,9 +302,9 @@ def fixture(file) run_described_fastlane_action( repository: repo, - branch:, + branch: branch, enforce_admins: false, - github_token: + github_token: github_token ) end @@ -317,9 +317,9 @@ def fixture(file) run_described_fastlane_action( repository: repo, - branch:, + branch: branch, allow_force_pushes: false, - github_token: + github_token: github_token ) end @@ -332,9 +332,9 @@ def fixture(file) run_described_fastlane_action( repository: repo, - branch:, + branch: branch, lock_branch: false, - github_token: + github_token: github_token ) end end diff --git a/spec/simple_build_code_calculator_spec.rb b/spec/simple_build_code_calculator_spec.rb index e956697c8..e1a50e0af 100644 --- a/spec/simple_build_code_calculator_spec.rb +++ b/spec/simple_build_code_calculator_spec.rb @@ -4,7 +4,7 @@ describe 'calculates the next build code' do it 'increments the build code by 1' do build_code = Fastlane::Models::BuildCode.new(123) - bumped_build_code = described_class.new.next_build_code(build_code:) + bumped_build_code = described_class.new.next_build_code(build_code: build_code) # Test that the original build code is not modified expect(build_code.to_s).to eq('123') expect(bumped_build_code.to_s).to eq('124') diff --git a/spec/simple_build_code_formatter_spec.rb b/spec/simple_build_code_formatter_spec.rb index 3cda07b0c..1505c1468 100644 --- a/spec/simple_build_code_formatter_spec.rb +++ b/spec/simple_build_code_formatter_spec.rb @@ -4,7 +4,7 @@ describe 'formats a BuildCode object as a build code' do it 'returns the integer build code as a string' do build_code = Fastlane::Models::BuildCode.new(735) - build_code_string = described_class.new.build_code(build_code:) + build_code_string = described_class.new.build_code(build_code: build_code) expect(build_code_string.to_s).to eq('735') end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9d32a5fdf..2eb2d9f90 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -54,7 +54,7 @@ def allow_fastlane_action_sh def expect_shell_command(*, exitstatus: 0, output: '') mock_input = double(:input) mock_output = StringIO.new(output) - mock_status = double(:status, exitstatus:) + mock_status = double(:status, exitstatus: exitstatus) mock_thread = double(:thread, value: mock_status) expect(Open3).to receive(:popen2e).with(*).and_yield(mock_input, mock_output, mock_thread) diff --git a/spec/upload_to_s3_spec.rb b/spec/upload_to_s3_spec.rb index bc1a6c53a..733a19ce1 100644 --- a/spec/upload_to_s3_spec.rb +++ b/spec/upload_to_s3_spec.rb @@ -12,8 +12,8 @@ def stub_s3_response_for_file(key, exists: true) content_length = exists == true ? 1 : 0 allow(client).to(receive(:head_object)) - .with(bucket: test_bucket, key:) - .and_return(Aws::S3::Types::HeadObjectOutput.new(content_length:)) + .with(bucket: test_bucket, key: key) + .and_return(Aws::S3::Types::HeadObjectOutput.new(content_length: content_length)) end describe 'uploading a file with valid parameters' do @@ -308,8 +308,8 @@ def stub_s3_response_for_file(key, exists: true) bucket: test_bucket, key: 'existing-key', file: file_path, - if_exists:, - skip_if_exists: + if_exists: if_exists, + skip_if_exists: skip_if_exists ) end.to raise_error(FastlaneCore::Interface::FastlaneError, 'You cannot set both :skip_if_exists and :if_exists. Please only use :if_exists.') end