lib/scss_lint/config.rb in scss_lint-0.44.0 vs lib/scss_lint/config.rb in scss_lint-0.45.0
- old
+ new
@@ -6,11 +6,11 @@
# Loads and manages application configuration.
class Config
FILE_NAME = '.scss-lint.yml'.freeze
DEFAULT_FILE = File.join(SCSS_LINT_HOME, 'config', 'default.yml')
- attr_reader :options, :warnings
+ attr_reader :options, :warnings, :file
class << self
def default
load(DEFAULT_FILE, merge_with_default: false)
end
@@ -18,11 +18,11 @@
# Loads a configuration from a file, merging it with the default
# configuration.
def load(file, options = {})
config_options = load_options_hash_from_file(file)
- config = new(config_options)
+ config = new(config_options, file)
# Need to call this before merging with the default configuration so
# that plugins can override the default configuration while still being
# overridden by the repo's configuration.
config.load_plugins
@@ -199,12 +199,13 @@
end
end
end
end
- def initialize(options)
+ def initialize(options, file = Config.user_file)
@options = options
@warnings = []
+ @file = file
validate_linters
end
def [](key)