Foodcritic / foodcritic

Lint tool for Chef cookbooks.
http://foodcritic.io
MIT License
408 stars 153 forks source link

Fixup notification action detect and fail FC037 if they're strings #736

Closed tas50 closed 6 years ago

tas50 commented 6 years ago

So this initially started as a simple new rule until I realized that our entire system for parsing out actions in notifications was flawed. It turned everything into a symbol even if it wasn't a symbol. So now it sorta does the right thing:

Find strings and pass them as strings Find symbols and pass them as symbols Find variables like node attributes and pass them as nil since we can't do anything with those and parsing them out is really hard

With this new data we should probably avoid some FC037 false positives and we're now alerting if you send an action as a string which was happening in 2 places on the Supermarket and up until 13.7 potentially led to double notifications.