Skip to content

Commit 4d0928d

Browse files
Correct RedundantParentheses
1 parent 8c16c26 commit 4d0928d

9 files changed

+15
-28
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -232,19 +232,6 @@ Style/RedundantBegin:
232232
Exclude:
233233
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb'
234234

235-
# Offense count: 16
236-
# This cop supports safe autocorrection (--autocorrect).
237-
Style/RedundantParentheses:
238-
Exclude:
239-
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_update_metadata_source_action.rb'
240-
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb'
241-
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb'
242-
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb'
243-
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_development_certificates_to_provisioning_profiles.rb'
244-
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_devices_to_provisioning_profiles.rb'
245-
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb'
246-
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb'
247-
248235
# Offense count: 54
249236
# This cop supports safe autocorrection (--autocorrect).
250237
# Configuration parameters: AllowMultipleReturnValues.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,21 +133,21 @@ def self.available_options
133133
description: 'The path of the .po file to update',
134134
type: String,
135135
verify_block: proc do |value|
136-
UI.user_error!("No .po file path for UpdateMetadataSourceAction given, pass using `po_file_path: 'file path'`") unless value && (!value.empty?)
136+
UI.user_error!("No .po file path for UpdateMetadataSourceAction given, pass using `po_file_path: 'file path'`") unless value && !value.empty?
137137
UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
138138
end),
139139
FastlaneCore::ConfigItem.new(key: :release_version,
140140
env_name: 'FL_UPDATE_METADATA_SOURCE_RELEASE_VERSION',
141141
description: 'The release version of the app (to use to mark the release notes)',
142142
verify_block: proc do |value|
143-
UI.user_error!("No relase version for UpdateMetadataSourceAction given, pass using `release_version: 'version'`") unless value && (!value.empty?)
143+
UI.user_error!("No relase version for UpdateMetadataSourceAction given, pass using `release_version: 'version'`") unless value && !value.empty?
144144
end),
145145
FastlaneCore::ConfigItem.new(key: :source_files,
146146
env_name: 'FL_UPDATE_METADATA_SOURCE_SOURCE_FILES',
147147
description: 'The hash with the path to the source files and the key to use to include their content',
148148
type: Hash,
149149
verify_block: proc do |value|
150-
UI.user_error!("No source file hash for UpdateMetadataSourceAction given, pass using `source_files: 'source file hash'`") unless value && (!value.empty?)
150+
UI.user_error!("No source file hash for UpdateMetadataSourceAction given, pass using `source_files: 'source file hash'`") unless value && !value.empty?
151151
end),
152152
]
153153
end

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def self.run(params)
1616

1717
milestone_duedate = last_stone[:due_on]
1818
milestone_duration = params[:milestone_duration]
19-
newmilestone_duedate = (milestone_duedate.to_datetime.next_day(milestone_duration).to_time).utc
19+
newmilestone_duedate = milestone_duedate.to_datetime.next_day(milestone_duration).to_time.utc
2020
newmilestone_number = Fastlane::Helper::Ios::VersionHelper.calc_next_release_version(last_stone[:title])
2121
number_of_days_from_code_freeze_to_release = params[:number_of_days_from_code_freeze_to_release]
2222
# Because of the app stores review process, we submit the binary 3 days before the intended release date.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ def self.extract_notes(release_notes_file_path, version)
2525
File.open(release_notes_file_path).each do |line|
2626
case state
2727
when :discarding
28-
state = :evaluating if (line.match(/^(\d+\.)?(\d+\.)?(\*|\d+)$/)) && (line.strip == version)
28+
state = :evaluating if line.match(/^(\d+\.)?(\d+\.)?(\*|\d+)$/) && (line.strip == version)
2929
when :evaluating
30-
state = (line.match(/-/)) ? :extracting : :discarding
30+
state = line.match(/-/) ? :extracting : :discarding
3131
when :extracting
3232
if line.match(/^(\d+\.)?(\d+\.)?(\*|\d+)$/)
3333
state = :discarding

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,21 +132,21 @@ def self.available_options
132132
description: 'The path of the .po file to update',
133133
type: String,
134134
verify_block: proc do |value|
135-
UI.user_error!("No .po file path for UpdateMetadataSourceAction given, pass using `po_file_path: 'file path'`") unless value && (!value.empty?)
135+
UI.user_error!("No .po file path for UpdateMetadataSourceAction given, pass using `po_file_path: 'file path'`") unless value && !value.empty?
136136
UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
137137
end),
138138
FastlaneCore::ConfigItem.new(key: :release_version,
139139
env_name: 'FL_UPDATE_METADATA_SOURCE_RELEASE_VERSION',
140140
description: 'The release version of the app (to use to mark the release notes)',
141141
verify_block: proc do |value|
142-
UI.user_error!("No relase version for UpdateMetadataSourceAction given, pass using `release_version: 'version'`") unless value && (!value.empty?)
142+
UI.user_error!("No relase version for UpdateMetadataSourceAction given, pass using `release_version: 'version'`") unless value && !value.empty?
143143
end),
144144
FastlaneCore::ConfigItem.new(key: :source_files,
145145
env_name: 'FL_UPDATE_METADATA_SOURCE_SOURCE_FILES',
146146
description: 'The hash with the path to the source files and the key to use to include their content',
147147
type: Hash,
148148
verify_block: proc do |value|
149-
UI.user_error!("No source file hash for UpdateMetadataSourceAction given, pass using `source_files: 'source file hash'`") unless value && (!value.empty?)
149+
UI.user_error!("No source file hash for UpdateMetadataSourceAction given, pass using `source_files: 'source file hash'`") unless value && !value.empty?
150150
end),
151151
]
152152
end

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
@@ -51,7 +51,7 @@ def self.available_options
5151
description: 'The team_id for the provisioning profiles',
5252
type: String,
5353
verify_block: proc do |value|
54-
UI.user_error!('You must provide a team ID in `team_id`') unless value && (!value.empty?)
54+
UI.user_error!('You must provide a team ID in `team_id`') unless value && !value.empty?
5555
end),
5656
]
5757
end

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
@@ -52,7 +52,7 @@ def self.available_options
5252
description: 'The team_id for the provisioning profiles',
5353
type: String,
5454
verify_block: proc do |value|
55-
UI.user_error!('You must provide a team ID in `team_id`') unless value && (!value.empty?)
55+
UI.user_error!('You must provide a team ID in `team_id`') unless value && !value.empty?
5656
end
5757
),
5858
]

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,21 @@ def self.available_options
4343
description: 'The path of the .po file to update',
4444
type: String,
4545
verify_block: proc do |value|
46-
UI.user_error!("No .po file path for UpdateMetadataSourceAction given, pass using `po_file_path: 'file path'`") unless value && (!value.empty?)
46+
UI.user_error!("No .po file path for UpdateMetadataSourceAction given, pass using `po_file_path: 'file path'`") unless value && !value.empty?
4747
UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
4848
end),
4949
FastlaneCore::ConfigItem.new(key: :release_version,
5050
env_name: 'FL_IOS_UPDATE_METADATA_SOURCE_RELEASE_VERSION',
5151
description: 'The release version of the app (to use to mark the release notes)',
5252
verify_block: proc do |value|
53-
UI.user_error!("No relase version for UpdateMetadataSourceAction given, pass using `release_version: 'version'`") unless value && (!value.empty?)
53+
UI.user_error!("No relase version for UpdateMetadataSourceAction given, pass using `release_version: 'version'`") unless value && !value.empty?
5454
end),
5555
FastlaneCore::ConfigItem.new(key: :source_files,
5656
env_name: 'FL_IOS_UPDATE_METADATA_SOURCE_SOURCE_FILES',
5757
description: 'The hash with the path to the source files and the key to use to include their content',
5858
type: Hash,
5959
verify_block: proc do |value|
60-
UI.user_error!("No source file hash for UpdateMetadataSourceAction given, pass using `source_files: 'source file hash'`") unless value && (!value.empty?)
60+
UI.user_error!("No source file hash for UpdateMetadataSourceAction given, pass using `source_files: 'source file hash'`") unless value && !value.empty?
6161
end),
6262
]
6363
end

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def reparse_alternates(target_locale, loc_data, is_source)
6767

6868
def update_key(target_locale, key, file, data, msg)
6969
message_len = msg.length
70-
if (data.key?(:max_size)) && (data[:max_size] != 0) && ((message_len) > data[:max_size])
70+
if data.key?(:max_size) && (data[:max_size] != 0) && (message_len > data[:max_size])
7171
if data.key?(:alternate_key)
7272
UI.message("#{target_locale} translation for #{key} exceeds maximum length (#{message_len}). Switching to the alternate translation.")
7373
@alternates[data[:alternate_key]] = { desc: data[:desc], max_size: 0 }

0 commit comments

Comments
 (0)