Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby: Linting and RuboCop: Add minor clarifications and improvements #28828

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ruben-vl
Copy link
Contributor

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 --init command
  • rewrites a few sentences in a minor way to avoid confusion and improve readability

Issue

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project curriculum contributing guide
  • The title of this PR follows the location of change: brief description of change format, e.g. Intro to HTML and CSS lesson: Fix link text
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • If any lesson files are included in this PR, they follow the Layout Style Guide

@github-actions github-actions bot added the Content: Ruby Involves the Ruby course label Sep 21, 2024
@scheals
Copy link
Contributor

scheals commented Sep 21, 2024

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: 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.

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

@ruben-vl
Copy link
Contributor Author

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: 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 --init
It won’t have anything in it besides a 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.

@CouchofTomato
Copy link
Member

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?

@ruben-vl
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content: Ruby Involves the Ruby course
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants