[RUN ALL RSPEC] Selectively raise on Ruby 2.7 keyword warnings
What does this MR do?
Raise on all keyword related warnings (will become ArgumentError
in Ruby 3). But allow some Gem paths to not raise as we fix them one by one.
Related issue: #257438 (closed), #258994 (closed)
Discarded approaches
- Committing the
deprecations
yml files. As CI jobs and developer machines all have different root paths, the keyword warning paths will not match.deprecation_toolkit
does not handle this case.
e.g.
# CI
DEPRECATION WARNING: /builds/gitlab-org/gitlab/spec/support/helpers/next_instance_of.rb:28: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
# locally
DEPRECATION WARNING: /Users/tkuah/code/ee-gdk/gitlab/spec/support/helpers/next_instance_of.rb:28: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
-
Use deprecation_toolkit's
allowed_deprecations
. While it will work, it will not record non-raising warnings, which we still want to record so that we can summarise in therspec:deprecations
job. -
Use the
DeprecationToolkit::Behaviors::Raise
behaviour. Can't use this as we want some warnings to not raise.
Edited by Thong Kuah