Sha256: 985eeb6b5933e17ea311ef5165db8479285486689855590269ee43f69d23ea7a

Contents?: true

Size: 822 Bytes

Versions: 7

Compression:

Stored size: 822 Bytes

Contents

desc "Build *corelib* and *stdlib* and lint the result"
task :jshint do
  dir = 'tmp/lint'
  puts
  puts "= Checking distributed files..."
  unless ENV['SKIP_BUILD']
    rm_rf dir if File.exist? dir
    sh "bundle exec rake dist DIR=#{dir}"
  end

  Dir["#{dir}/*.js"].each {|path|
    # opal-builder and opal-parser take so long travis stalls
    next if path =~ /.min.js\z|opal-builder|opal-parser/

    sh "jshint --verbose #{path}"
  }
  puts
  puts "= Checking corelib files separately..."
  js_paths = []
  Dir['opal/{opal,corelib}/*.rb'].each do |path|
    js_path = "#{dir}/#{path.tr('/', '-')}.js"
    sh "bundle exec opal -Dignore -cEO #{path} > #{js_path}"
    js_paths << js_path
  end
  js_paths.each do |js_path|
    sh "jshint --verbose #{js_path}"
  end
  sh "jshint --verbose opal/corelib/runtime.js"
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
opal-0.11.4 tasks/linting.rake
opal-0.11.3 tasks/linting.rake
opal-0.11.2 tasks/linting.rake
opal-0.11.1 tasks/linting.rake
opal-0.11.1.pre tasks/linting.rake
opal-0.11.0 tasks/linting.rake
opal-0.11.0.rc1 tasks/linting.rake