Created
November 3, 2020 10:48
-
-
Save ksoda/558884e63130040d53c647a3a05b5cf7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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