简体   繁体   中英

Rubocop: Ignore all cops that are boilerplate from a new rails app

When I run rubocop in my app directory, I get a long list of cops that stem from the default boiler-plate rails app which I just generated.

I don't want rubocop to look at these files since I'm not the author of the files and I don't want to mess around with them.

I see that I can add files to the Exclude: section with rubocop/config/default.yml but I'm not sure what configs and files I should be adding to properly ignore the built in files while not ignoring the files I create.

You can run rubocop --auto-gen-config and this will create a todo file for you which you can disable all the cops in. Then you can selectively turn the ones you want back on. Alternatively you can create a boiler plate rails app and run rubocop and those will be the files you need to add the excludes list.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM