lib/tasks/coffeelint.rake in coffeelint-0.3.0 vs lib/tasks/coffeelint.rake in coffeelint-0.4.0
- old
+ new
@@ -1,5 +1,17 @@
desc "lint application javascript"
task :coffeelint do
- success = Coffeelint.run_test_suite('app') and Coffeelint.run_test_suite('spec')
+ conf = {}
+
+ config_file = [].tap {|files|
+ files << ENV['COFFEELNT_CONFIG'] if ENV['COFFEELENT_CONFIG']
+ files << 'config/coffeelint.json'
+ if ENV['HOME']
+ files << "#{ENV['HOME']}/coffeelint.json"
+ files << "#{ENV['HOME']}/.coffeelint.json"
+ end
+ }.compact.detect {|file| File.exists?(file) }
+
+ conf[:config_file] = config_file if config_file
+ success = Coffeelint.run_test_suite('app', conf) and Coffeelint.run_test_suite('spec', conf)
fail "Lint!" unless success
end