Skip to content

Commit

Permalink
Deprecate erb-lint mentions in the Cli to erb_lint
Browse files Browse the repository at this point in the history
  • Loading branch information
george-ma committed Jul 23, 2024
1 parent 3ff8ad5 commit d8523d9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/erb_lint/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ module ERBLint
class CLI
include Utils::SeverityLevels

DEFAULT_CONFIG_FILENAME = ".erb-lint.yml"
DEPRECATED_CONFIG_FILENAME = ".erb-lint.yml"
DEFAULT_CONFIG_FILENAME = ".erb_lint.yml"
DEFAULT_LINT_ALL_GLOB = "**/*.html{+*,}.erb"

class ExitWithFailure < RuntimeError; end
Expand Down Expand Up @@ -87,7 +88,7 @@ def run(args = ARGV)
rescue => e
@stats.exceptions += 1
puts "Exception occurred when processing: #{relative_filename(filename)}"
puts "If this file cannot be processed by erb-lint, " \
puts "If this file cannot be processed by erb_lint, " \
"you can exclude it in your configuration file."
puts e.message
puts Rainbow(e.backtrace.join("\n")).red
Expand Down Expand Up @@ -215,6 +216,10 @@ def load_config
if File.exist?(config_filename)
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 soon deprecated. Rename your config to erb_lint.yml.").yellow)
config = RunnerConfig.new(file_loader.yaml(DEPRECATED_CONFIG_FILENAME), file_loader)
@config = RunnerConfig.default_for(config)
else
warn(Rainbow("#{config_filename} not found: using default config").yellow)
@config = RunnerConfig.default
Expand Down

0 comments on commit d8523d9

Please sign in to comment.