Announcing rubocop-disable_syntax - rubocop extension to forbid unfavorite ruby syntax

Ruby is a sweet language, but sometimes is too sweet… If you have some unfavorite ruby syntax, e.g. unless, until, safe navigation, endless methods etc, you can now easily forbid it using the new rubocop extension - GitHub - fatkodima/rubocop-disable_syntax: A RuboCop plugin that allows to disable some unfavorite ruby syntax, such as `unless`, safe navigation etc.

Everything is enabled by default. Currently, it allows to disable the following syntax:

  • unless - no unless keyword
  • ternary - no ternary operator (condition ? foo : bar)
  • safe_navigation - no safe navigation operator (&.)
  • endless_methods - no endless methods (def foo = 1)
  • arguments_forwarding - no arguments forwarding (foo(...), foo(*), foo(**), foo(&))
  • numbered_parameters - no numbered parameters (foo.each { puts _1 })
  • pattern_matching - no pattern matching
  • shorthand_hash_syntax - no shorthand hash syntax ({ x:, y: })
  • and_or_not - no and/or/not keywords (should use &&/||/! instead)
  • until - no until keyword
  • percent_literals - no any % style literals (%w[foo bar], %i[foo bar], %q("str"), %r{/regex/})