Closed msalzburg closed 9 years ago
Looks good other than the nit with the test.
Nice catch - updated the spec accordingly.
I also refactored the definition of the default_locations. This way config files in the ENV['HOME'] variable can be applied more easily.
While reviewing the changes I was wondering if the order of the look ups needs an adjustment.
Currently we are are looking up files like this:
file passed via options[:config_file] in CoffeeLint.lint
OR
1 coffeelint.json 2 .coffeelint.json 3 config/coffeelint.json 4 config/.coffeelint.json 5 file defined in ENV[‘COFFEELINT_CONFIG’] 6 ENV[‘HOME’]/coffeelint.json 7 ENV[‘HOME’]/.coffeelint.json
Any suggestions?
Hey Zachary,
just wondering - are you merging this request? Will there be a release coming up?
Best Martin
Thanks!!!
Hey Zachary,
I moved the config file handling (locating and parsing the file) into a separate class.
The CoffeeLint.lint method now uses the new .locate and .parse methods by default, unless a specific :config_file options was given. This simplifies the usage and configuration of the coffeelint bin and rake task.
Also third party gems like e.g. pronto-coffeelint don't have to duplicate the lookup behavior.
I would like to see this merged ^^
What do you think about it?