NHSDigital / ndr_dev_support

Development tools and security support for developers
MIT License
3 stars 4 forks source link

# Suppress some parser/current warnings #91

Closed joshpencheon closed 3 years ago

joshpencheon commented 3 years ago

Issue Summary

The parser library quite rightly warns loudly when the exact version of Ruby it is expecting doesn't match the active Ruby (given a history of syntax validity changes even within tiny version bumps of Ruby).

However, these warnings are popping up in unexpected places, and are just noise - so get ignored.

PR Summary

Given that Rubocop itself now loads parser/current, ndr_dev_support (which is a dependency of all of our projects) triggers it too (by virtue of acting as a Rubocop plugin).

This PR preserves the warnings when they're relevant:

$ bundle exec rake rubocop:diff master
warning: parser/current is loading parser/ruby26, which recognizes
warning: 2.6.6-compliant syntax, but you are running 2.6.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
================================== Summary: ==================================
 * lib/ndr_dev_support/rubocop/executor.rb has 0 relevant offences.
 * lib/ndr_dev_support/rubocop/inject.rb has 0 relevant offences.
 * lib/ndr_dev_support/rubocop/range_finder.rb has 0 relevant offences.
==============================================================================

...but suppresses them when they're not:

$ bundle exec rake
Run options: --seed 17038

# Running:

.......................................

Finished in 0.072500s, 537.9310 runs/s, 993.1034 assertions/s.

39 runs, 72 assertions, 0 failures, 0 errors, 0 skips