Skip to content

Commit 4d991a0

Browse files
authored
Merge pull request #328 from wordpress-mobile/l10n/rename-linter-helper
Rename Linter helper in preparation for new upcoming actions
2 parents 9c2d45b + 9425614 commit 4d991a0

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

.rubocop_todo.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ Style/MutableConstant:
306306
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb'
307307
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb'
308308
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_adc_app_sizes_helper.rb'
309-
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_helper.rb'
309+
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb'
310310
- 'lib/fastlane/plugin/wpmreleasetoolkit/version.rb'
311311
- 'spec/release_notes_helper_spec.rb'
312312

@@ -403,7 +403,7 @@ Style/RescueStandardError:
403403
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb'
404404
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb'
405405
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb'
406-
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_helper.rb'
406+
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb'
407407
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb'
408408

409409
# Offense count: 2

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ _None_
1919
### Internal Changes
2020

2121
* Ensure that the `gem push` step only runs on CI if lint, test and danger steps passed before it. [#325]
22+
* Rename internal `Ios::L10nHelper` to `Ios::L10nLinterHelper`. [#328]
2223

2324
## 2.3.0
2425

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def self.run(params)
1717
def self.run_linter(params)
1818
UI.message 'Linting localizations for parameter placeholders consistency...'
1919

20-
require_relative '../../helper/ios/ios_l10n_helper'
21-
helper = Fastlane::Helper::Ios::L10nHelper.new(
20+
require_relative '../../helper/ios/ios_l10n_linter_helper'
21+
helper = Fastlane::Helper::Ios::L10nLinterHelper.new(
2222
install_path: resolve_path(params[:install_path]),
2323
version: params[:version]
2424
)
@@ -92,15 +92,15 @@ def self.available_options
9292
description: 'The path where to install the SwiftGen tooling needed to run the linting process. If a relative path, should be relative to your repo_root',
9393
type: String,
9494
optional: true,
95-
default_value: "vendor/swiftgen/#{Fastlane::Helper::Ios::L10nHelper::SWIFTGEN_VERSION}"
95+
default_value: "vendor/swiftgen/#{Fastlane::Helper::Ios::L10nLinterHelper::SWIFTGEN_VERSION}"
9696
),
9797
FastlaneCore::ConfigItem.new(
9898
key: :version,
9999
env_name: 'FL_IOS_LINT_TRANSLATIONS_SWIFTGEN_VERSION',
100100
description: 'The version of SwiftGen to install and use for linting',
101101
type: String,
102102
optional: true,
103-
default_value: Fastlane::Helper::Ios::L10nHelper::SWIFTGEN_VERSION
103+
default_value: Fastlane::Helper::Ios::L10nLinterHelper::SWIFTGEN_VERSION
104104
),
105105
FastlaneCore::ConfigItem.new(
106106
key: :input_dir,
@@ -115,7 +115,7 @@ def self.available_options
115115
description: 'The language that should be used as the base language that every other language will be compared against',
116116
type: String,
117117
optional: true,
118-
default_value: Fastlane::Helper::Ios::L10nHelper::DEFAULT_BASE_LANG
118+
default_value: Fastlane::Helper::Ios::L10nLinterHelper::DEFAULT_BASE_LANG
119119
),
120120
FastlaneCore::ConfigItem.new(
121121
key: :only_langs,

lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_helper.rb renamed to lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
module Fastlane
55
module Helper
66
module Ios
7-
class L10nHelper
7+
class L10nLinterHelper
88
SWIFTGEN_VERSION = '6.4.0'
99
DEFAULT_BASE_LANG = 'en'
1010
CONFIG_FILE_NAME = 'swiftgen-stringtypes.yml'

spec/ios_lint_localizations_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# First run: expect curl, unzip and cp_r to be called to install SwiftGen before running the action
2020
# See spec_helper.rb for documentation about `expect_shell_command`.
21-
expect_shell_command('curl', any_args, %r{/.*swiftgen-#{Fastlane::Helper::Ios::L10nHelper::SWIFTGEN_VERSION}.zip})
21+
expect_shell_command('curl', any_args, %r{/.*swiftgen-#{Fastlane::Helper::Ios::L10nLinterHelper::SWIFTGEN_VERSION}.zip})
2222
expect_shell_command('unzip', any_args)
2323
expect(FileUtils).to receive(:cp_r)
2424
expect_shell_command("#{install_dir}/bin/swiftgen", 'config', 'run', '--config', anything)
@@ -33,7 +33,7 @@
3333
script = <<~SCRIPT
3434
#!/bin/sh
3535
if [[ "$1" == "--version" ]]; then
36-
echo "SwiftGen v#{Fastlane::Helper::Ios::L10nHelper::SWIFTGEN_VERSION} (Fake binstub)"
36+
echo "SwiftGen v#{Fastlane::Helper::Ios::L10nLinterHelper::SWIFTGEN_VERSION} (Fake binstub)"
3737
fi
3838
SCRIPT
3939
FileUtils.mkdir_p File.join(install_dir, 'bin')
@@ -102,7 +102,7 @@ def run_l10n_linter_test(data_file)
102102
# Note: We will install SwiftGen in vendor/swiftgen if it's not already installed yet, and intentionally won't
103103
# remove this after the test ends, so that further executions of the test run faster.
104104
# Only the first execution of the tests might take longer if it needs to install SwiftGen first to be able to run the tests.
105-
install_dir = "vendor/swiftgen/#{Fastlane::Helper::Ios::L10nHelper::SWIFTGEN_VERSION}"
105+
install_dir = "vendor/swiftgen/#{Fastlane::Helper::Ios::L10nLinterHelper::SWIFTGEN_VERSION}"
106106
result = Fastlane::Actions::IosLintLocalizationsAction.run(
107107
install_path: install_dir,
108108
input_dir: @test_data_dir,

0 commit comments

Comments
 (0)