Skip to content

Commit

Permalink
Reword .erb-lint deprecation message
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshenny committed Aug 13, 2024
1 parent a418316 commit e270e7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/erb_lint/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/erb_lint/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e270e7d

Please sign in to comment.