Skip to content

Instantly share code, notes, and snippets.

@kinjouj
Created January 29, 2026 09:50
Show Gist options
  • Select an option

  • Save kinjouj/cb6fdb05b3a6e9907b81c6ed28e75016 to your computer and use it in GitHub Desktop.

Select an option

Save kinjouj/cb6fdb05b3a6e9907b81c6ed28e75016 to your computer and use it in GitHub Desktop.
rubocop no unless plugin
module RuboCop
module Cop
module Style
class NoUnless < Base
MSG = 'Do not use `unless`. Use `if !` instead.'
def on_if(node)
return unless node.unless?
add_offense(node)
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment