Skip to content

Commit

Permalink
Update Rubocop config to not allow Ruby 3.1 hash and arguments values…
Browse files Browse the repository at this point in the history
… omission
  • Loading branch information
iangmaia committed Oct 31, 2023
1 parent 1b03d61 commit 7458f06
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 28 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ Layout/LineLength:
Lint/ConstantDefinitionInBlock:
Exclude:
- fastlane/lanes/localization.rb

Style/HashSyntax:
EnforcedShorthandSyntax: never
2 changes: 1 addition & 1 deletion fastlane/helpers/github.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def create_release_management_pull_request(base_branch, title)
create_pull_request(
api_token: ENV.fetch('GITHUB_TOKEN', nil),
repo: GHHELPER_REPO,
title:,
title: title,
head: Fastlane::Helper::GitHelper.current_git_branch,
base: base_branch,
labels: 'Releases'
Expand Down
24 changes: 12 additions & 12 deletions fastlane/lanes/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
# Create the file names
app = get_app_name_option!(options)
version_name = current_version_name
build_bundle(app:, version_name:, build_code: current_build_code, flavor: 'Vanilla', buildType: 'Release')
build_bundle(app: app, version_name: version_name, build_code: current_build_code, flavor: 'Vanilla', buildType: 'Release')

upload_build_to_play_store(app:, version_name:, track: 'production')
upload_build_to_play_store(app: app, version_name: version_name, track: 'production')

create_gh_release(app:, version_name:) if options[:create_release]
create_gh_release(app: app, version_name: version_name) if options[:create_release]
end

#####################################################################################
Expand Down Expand Up @@ -69,7 +69,7 @@
end

app = get_app_name_option!(options)
build_beta(app:, skip_prechecks: true, skip_confirm: options[:skip_confirm], upload_to_play_store: true, create_release: options[:create_release])
build_beta(app: app, skip_prechecks: true, skip_confirm: options[:skip_confirm], upload_to_play_store: true, create_release: options[:create_release])
end

#####################################################################################
Expand Down Expand Up @@ -102,11 +102,11 @@
# Create the file names
app = get_app_name_option!(options)
version_name = current_version_name
build_bundle(app:, version_name:, build_code: current_build_code, flavor: 'Vanilla', buildType: 'Release')
build_bundle(app: app, version_name: version_name, build_code: current_build_code, flavor: 'Vanilla', buildType: 'Release')

upload_build_to_play_store(app:, version_name:, track: 'beta') if options[:upload_to_play_store]
upload_build_to_play_store(app: app, version_name: version_name, track: 'beta') if options[:upload_to_play_store]

create_gh_release(app:, version_name:, prerelease: true) if options[:create_release]
create_gh_release(app: app, version_name: version_name, prerelease: true) if options[:create_release]
end

#####################################################################################
Expand Down Expand Up @@ -140,7 +140,7 @@
retry_count = 2
begin
upload_to_play_store(
package_name:,
package_name: package_name,
aab: aab_file_path,
track: options[:track],
release_status: 'draft',
Expand Down Expand Up @@ -188,7 +188,7 @@
package_name = APP_SPECIFIC_VALUES[app.to_sym][:package_name]

download_universal_apk_from_google_play(
package_name:,
package_name: package_name,
version_code: build_code,
destination: signed_apk_path(app, current_version_name),
json_key: UPLOAD_TO_PLAY_STORE_JSON_KEY
Expand Down Expand Up @@ -216,7 +216,7 @@
properties: { prototypeBuildVersionName: version_name }
)

upload_prototype_build(product: 'WordPress', version_name:)
upload_prototype_build(product: 'WordPress', version_name: version_name)
end

#####################################################################################
Expand All @@ -239,7 +239,7 @@
properties: { prototypeBuildVersionName: version_name }
)

upload_prototype_build(product: 'Jetpack', version_name:)
upload_prototype_build(product: 'Jetpack', version_name: version_name)
end

#####################################################################################
Expand Down Expand Up @@ -339,7 +339,7 @@ def upload_prototype_build(product:, version_name:)
return unless ENV['BUILDKITE']

message = "#{product} Prototype Build: [#{filename}](#{install_url})"
buildkite_annotate(style: 'info', context: "prototype-build-#{product}", message:)
buildkite_annotate(style: 'info', context: "prototype-build-#{product}", message: message)
buildkite_metadata(set: { versionName: version_name, 'build:flavor': PROTOTYPE_BUILD_FLAVOR, 'build:type': PROTOTYPE_BUILD_TYPE })
end

Expand Down
12 changes: 6 additions & 6 deletions fastlane/lanes/localization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
metadata_dir = File.join(FASTLANE_FOLDER, APP_SPECIFIC_VALUES[app.to_sym][:metadata_dir], 'android')

upload_to_play_store(
package_name:,
package_name: package_name,
track: 'production',
version_code: current_build_code, # Apparently required by fastlane… even if the "Main Store Listing" isn't be attached to a specific build ¯\_(ツ)_/¯
metadata_path: metadata_dir,
Expand Down Expand Up @@ -196,7 +196,7 @@
play_store_desc: { desc: 'full_description.txt', max_size: 4000 }
}
unless skip_release_notes
delete_old_changelogs(app:, build: build_number)
delete_old_changelogs(app: app, build: build_number)
version_suffix = version.split('.').join
files["release_note_#{version_suffix}"] = { desc: "changelogs/#{build_number}.txt", max_size: 500, alternate_key: "release_note_short_#{version_suffix}" }
end
Expand All @@ -212,8 +212,8 @@
gp_downloadmetadata(
project_url: app_values[:glotpress_metadata_project],
target_files: files,
locales:,
download_path:
locales: locales,
download_path: download_path
)

# Copy the source `.txt` files (used as source of truth when we generated the `.po`) to the `fastlane/*metadata/android/en-US` dir,
Expand All @@ -228,7 +228,7 @@
git_add(path: download_path)
message = "Update #{app_values[:display_name]} metadata translations"
message += " for #{version}" unless version.nil?
git_commit(path: download_path, message:, allow_nothing_to_commit: true)
git_commit(path: download_path, message: message, allow_nothing_to_commit: true)
end
push_to_git_remote unless skip_commit || skip_git_push
end
Expand Down Expand Up @@ -369,7 +369,7 @@ def update_po_file_for_metadata_localization(po_path:, sources:, release_version
an_update_metadata_source(
po_file_path: po_path,
source_files: sources,
release_version:
release_version: release_version
)

git_add(path: po_path)
Expand Down
18 changes: 9 additions & 9 deletions fastlane/lanes/screenshots.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
apk_dir = File.join('WordPress', 'build', 'outputs', 'apk')
package_name = APP_SPECIFIC_VALUES[app.to_sym][:package_name]
test_class = APP_SPECIFIC_VALUES[app.to_sym][:screenshots_test_class]
output_dir = screenshots_dir(app:, subfolder: 'raw')
output_dir = screenshots_dir(app: app, subfolder: 'raw')

screenshot_devices.each do |device|
name = android_create_avd(device_model: device[:device], api_level: device[:api]) # Create the AVD for device, API and system image we need
Expand All @@ -63,7 +63,7 @@
clear_previous_screenshots: should_clear_previous_screenshots,
app_package_name: package_name,
tests_package_name: "#{package_name}.test",
locales:,
locales: locales,
output_directory: output_dir,
skip_open_summary: is_ci,
use_tests_in_classes: test_class,
Expand Down Expand Up @@ -97,7 +97,7 @@
app = get_app_name_option!(options)
folder_mapping = { options[:phone] => 'phoneScreenshots', options[:tenInch] => 'tenInchScreenshots' }

raw_screenshots_dir = screenshots_dir(app:, subfolder: 'raw')
raw_screenshots_dir = screenshots_dir(app: app, subfolder: 'raw')
FileUtils.rm_rf(raw_screenshots_dir)
FileUtils.mkdir_p(raw_screenshots_dir)

Expand Down Expand Up @@ -141,12 +141,12 @@
end
app = get_app_name_option!(options)

download_metadata_strings(app:, skip_release_notes: true, skip_git_push: true) unless options.fetch(:skip_download_strings, false)
download_metadata_strings(app: app, skip_release_notes: true, skip_git_push: true) unless options.fetch(:skip_download_strings, false)

# Define intermediate folders
raw_screenshots_dir = screenshots_dir(app:, subfolder: 'raw')
raw_screenshots_processing_dir = screenshots_dir(app:, subfolder: 'raw_tmp')
promo_screenshots_processing_dir = screenshots_dir(app:, subfolder: 'promo_tmp')
raw_screenshots_dir = screenshots_dir(app: app, subfolder: 'raw')
raw_screenshots_processing_dir = screenshots_dir(app: app, subfolder: 'raw_tmp')
promo_screenshots_processing_dir = screenshots_dir(app: app, subfolder: 'promo_tmp')
final_metadata_dir = File.join(FASTLANE_FOLDER, APP_SPECIFIC_VALUES[app.to_sym][:metadata_dir], 'android')

# Clean temporary folder from previous runs
Expand All @@ -157,7 +157,7 @@
FileUtils.rm_rf(raw_screenshots_processing_dir)
FileUtils.copy_entry(raw_screenshots_dir, raw_screenshots_processing_dir)

clean_raw_screenshot_filenames(app:, dir: raw_screenshots_processing_dir)
clean_raw_screenshot_filenames(app: app, dir: raw_screenshots_processing_dir)

locales = ALL_LOCALES
.reject { |h| h[:google_play].nil? }
Expand Down Expand Up @@ -230,7 +230,7 @@
metadata_dir = File.join(FASTLANE_FOLDER, APP_SPECIFIC_VALUES[app.to_sym][:metadata_dir], 'android')

upload_to_play_store(
package_name:,
package_name: package_name,
metadata_path: metadata_dir,
skip_upload_apk: true,
skip_upload_aab: true,
Expand Down

0 comments on commit 7458f06

Please sign in to comment.