I saw your question, so I went ahead and implemented a cop for you. The name is Style/TernaryParentheses , and the EnforcedStyle parameter is require_parentheses (not the default).
# .rubocop.yml Style/TernaryParentheses: Enabled: true EnforcedStyle: require_parentheses
You can start using it right now by putting it in your Gemfile :
gem 'rubocop', git: 'git://github.com/bbatsov/rubocop.git'
or you can wait for the release of 0.42.0 .
source share