summaryrefslogtreecommitdiff
path: root/lib/tasks/haml-lint.rake
blob: 305e15d69d5349a6f0c0b4e000934c8db85282bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
unless Rails.env.production?
  require 'haml_lint/rake_task'
  require Rails.root.join('haml_lint/inline_javascript')

  # Workaround for warnings from parser/current
  # Keep it even if it no longer emits any warnings,
  # because we'll still see warnings in console/server anyway,
  # and we don't need to break static-analysis for this.
  task :haml_lint do
    require 'parser'
    def Parser.warn(*args)
      puts(*args) # static-analysis ignores stdout if status is 0
    end
  end

  HamlLint::RakeTask.new
end