Skip to content

Commit b811edc

Browse files
Fix Style/UnlessElse violations
1 parent 33ffce9 commit b811edc

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,6 @@ Style/SymbolProc:
320320
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb'
321321
- 'lib/fastlane/plugin/wpmreleasetoolkit/models/configuration.rb'
322322

323-
# Offense count: 3
324-
# This cop supports safe autocorrection (--autocorrect).
325-
Style/UnlessElse:
326-
Exclude:
327-
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb'
328-
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb'
329-
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb'
330-
331323
# Offense count: 4
332324
# This cop supports unsafe autocorrection (--autocorrect-all).
333325
Style/ZeroLengthPredicate:

lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ def self.run(params)
1313

1414
version = Fastlane::Helper::Android::VersionHelper.get_public_version
1515
message = "Completing code freeze for: #{version}\n"
16-
unless params[:skip_confirm]
17-
UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
18-
else
16+
if params[:skip_confirm]
1917
UI.message(message)
18+
else
19+
UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
2020
end
2121

2222
# Check local repo status

lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ def self.run(params)
1818
translationDirectories = subdirectories_for_path(params[:metadata_folder])
1919
imageDirectories = subdirectories_for_path(params[:orig_folder])
2020

21-
unless helper.can_resolve_path(params[:output_folder])
21+
if helper.can_resolve_path(params[:output_folder])
22+
UI.message "#{self.check_path(params[:output_folder])} Output Folder: #{params[:output_folder]}"
23+
else
2224
UI.message "✅ Created Output Folder: #{params[:output_folder]}"
2325
FileUtils.mkdir_p(params[:output_folder])
24-
else
25-
UI.message "#{self.check_path(params[:output_folder])} Output Folder: #{params[:output_folder]}"
2626
end
2727

2828
outputDirectory = helper.resolve_path(params[:output_folder])

lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ def self.run(params = {})
99
UI.message 'Running Configure Download'
1010

1111
# If the `~/.mobile-secrets` repository doesn't exist
12-
unless File.directory?(secrets_dir)
13-
UI.user_error!("The local secrets store does not exist. Please clone it to #{secrets_dir} before continuing.")
14-
else
12+
if File.directory?(secrets_dir)
1513
update_repository # If the repo already exists, just update it
14+
else
15+
UI.user_error!("The local secrets store does not exist. Please clone it to #{secrets_dir} before continuing.")
1616
end
1717
end
1818

0 commit comments

Comments
 (0)