Skip to content

Commit 87c4566

Browse files
Fix Style/ZeroLengthPredicate violations
1 parent b811edc commit 87c4566

File tree

5 files changed

+4
-13
lines changed

5 files changed

+4
-13
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,3 @@ Style/SymbolProc:
319319
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/configure_helper.rb'
320320
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb'
321321
- 'lib/fastlane/plugin/wpmreleasetoolkit/models/configuration.rb'
322-
323-
# Offense count: 4
324-
# This cop supports unsafe autocorrection (--autocorrect-all).
325-
Style/ZeroLengthPredicate:
326-
Exclude:
327-
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_development_certificates_to_provisioning_profiles.rb'
328-
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_devices_to_provisioning_profiles.rb'
329-
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb'
330-
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb'

lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_development_certificates_to_provisioning_profiles.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def self.run(params)
1717
profile.is_a? Spaceship::Portal::ProvisioningProfile::Development
1818
end
1919
.tap do |profiles|
20-
UI.important "Warning: Unable to find any profiles associated with #{identifier}" unless profiles.length > 0
20+
UI.important "Warning: Unable to find any profiles associated with #{identifier}" if profiles.empty?
2121
end
2222
.each do |profile|
2323
profile.certificates = all_certificates

lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_devices_to_provisioning_profiles.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def self.run(params)
1515
profile.is_a? Spaceship::Portal::ProvisioningProfile::Development
1616
end
1717
.tap do |profiles|
18-
UI.important "Warning: Unable to find any profiles associated with #{identifier}" unless profiles.length > 0
18+
UI.important "Warning: Unable to find any profiles associated with #{identifier}" if profiles.empty?
1919
end
2020
.each do |profile|
2121
profile.devices = devices

lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def self.first_existing_ancestor_of(path:)
4747
def self.has_git_lfs?
4848
return false unless is_git_repo?
4949

50-
`git config --get-regex lfs`.length > 0
50+
!`git config --get-regex lfs`.empty?
5151
end
5252

5353
# Switch to the given branch and pull its latest commits.

lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def handle_glotpress_download(response:, locale:, is_source:)
111111
@alternates.clear
112112
loc_data = JSON.parse(response.body) rescue loc_data = nil
113113
parse_data(locale, loc_data, is_source)
114-
reparse_alternates(target_locale, loc_data, is_source) unless @alternates.length == 0
114+
reparse_alternates(target_locale, loc_data, is_source) unless @alternates.empty?
115115
when '301'
116116
# Follow the redirect
117117
UI.message("Received 301 for `#{locale}`. Following redirect...")

0 commit comments

Comments
 (0)