Faraday: Problème de quête RuboCop

Créé le 20 févr. 2019  ·  5Commentaires  ·  Source: lostisland/faraday

Informations de base

Nous lintons toute la base de code à l'aide de RuboCop.

Ceci est une liste de toutes les règles du .rubocop_todo.yml lorsque nous avons commencé. Les coches signifient « ceci est corrigé et fusionné avec le maître ».

Si vous créez un PR pour corriger l'un d'entre eux, utilisez l'option --only dans RuboCop, pour concentrer l'effort sur 1 type de correction. Il est si facile de se laisser submerger lors de la révision de code comme celui-ci. (Si vous corrigez un peu plus que cela, pas de problème. Il s'agit de garder les modifications révisables.)

# 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"

Un flux de travail

Description du problème

  • [x] Bundle/OrderedGems #856
  • [x] Layout/AccessModifierIndentation #862
  • [x] Disposition/AligneHash #863
  • [x] Disposition/AlignementParamètres #867
  • [x] Layout/BlockEndNewline
  • [x] Disposition/Indentation de cas #864
  • [x] Mise en page/Retrait de commentaire #864
  • [x] Disposition/Position du point #880
  • [x] Layout/ElseAlignment #871
  • [x] Disposition/EmptyLineAfterGuardClause #860
  • [x] Layout/EmptyLineBetweenDefs #860
  • [x] Layout/EmptyLines #860
  • [x] Layout/EmptyLinesAroundAccessModifier #881
  • [x] Disposition/EmptyLinesAroundClassBody #882
  • [x] Disposition/Alignement final #887
  • [x] Disposition/Espacement supplémentaire #884
  • [x] Layout/IndentArray #890
  • [x] Disposition/IndentHash #890
  • [x] Disposition/Largeur d'indentation #864
  • [x] Layout/LeadingCommentSpace #860
  • [x] Layout/MultilineBlockLayout
  • [x] Layout/MultilineMethodCallIndentation #864
  • [x] Layout/MultilineOperationIndentation #864
  • [x] Disposition/SauvetageEnsureAlignment #890
  • [x] Disposition/EspaceAprès la virgule #884
  • [x] Layout/SpaceAroundEqualsInParameterDefault #884
  • [x] Disposition/SpaceAroundOperators #884
  • [x] Disposition/EspaceAvantBlockBraces #884
  • [x] Layout/SpaceInsideArrayLiteralBrackets #884
  • [x] Disposition/SpaceInsideBlockBraces #884
  • [x] Layout/SpaceInsideHashLiteralBraces #884
  • [x] Disposition/SpaceInsideParens #884
  • [x] Layout/SpaceInsidePercentLiteralDelimiters #884
  • [x] Layout/TrailingBlankLines #872
  • [x] Layout/TrailingWhitespace
  • [x] Lint/AssignmentInCondition #874
  • [x] Lint/HandleExceptions #896
  • [x] Lint/ReturnInVoidContext #896
  • [x] Lint/StringConversionInInterpolation #891
  • [x] Lint/UnneededRequireStatement #896
  • [x] Lint/UnusedBlockArgument #896
  • [x] Lint/UnusedMethodArgument #896
  • [x] Lint/UselessAssignment #891
  • [x] Charpie/Vide #896
  • [x] _Reporté indéfiniment_ ~Metrics/AbcSize~
  • [x] Métriques/BlocLongueur #883 #927
  • [x] _Reporté indéfiniment_ ~Metrics/ClassLength #944~
  • [x] _Reporté indéfiniment_ ~Metrics/CyclomaticComplexity~
  • [x] _Reporté indéfiniment_ ~Metrics/MethodLength~
  • [x] _Reporté indéfiniment_ ~Metrics/ModuleLength~
  • [x] _Reporté indéfiniment_ ~Metrics/PerceivedComplexity~
  • [x] Nommage/Nom Constant #897
  • [x] Nommage/MemoizedInstanceVariableName #891
  • [x] Nommage/Nom de prédicat #897
  • [x] Naming/UncommunicativeMethodParamName #897
  • [x] Performance/RedundantBlockCall #897
  • [x] Performance/Remplacement de la chaîne #897
  • [x] Style/AccessModifierDéclarations #897
  • [x] Style/Alias ​​#897
  • [x] Style/EtOu #897
  • [x] Délimiteurs de style/bloc #906
  • [x] Style/BracesAroundHashParameters #907
  • [x] Style/Égalité des cas #902
  • [x] Style/ClassAndModuleChildren #902
  • [x] Contrôle de style/classe #902
  • [x] Style/ClassVars #933
  • [x] Style/ColonMethodAppel #894
  • [x] Style/Commentaire Annotation #876
  • [x] Style/Affectation conditionnelle #902
  • [x] Style/Documentation
  • [x] Style/Double Négation #922
  • [x] Style/ChacunAvecObjet #901
  • [x] Style/VideMéthode #912
  • [x] Style/ExpandPathArguments #901
  • [x] Style/FormatChaîne #901
  • [x] Style/FormatStringToken #914
  • [x] Style/FrozenStringLiteralComment #868
  • [x] Style/GlobalVars #943
  • [x] Style/Clause de garde #931
  • [x] Style/HashSyntaxe #878
  • [x] Style/IfInsideElse #915
  • [x] Style/IfUnlessModifier #926
  • [x] Style/Lambda #901
  • [x] Style/MéthodeMissingSuper #928
  • [x] Style/MissingRespondToMissing #930
  • [x] Style/ModuleFonction #925
  • [x] Style/MultiligneSiModificateur #924
  • [x] Style/MultilineTernaryOperator #913
  • [x] Comparaison de styles/multiples #923
  • [x] Style/Constante Mutable #925
  • [x] Style/NégatifSi #901
  • [x] Appels de style/entre parenthèses imbriqués #901
  • [x] Style/Suivant #901
  • [x] Style/NilComparaison #921
  • [x] Style/Pas #901
  • [x] Style/Prédicat numérique #921
  • [x] Style/Affectation parallèle #920
  • [x] Style/ParenthèsesAutourCondition #920
  • [x] Style/PercentLiteralDelimiters #905
  • [x] Style/Références PerlBack #920
  • [x] Style/Méthodes de hachage préférées #920
  • [x] Style/Proc #920
  • [x] Style/RaiseArgs #910
  • [x] Style/RedundantException #895
  • [x] Style/Parenthèses redondantes #895
  • [x] Style/RedondantReturn #895
  • [x] Style/RedundantSelf #895
  • [x] Style/RegexpLiteral #910
  • [x] Style/RescueStandardError #910
  • [x] Style/Navigation sécurisée #909
  • [x] Style/Point virgule #908
  • [x] Style/Méthodes à ligne unique #909
  • [x] Style/SpecialGlobalVars #909
  • [x] Style/StderrPuts #908
  • [x] Style/StringLiterals #874
  • [x] Style/StringLiteralsInInterpolation #909
  • [x] Style/StructHéritage #904
  • [x] Style/Tableau de symboles #898
  • [x] Style/Proc Symbole #898
  • [x] Style/Parenthèses Ternaires #898
  • [x] Style/TrailingCommaInArrayLiteral #859
  • [x] Style/TrailingCommaInHashLiteral #859
  • [x] Style/TrivialAccessors #898
  • [x] Style/Sauf Sinon #898
  • [x] Style/Tableau de mots #893
  • [x] Style/YodaCondition #898
  • [x] Style/ZeroLengthPrédicat #858
  • [x] Métriques/Longueur de ligne #938
help wanted

Commentaire le plus utile

Merci tout le monde! ??

Tous les 5 commentaires

Suppression de ce commentaire. Mon affirmation précédente était fausse. Les futurs développeurs doivent noter ce fichier .rubocop_todo.yml lors de la vérification des violations.

La référence principale actuelle a des violations de rubocop qui ne sont pas détectées par CI. Ces problèmes sont résolus dans https://github.com/lostisland/faraday/pull/870 et https://github.com/lostisland/faraday/pull/871.

De plus, si les PR sont nommés quelque chose comme [RuboCop] fix Layout/TrailingBlankLines , alors ils seront beaucoup plus faciles à ajouter à la liste de contrôle ci-dessus.

J'ai coché Style/GlobalVars parce que le seul contrevenant est script/generate_certs . Une fois les anciens tests d'intégration entièrement portés, les anciens scripts de la suite d'intégration peuvent disparaître et cette infraction sera corrigée comme par magie. Toutes les autres variables globales ajoutées ailleurs devraient continuer à être signalées comme des infractions rubocop.

Je n'avais pas vu ce post avant de corriger le Style/Globalvars :man_shruging :

Merci tout le monde! ??

Cette page vous a été utile?
0 / 5 - 0 notes