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

Fix Rubocop Style issues #13188

Open
18 tasks
Tracked by #6055
dacook opened this issue Mar 3, 2025 · 0 comments
Open
18 tasks
Tracked by #6055

Fix Rubocop Style issues #13188

dacook opened this issue Mar 3, 2025 · 0 comments

Comments

@dacook
Copy link
Member

dacook commented Mar 3, 2025

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/developers in a github comment 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 ⚠️ double check there isn't already a PR addressing rubocop that might conflict: https://github.com/openfoodfoundation/openfoodnetwork/pulls)
  2. Remove it from .rubocop_todo.yml and run rubocop to see the error(s). Also check out this script.
  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

Generated 4 Mar 2025:

@github-project-automation github-project-automation bot moved this to To triage (By the maintainers) in Welcome New Developers! Mar 3, 2025
@github-project-automation github-project-automation bot moved this to All the things 💤 in OFN Delivery board Mar 3, 2025
@dacook dacook moved this from To triage (By the maintainers) to Backend Easy in Welcome New Developers! Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: All the things 💤
Status: Backend Easy
Development

No branches or pull requests

1 participant