Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-01-23 22:19:45 +0300
committerLin Jen-Shin <godfat@godfat.org>2018-01-26 14:42:48 +0300
commitcb7974b8f71fc2d36a52f4f0b14b757306950b68 (patch)
treeb3c628d6385fc319f7882e33c9e5cd22ef725734 /lib
parentb0b6abde1036b0a867310a2cd7cfd72737eb47ab (diff)
Convert parser warnings to stdout in haml_lint
So we ignore it in static-analysis when status is 0, yet still report it if it's not.
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/haml-lint.rake9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/tasks/haml-lint.rake b/lib/tasks/haml-lint.rake
index ad2d034b0b4..5c0cc4990fc 100644
--- a/lib/tasks/haml-lint.rake
+++ b/lib/tasks/haml-lint.rake
@@ -2,5 +2,14 @@ unless Rails.env.production?
require 'haml_lint/rake_task'
require 'haml_lint/inline_javascript'
+ # Workaround for warnings from parser/current
+ # TODO: Remove this after we update parser gem
+ 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