Foodcritic / foodcritic

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

Allow configuring the size of the AST cache #800

Closed Babar closed 5 years ago

Babar commented 5 years ago

Also, make the cache unique, so if people want to use read_ast in a rule, it will use the same cache

Otherwise, it can get really slow if people check dependencies using AST. The default of 5 will keep the memory footprint low and should be fine for most people

Babar commented 5 years ago

The failing tests are due to using a single cache. I'll fix the tests.

jaymzh commented 5 years ago

You still have test failures though...

Babar commented 5 years ago

Pretty certain the last 2 failing tests are because I'm testing with rbenv and Travis CI runs with rvm. I honestly have no idea what's wrong, as it works for me, and even running manually what the test does works. (running foodcritic with no argument returns a non-zero exit code after printing the usage, same with running it with a non-existent -w option)

Babar commented 5 years ago

@tas50 would you mind having a look please? Pretty sure the code is correct, but I have no idea how to debug as I don't use rvm

tas50 commented 5 years ago

Thanks @Babar. Sorry for the long delay here