TheOdinProject / curriculum

The open curriculum for learning web development
https://www.theodinproject.com/
Other
9.86k stars 13.21k forks source link

Linting and RuboCop: Unclear what "the" Gem is. #28269

Closed scheals closed 3 months ago

scheals commented 3 months ago

Checks

Describe your suggestion

There is an example of locally installing a plugin for RuboCop in You are the code dictator section that confuses learners due to the wording:

Since RuboCop is extensible, there exist other departments that you can use - like Performance or RSpec. You could even write your own Cop! The process of adding an extension is easy: you install the Gem locally and modify .rubocop.yml.

I'm ESL and when I wrote this my train of thought was "the Gem you are interested in, Performance, RSpec, your own Cop". Perhaps it should be "a Gem" or "the Gem(s) you chose".

Example confusion seen on discord

Path

Ruby / Rails

Lesson Url

https://www.theodinproject.com/lessons/ruby-linting-and-rubocop

(Optional) Discord Name

No response

(Optional) Additional Comments

No response

SumonGFC commented 3 months ago

Hi @scheals I do think this section is a bit confusing mainly because of the "metaphor" of cops/departments.

"Since RuboCop is extensible, there exist other departments that you can use - like Performance or RSpec."

I think this line might be less ambiguous if were phrased like:

"There are many gems you can install that will extend RuboCop like rubocop-rspec or rubocop-performance.

Also, on line 180 I think it would be helpful to specify that the line in the proceeding codeblock should be added to the GemFile (and not the .rubocop.yml file)

scheals commented 3 months ago

Hi @scheals I do think this section is a bit confusing mainly because of the "metaphor" of cops/departments.

"Since RuboCop is extensible, there exist other departments that you can use - like Performance or RSpec."

I think this line might be less ambiguous if were phrased like:

"There are many gems you can install that will extend RuboCop like rubocop-rspec or rubocop-performance.

Also, on line 180 I think it would be helpful to specify that the line in the proceeding codeblock should be added to the GemFile (and not the .rubocop.yml file)

That line codeblock after line 180 should go to the Gemfile. Now, it might be because I was duped by VSCode extensions in the past but I do not recall having to do anything else for RuboCop to pick those extensions up, but the official docs seem to suggest an entry in the .rubocop.yml also is required, but since it is a YAML file, it has to be formatted differently: image https://github.com/rubocop/rubocop-performance?tab=readme-ov-file#usage

So yeah, this needs to be added as well.

SumonGFC commented 3 months ago

@scheals Okay, I think I have a good idea of how to help make this section a bit more clear and that would address the issues we've discussed so far. I can submit a PR for you to review. If you like the changes we can merge it, or if you think it could be better we can discuss further. Sound good?

scheals commented 3 months ago

@SumonGFC I have no power here :) But I believe when maints see that you're up to fixing this, they'll assign you the issue and then give you the green light for working on a PR, then review it with you.

SumonGFC commented 3 months ago

@scheals right okay haha. I value your input however, as you are the one who wrote this lesson.

CouchofTomato commented 3 months ago

Feel free to submit a PR @SumonGFC

SumonGFC commented 3 months ago

PR submitted. Please let me know if you have any thoughts/criticisms/suggestions to improve it.