{"id":372,"date":"2016-07-27T17:45:38","date_gmt":"2016-07-27T17:45:38","guid":{"rendered":"https:\/\/www.tech.shinynewthings.com\/?p=372"},"modified":"2016-07-28T15:30:01","modified_gmt":"2016-07-28T15:30:01","slug":"372","status":"publish","type":"post","link":"https:\/\/www.tech.shinynewthings.com\/?p=372","title":{"rendered":"RuboCop &#8211; commands"},"content":{"rendered":"<h1>Installing Rubocop and Overcommit<\/h1>\n<h2>Install gems<\/h2>\n<p>$ gem install rubocop $ gem install overcommit<\/p>\n<h2>sets up githooks<\/h2>\n<p>$ overcommit &#8211;install<\/p>\n<h2>Sign changes to overcommit.yml<\/h2>\n<p>$ overcommit &#8211;sign<\/p>\n<h2>Run Rubocop against project<\/h2>\n<h4>Displays Filename, line and description of error<\/h4>\n<p>$ rubocop<\/p>\n<h2>Rubocop Output<\/h2>\n<h3>Symbol Description<\/h3>\n<h3>. No issues<\/h3>\n<h3>C Convention<\/h3>\n<h3>E Error<\/h3>\n<h3>F Fatal error<\/h3>\n<h3>W Warning<\/h3>\n<h2>Output offense name and count<\/h2>\n<p>$ rubocop &#8211;format offenses<\/p>\n<h2>Show cop definition<\/h2>\n<p>$ rubocop &#8211;show-cop Style\/ZeroLengthPredicate<\/p>\n<h2>List all cops with description, key\/values and link to style guide<\/h2>\n<p>$ rubocop &#8211;show-cops<\/p>\n<h2>Output offense name and count<\/h2>\n<p>$ rubocop &#8211;format offenses<\/p>\n<h2>Run a specific cop against project<\/h2>\n<p>$ rubocop &#8211;only Style\/StringLiterals<\/p>\n<h2>Check a specific file with all cops<\/h2>\n<p>$ rubocop .\/app\/models\/app_namespace\/api\/v1\/saved_calendar.rb<\/p>\n<h2>Check a specific file with all cops<\/h2>\n<p>$ rubocop .\/app\/models\/app_namespace\/api\/v1\/saved_calendar.rb &#8211;only Style\/StringLiterals<\/p>\n<h2>Check a specific file output errors as json<\/h2>\n<p>$ rubocop &#8211;format json app\/models\/app_namespace\/api\/v1\/project.rb<\/p>\n<h2>Auto-correct with a specific cop<\/h2>\n<p>$ rubocop &#8211;auto-correct &#8211;only RedundantParentheses<\/p>\n<h2>Output offenses w formatted suggestion,<\/h2>\n<h4>url to additional comments \/ example<\/h4>\n<p>$ rubocop &#8211;display-style-guide<\/p>\n<h2>Displays Filename, line and description of error<\/h2>\n<h3>With url to documentation for this cop<\/h3>\n<p>$ rubocop &#8211;display-style-guide &#8211;display-cop-names<\/p>\n<h2>Show code correctness<\/h2>\n<p>$ rubocop &#8211;lint<\/p>\n<h2>List Files<\/h2>\n<p>$ rubocop &#8211;list-target-files<\/p>\n<h2>In the instance of a Merge, it may be required to Skip RuboCop<\/h2>\n<p>$ SKIP=RuboCop git commit -am &#8220;Merge&#8221;<\/p>\n<h2>Generate todo list \/ Turn off all cops<\/h2>\n<p>$ rubocop &#8211;auto-gen-config<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing Rubocop and Overcommit Install gems $ gem install rubocop $ gem install overcommit sets up githooks $ overcommit &#8211;install Sign changes to overcommit.yml $ overcommit &#8211;sign Run Rubocop against project Displays Filename, line and description of error $ rubocop Rubocop Output Symbol Description . No issues C Convention E Error F Fatal error W [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-372","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=372"}],"version-history":[{"count":10,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/372\/revisions"}],"predecessor-version":[{"id":374,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/372\/revisions\/374"}],"wp:attachment":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}