lostisland / faraday_middleware

Various Faraday middlewares for Faraday-based API wrappers
MIT License
557 stars 203 forks source link

RuboCop Quest Issue #204

Closed olleolleolle closed 4 years ago

olleolleolle commented 4 years ago

Basic Info

We are linting the whole codebase using RuboCop. ✨

This is a list of all the rules in the .rubocop_todo.yml when we started. The checkmarks mean "this is fixed and merged to master".

If you create a PR to fix one of these, use the --only option in RuboCop, to focus the effort on 1 kind of fix. It's so easy to get overwhelmed when reviewing code like this. (If you fix slightly more than that, no biggie. This is all about keeping the changes reviewable.)

```bash # edit .rubocop.yml, commenting out the first line - # this removes the "ignore the TODOs" setting # Auto-correct with only 1 rule rubocop -a --only Name/OfTheRuleYouAreFixing --auto-correct # Re-generate the config file rubocop --auto-gen-config # Revert line 3 in .rubocop_todo.yml # This will avoid PR conflicts # Inspect to see if it looks OK git diff # Re-set the TODO list git checkout .rubocop.yml # Add and commit the change git add . git commit -m"chore: RuboCop lint Name/OfTheRuleYouAreFixing" ``` A workflow

Issue description

(Here - we will add each of the RuboCop Cops in order.)

See #200

iMacTia commented 4 years ago

@d-m-u @onk thanks for your patience, I've resolved a bunch of offences automatically and updated the list above 👍 If you want to help, please follow the below:

  1. Leave a comment here before starting, stating the rule(s) you're taking care of
  2. Branch from master into a new branch
  3. Remove the rule(s) you want to fix from the .rubocop_todo.yml file
  4. Run rubocop to see the offenses
  5. Fix the offences
  6. Commit, push and open a PR

Thanks ❤️ !

d-m-u commented 4 years ago

I've got the Lint/Loop one.

d-m-u commented 4 years ago

I've also got the Style/GuardClause and the Naming/VariableNumber and the Style/CaseEquality thing and the Naming/ConstantName one, and the Style/NumericPredicate and the Lint/AssignmentInCondition and the MultilineTernaryOperator one. I swear that's it though.

edit fine also the Naming/PredicateName and the Style/IfUnlessModifier and the Layout/LineLength but I expect that one will be needing a few reviews 😆

olleolleolle commented 4 years ago

Thank you, everyone! I am declaring a victory: there are now AbcSize + MethodLength left, and those are just set in the TODO file to a current "max" value which we can prune downwards as we go.

This was a significant piece of formatting - thanks so much for stepping up and helping out with this. A special round of applause for @onk and @d-m-u who picked up the bulk of the pieces left after @iMacTia did the initial automated push.

Closing this Issue feels very good. Thanks!

🌻 /Olle