Update Ruby then Add RuboCop to a Rails Project
Channel: Stateless Code
Date: 26/09/2022

"Dead or alive, you're coming with me!"

Unlike government police, RuboCop provides for enforcement of a voluntary and configurable set of standards. Code linting can improve the health of your codebase, help you and your collaborators maintain your project more easily, and identify ambiguous or buggy code.

In this 2nd video in the NerdDice.com series, we add RuboCop to our Gemfile, and adapt an existing .rubocop.yml file from the user home directory and add some additional configuration updates and exclusions.

Before we do that, we fix an oversight from the previous video where the project was setup with an outdated version of Ruby.

This video covers:
00:00:12 Introduction and recap of previous video
00:01:07 Upgrade Ruby from 3.1.0 to 3.1.2.
00:10:00 Update Gemfile with relevant RuboCop gems
00:11:37 Copy and start adapting existing rubocop.yml from the home directory to the project 
00:12:27 Run bundle install, attempt to run RuboCop, fix initial errors to get initial set of offenses
00:13:58 Disable frozen string literal cop 
00:16:00 Review remiaining offenses and start adding exclusions for some of the system generated files
00:22:56 Review and start clearing RuboCop warnings by enabling new cops, removing repeated config, and adding more exclusions
00:30:57 Commit, merge, update project

#ruby #rails7 #rails #rubyonrails #rubygems #codecast #screencast #github #opensource #minitest #TDD #agile #NerdDice #DnD #roleplaying #softwaredevelopment #learntocode #rubocop

See other related StatelessCode videos::
- Install RVM and Ruby with Troubleshooting https://youtu.be/h-JBRJH8W7A
- RuboCop Install and Initial Setup https://youtu.be/dKpiJhA19yg
- Add RuboCop to nerd_dice Gem https://youtu.be/Iz_Wl-IDL-c

This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE.  Stateless Code denies the concept of "intellectual property". Copying is not stealing.