Ruby: Linting and RuboCop: Add minor clarifications and improvements
Because
Just some minor changes to improve consistency (e.g. touch or nano while the rubocop --init was introduced in a previous paragraph).
Also some punctuation and spacing to improve readability and limit confusion.
This PR
- adds consistency with earlier paragraph by adding the
rubocop --initcommand - rewrites a few sentences in a minor way to avoid confusion and improve readability
Issue
Additional Information
Pull Request Requirements
- [X] I have thoroughly read and understand The Odin Project curriculum contributing guide
- [X] The title of this PR follows the
location of change: brief description of changeformat, e.g.Intro to HTML and CSS lesson: Fix link text - [X] The
Becausesection summarizes the reason for this PR - [X] The
This PRsection has a bullet point list describing the changes in this PR - [X] If this PR addresses an open issue, it is linked in the
Issuesection - [X] If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
- [X] If any lesson files are included in this PR, they follow the Layout Style Guide
Originally I absent-mindedly told people to run bundle exec in ~ which should not work, as no Gemfile should be present in the home directory. What probably would be the simplest change is dropping bundle exec and running rubocop --init instead but a different one was made: https://github.com/TheOdinProject/curriculum/commit/d7cc9578668656b2ec3dee7514dcc66c5cf788d8 Because of that, the reference to running it in the home directory was lost, together with a mention of there being an auto-generated comment. It seems that the home directory being referenced heavily in the section made sure folks created the config file there but it does feel confusing at the moment.
Wonder if the comment that gets generated automatically when running the command needs to be added to the code block or not:
# The behavior of RuboCop can be controlled via the .rubocop.yml
# configuration file. It makes it possible to enable/disable
# certain cops (checks) and to alter their behavior if they accept
# any parameters. The file can be placed either in your home
# directory or in some project directory.
#
# RuboCop will start looking for the configuration file in the directory
# where the inspected file is and continue its way up to the root directory.
#
# See https://docs.rubocop.org/rubocop/configuration
Originally I absent-mindedly told people to run
bundle execin~which should not work, as no Gemfile should be present in the home directory. What probably would be the simplest change is droppingbundle execand runningrubocop --initinstead but a different one was made: d7cc957 Because of that, the reference to running it in the home directory was lost, together with a mention of there being an auto-generated comment. It seems that the home directory being referenced heavily in the section made sure folks created the config file there but it does feel confusing at the moment.
Interesting! Thanks for linking the original change. I see the confusing thing about the home folder ~ in the following paragraph, since that kind of comes out of nowhere now in the example and the paragraph after the code snippet. Maybe we should rethink that whole section, to make the context in which the different commands need to be run, clearer.
Wonder if the comment that gets generated automatically when running the command needs to be added to the code block or not:
# The behavior of RuboCop can be controlled via the .rubocop.yml # configuration file. It makes it possible to enable/disable # certain cops (checks) and to alter their behavior if they accept # any parameters. The file can be placed either in your home # directory or in some project directory. # # RuboCop will start looking for the configuration file in the directory # where the inspected file is and continue its way up to the root directory. # # See https://docs.rubocop.org/rubocop/configuration
It is mentioned shortly in the section before it.
To create the .rubocop.yml file, run this command from your terminal in your project’s directory:
bundle exec rubocop --initIt won’t have anything in it besidesa comment describing what it is for.
It was clear to me when I was following the section that it should be run in the project folder instead of the home folder when using it with bundle. And I don't think adding the whole auto-generated text to the lesson explicitly adds much.
If a rethink of that section is necessary, do you want to consider it in the context or this PR, or do you want this to be assessed as is and another issue can be made for that?
If a rethink of that section is necessary, do you want to consider it in the context or this PR, or do you want this to be assessed as is and another issue can be made for that?
I think the small adjustments made in this PR are still relevant