Skip to content

Commit aff4f91

Browse files
Fix Style/SelfAssignment violations
1 parent 4d0928d commit aff4f91

File tree

5 files changed

+9
-18
lines changed

5 files changed

+9
-18
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,15 +284,6 @@ Style/SafeNavigation:
284284
Exclude:
285285
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb'
286286

287-
# Offense count: 9
288-
# This cop supports safe autocorrection (--autocorrect).
289-
Style/SelfAssignment:
290-
Exclude:
291-
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/an_metadata_update_helper.rb'
292-
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb'
293-
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb'
294-
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_update_helper.rb'
295-
296287
# Offense count: 1
297288
# This cop supports safe autocorrection (--autocorrect).
298289
# Configuration parameters: EnforcedStyle.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def generate_keys(release_version)
8383
version_minor = Integer(values[1])
8484
@new_key = "#{@rel_note_key}_#{version_major.to_s.rjust(2, '0')}#{version_minor}"
8585

86-
version_major = version_major - 1 if version_minor == 0
86+
version_major -= 1 if version_minor == 0
8787
version_minor = version_minor == 0 ? 9 : version_minor - 1
8888

8989
@keep_key = "#{@rel_note_key}_#{version_major.to_s.rjust(2, '0')}#{version_minor}"

lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ def self.merge_lib(main, library)
133133
case res
134134
when :updated
135135
UI.verbose "#{string_node.attr('name')} updated."
136-
updated_count = updated_count + 1
136+
updated_count += 1
137137
when :found
138-
untouched_count = untouched_count + 1
138+
untouched_count += 1
139139
when :added
140140
UI.verbose "#{string_node.attr('name')} added."
141-
added_count = added_count + 1
141+
added_count += 1
142142
when :skipped
143-
skipped_count = skipped_count + 1
143+
skipped_count += 1
144144
else
145145
UI.user_error!("Internal Error! #{res}")
146146
end

lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,13 +489,13 @@ def self.update_version(version, section)
489489
if line.include?('versionName') && !line.include?('"versionName"') && !line.include?('PversionName')
490490
version_name = line.split[1].tr('\"', '')
491491
line.sub!(version_name, version[VERSION_NAME].to_s)
492-
version_updated = version_updated + 1
492+
version_updated += 1
493493
end
494494

495495
if line.include? 'versionCode'
496496
version_code = line.split[1]
497497
line.sub!(version_code, version[VERSION_CODE].to_s)
498-
version_updated = version_updated + 1
498+
version_updated += 1
499499
end
500500
end
501501
temp_file.puts line

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def generate_keys(release_version)
8787
version_minor = Integer(values[1])
8888
@new_key = "#{@rel_note_key}_#{version_major}#{version_minor}"
8989

90-
version_major = version_major - 1 if version_minor == 0
90+
version_major -= 1 if version_minor == 0
9191
version_minor = version_minor == 0 ? 9 : version_minor - 1
9292

9393
@keep_key = "#{@rel_note_key}_#{version_major}#{version_minor}"
@@ -147,7 +147,7 @@ def generate_keys(release_version)
147147
version_minor = Integer(values[1])
148148
@new_key = "v#{release_version}-whats-new"
149149

150-
version_major = version_major - 1 if version_minor == 0
150+
version_major -= 1 if version_minor == 0
151151
version_minor = version_minor == 0 ? 9 : version_minor - 1
152152

153153
@old_key = "v#{version_major}.#{version_minor}-whats-new"

0 commit comments

Comments
 (0)