Open chilicheech opened 7 years ago
Please include the source file which triggers this.
How do I find out what source file is causing it? I'm running it against a whole cookbook with several files.
Just start rm
-ing files (checkpoint in source control first of course :) until it stops happening.
OK, I found where it's happening. There is a typo in the code:
service 'my_service' do
action [:enable, :start])
end
execute 'first blah' do
only_if { am_i_awesome? }
end
execute 'second blah' do
end
Notice the closing parens at the end of the action
property of the service
resource. That's a typo. However, if I remove any of the execute resources foodcritic works. Also, if I remove the only_if
from the first execute
resource it also works.
It would be really awesome if foodcritic would tell me what line of what file caused it to crash. I suppose we should run rubocop/cookstyle first before running foodcritic because it is able to report that there's an unexpected parenthesis.
Thanky, will try to repro in a test. We mostly rely on ripper et al to tell us if syntax is bad, and it sounds like that part of the code is at least producing some kind of AST so the best we can probably do is make FC not completely explode and let Rubocop/Cookstyle tell you about the syntax issue.
When I run foodcritic against my cookbook it crashes with the following:
Per those logs it would seem it's related to
fc038
but I don't have any actions set to:none
. Is there a way for me to increase verbosity so I can tell exactly where in the cookbook it's failing?Here's what I'm running on: