summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-10-23 10:23:01 -0700
committerLin Jen-Shin <godfat@godfat.org>2018-10-24 15:31:00 +0800
commit0cbefe85ed2823d2201fd9d30120ecf7535e88a0 (patch)
tree3d1fe7e10c51e906d6c0136c3687bda38c35dde7
parent4ca19ab1720fd881e6cf68e22000c3da565290ba (diff)
downloadgitlab-ce-0cbefe85ed2823d2201fd9d30120ecf7535e88a0.tar.gz
Add a monkey patch to squelch warnings from whitequark/parser
-rw-r--r--config/initializers/parser_patch.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/config/initializers/parser_patch.rb b/config/initializers/parser_patch.rb
new file mode 100644
index 00000000000..8ebd804b94f
--- /dev/null
+++ b/config/initializers/parser_patch.rb
@@ -0,0 +1,15 @@
+# frozen_literal_string: true
+
+# This works around unnecessary static-analysis warnings that will be
+# fixed via https://github.com/whitequark/parser/pull/528.
+module Parser
+ class << self
+ def warn_syntax_deviation(feature, version)
+ return if ['2.3.8', '2.4.5', '2.5.3'].include?(version)
+
+ warn "warning: parser/current is loading #{feature}, which recognizes"
+ warn "warning: #{version}-compliant syntax, but you are running #{RUBY_VERSION}."
+ warn "warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri."
+ end
+ end
+end