gitlab-org--gitlab-foss/lib/tasks/haml-lint.rake
Lin Jen-Shin 3a9271f179 Convert parser warnings to stdout in haml_lint
This was used in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16648
and this could happen from time to time, so let's just keep it.
2018-10-24 15:31:00 +08:00

17 lines
502 B
Ruby

unless Rails.env.production?
require 'haml_lint/rake_task'
require '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