openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.12k stars 724 forks source link

Fix Rubocop Rails issues #11482

Open dacook opened 1 year ago

dacook commented 1 year ago

We use Rubocop to standardise our code, which can improve code quality and reduce confusion. When evaluating each rule, consider if it helps with those goals or not. Often the suggested autocorrection is fine, but some cops require more consideration and there may be a better solution, or it might be appropriate to disable them, rather than create unnecessary extra work. If unsure, please ping @openfoodfoundation/core-devs to request an opinion.

Strategy to fix issues

The normal process to fix a style issue is:

  1. Choose a cop to work on, next on the list (but :warning: double check there isn't already a PR addressing the cop: https://github.com/openfoodfoundation/openfoodnetwork/pulls)
  2. Remove it from .rubocop_todo.yml and run rubocop to see the error(s).
  3. Evaluate the rule, and consider applying the suggested fix if it makes sense
    • It may be helpful to commit some fixes separately, or chunked together
    • If it's not a simple fix, it may be worth simply adding a rubocop:disable comment in some cases (disable only offending line where possible)

When a cop or group of cops is complete, open a pull request.

Issues

Most/all of these will require manual fixes. Generated 27 Feb 2024:

dacook commented 1 year ago

Hi @macanudo527 , I see you've started on this so created an issue for tracking.

macanudo527 commented 1 year ago

@dacook Can you assign this to me?

dacook commented 9 months ago

Hi @macanudo527 , how have you been? I hope you've had a fulfilling start to the year! Just wondering if you'd like to pick this up this year, or if we should unassign for now?

macanudo527 commented 9 months ago

@dacook Yeah, I've just been too busy with everything. I'd like to work on it, but just can't.

dacook commented 9 months ago

No problems, that's totally understandable. All the best for this season, and I hope to see you again soon!

anthonyms commented 8 months ago

@dacook Kindly assign this to me. Am I right in concluding that it is a subset of #6055?

dacook commented 8 months ago

Great, yep, that's correct Anthony. Good luck!

sigmundpetersen commented 8 months ago

@dacook maybe we could create sub-issues of the task list in the description? Then each issue will check itself when a PR is merged towards it.

We can create them as we go. Just click to the far right of each checkbox.

dacook commented 8 months ago

Thanks Sigmund. Yes I hadn't bothered with this because I wasn't sure how big each of the items was. It's possible some are so small that they don't need to have a separate issue/pr..

Nwabor commented 7 months ago

@dacook I can work on some of this. Can it be assigned to me?

Nwabor commented 7 months ago

@sigmundpetersen I can work on this, can it be assigned to me?

sigmundpetersen commented 7 months ago

Hi and welcome @Nwabor 👋 Yes, thank you. You can work on this. Please pick one of the open bullets in the Issue list in the description that doesn't have a PR attached.

Nwabor commented 7 months ago

Thank you @sigmundpetersen.

Nwabor commented 6 months ago

@sigmundpetersen i need access right to push my PR.

rioug commented 6 months ago

@Nwabor you should not need right to create the PR, have a look at the documentation here : https://github.com/openfoodfoundation/openfoodnetwork/wiki/Making-a-great-pull-request . Make sure you are using your own fork.

Nwabor commented 6 months ago

@sigmundpetersen can I pick another task, while waiting for the PR I pushed to be reviewed?

sigmundpetersen commented 6 months ago

Yes, go ahead @Nwabor 👍

Nwabor commented 6 months ago

Okay thanks, I will resolve the conflicts as well @sigmundpetersen