Skip to content

Instantly share code, notes, and snippets.

@ksoda
Created November 3, 2020 10:48
Show Gist options
  • Save ksoda/558884e63130040d53c647a3a05b5cf7 to your computer and use it in GitHub Desktop.
Save ksoda/558884e63130040d53c647a3a05b5cf7 to your computer and use it in GitHub Desktop.
class NoPoopInString < Base
extend AutoCorrector
MSG = 'Where did you learn that?'
def on_str(node)
bad = '💩'
return unless node.source.include?(bad)
add_offense(node) do |corrector|
corrector.replace(node, node.source.tr(bad, '🌈'))
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment