Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rubocop "undefined method" for everything

I'm using rubocop with syntastic to write Chef code.

Something weird happens where after I satisfy all of rubocop's suggestions it flags every function call "undefined".

For example here it is flagging an extra space (this is a Chef resource I am writing): enter image description here

OK so I remove the extra space and run a syntax check and then it flags everything as undefined: enter image description here

Why is it doing this and how can I stop this behavior?

like image 948
red888 Avatar asked Jun 22 '26 02:06

red888


1 Answers

You'll have to disable that Rubocop rule. Chef uses a DSL, meaning there are methods that are magically injected into the context which Rubocop can't know about.

like image 130
coderanger Avatar answered Jun 25 '26 00:06

coderanger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!