Created
August 4, 2016 01:36
-
-
Save isuke/dcee2ca08813f9214e6205415670c783 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require 'coffeelint' unless defined?(Coffeelint) | |
desc "lint application javascript" | |
task :coffeelint do | |
config_file = ENV['config_file'] || '.coffeelint.json' | |
directories = ENV['directories'].try(:split, ',') || ['app/assets/javascripts', 'spec/javascripts'] | |
failures = 0 | |
directories.each do |dir| | |
failures += Coffeelint.run_test_suite(dir, config_file: config_file) | |
end | |
fail "Lint!" unless failures == 0 | |
end | |
rescue LoadError | |
puts 'coffeelint load error' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment