Rename Config::PATH to Config::DEFAULT_PATH

This commit is contained in:
Sijawusz Pur Rahnama 2023-03-06 05:47:30 +01:00
parent 9534104942
commit 749da0984c
3 changed files with 6 additions and 6 deletions

View file

@ -20,7 +20,7 @@ module Ameba
describe Formatter::TODOFormatter do
::Spec.after_each do
FileUtils.rm_rf(Ameba::Config::PATH)
FileUtils.rm_rf(Ameba::Config::DEFAULT_PATH)
end
context "problems not found" do
@ -45,7 +45,7 @@ module Ameba
s = Source.new "a = 1", "source.cr"
s.add_issue DummyRule.new, {1, 2}, "message"
formatter.finished([s])
io.to_s.should contain "Created #{Config::PATH}"
io.to_s.should contain "Created #{Config::DEFAULT_PATH}"
end
end

View file

@ -28,8 +28,8 @@ class Ameba::Config
"~/.ameba.yml",
"~/.config/ameba/config.yml",
}
FILENAME = ".ameba.yml"
PATH = Path[Dir.current] / FILENAME
FILENAME = ".ameba.yml"
DEFAULT_PATH = Path[Dir.current] / FILENAME
DEFAULT_GLOBS = %w(
**/*.cr
@ -94,7 +94,7 @@ class Ameba::Config
if path
return File.exists?(path) ? File.read(path) : nil
end
path = Path[PATH].expand(home: true)
path = Path[DEFAULT_PATH].expand(home: true)
search_paths = path
.parents

View file

@ -26,7 +26,7 @@ module Ameba::Formatter
end
private def generate_todo_config(issues)
file = File.new(Config::PATH, mode: "w")
file = File.new(Config::DEFAULT_PATH, mode: "w")
file << header
rule_issues_map(issues).each do |rule, rule_issues|
file << "\n# Problems found: #{rule_issues.size}"