From e270e7dddf16e81bae6570ef44b758ed91acc3cb Mon Sep 17 00:00:00 2001 From: Jenny Shen Date: Tue, 13 Aug 2024 11:53:21 -0400 Subject: [PATCH] Reword .erb-lint deprecation message --- lib/erb_lint/cli.rb | 5 ++++- spec/erb_lint/cli_spec.rb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/erb_lint/cli.rb b/lib/erb_lint/cli.rb index b495357..34b847a 100644 --- a/lib/erb_lint/cli.rb +++ b/lib/erb_lint/cli.rb @@ -217,7 +217,10 @@ def load_config config = RunnerConfig.new(file_loader.yaml(config_filename), file_loader) @config = RunnerConfig.default_for(config) elsif File.exist?(DEPRECATED_CONFIG_FILENAME) - warn(Rainbow("#{DEPRECATED_CONFIG_FILENAME} is deprecated. Rename your config to `erb_lint.yml`.").yellow) + deprecation_message = "The config file has been renamed to `#{DEFAULT_CONFIG_FILENAME}` and " \ + "`#{DEPRECATED_CONFIG_FILENAME}` is deprecated. " \ + "Please rename your config file to `#{DEFAULT_CONFIG_FILENAME}`." + warn(Rainbow(deprecation_message).yellow) config = RunnerConfig.new(file_loader.yaml(DEPRECATED_CONFIG_FILENAME), file_loader) @config = RunnerConfig.default_for(config) else diff --git a/spec/erb_lint/cli_spec.rb b/spec/erb_lint/cli_spec.rb index e776735..40e1678 100644 --- a/spec/erb_lint/cli_spec.rb +++ b/spec/erb_lint/cli_spec.rb @@ -113,7 +113,7 @@ def run(processed_source) end it "shows a warning but loads the deprecated config file" do - expect { subject }.to(output(/#{Regexp.escape(deprecated_config_filename)} is deprecated/).to_stderr) + expect { subject }.to(output(/`#{Regexp.escape(deprecated_config_filename)}` is deprecated/).to_stderr) config = cli.instance_variable_get(:@config) expect(config).to(be_an_instance_of(ERBLint::RunnerConfig)) end