Faraday: Problema de RuboCop Quest

Creado en 20 feb. 2019  ·  5Comentarios  ·  Fuente: lostisland/faraday

Información básica

Estamos uniendo todo el código base usando RuboCop.

Esta es una lista de todas las reglas en el .rubocop_todo.yml cuando comenzamos. Las marcas de verificación significan "esto se corrigió y se fusionó con el maestro".

Si crea un PR para corregir uno de estos, use la opción --only en RuboCop, para centrar el esfuerzo en 1 tipo de corrección. Es muy fácil sentirse abrumado al revisar un código como este. (Si corrige un poco más que eso, no es problema. Se trata de mantener los cambios revisables).

# 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 flujo de trabajo

Descripcion del problema

  • [x] Bundler / OrderedGems # 856
  • [x] Layout / AccessModifierIndentation # 862
  • [x] Layout / AlignHash # 863
  • [x] Layout / AlignParameters # 867
  • [x] Diseño / BlockEndNewline
  • [x] Diseño / Indentación de caja # 864
  • [x] Indentación de diseño / comentario # 864
  • [x] Diseño / Posición de punto n. ° 880
  • [x] Diseño / ElseAlignment # 871
  • [x] Layout / EmptyLineAfterGuardClause # 860
  • [x] Diseño / EmptyLineBetweenDefs # 860
  • [x] Diseño / EmptyLines # 860
  • [x] Diseño / EmptyLinesAroundAccessModifier # 881
  • [x] Diseño / EmptyLinesAroundClassBody # 882
  • [x] Layout / EndAlignment # 887
  • [x] Diseño / ExtraSpacing # 884
  • [x] Layout / IndentArray # 890
  • [x] Diseño / IndentHash # 890
  • [x] Diseño / Ancho de sangría # 864
  • [x] Layout / LeadingCommentSpace # 860
  • [x] Diseño / MultilineBlockLayout
  • [x] Layout / MultilineMethodCallIndentation # 864
  • [x] Layout / MultilineOperationIndentation # 864
  • [x] Layout / RescueEnsureAlignment # 890
  • [x] Diseño / SpaceAfterComma # 884
  • [x] Diseño / SpaceAroundEqualsInParameterDefault # 884
  • [x] Layout / SpaceAroundOperators # 884
  • [x] Layout / SpaceBeforeBlockBraces # 884
  • [x] Layout / SpaceInsideArrayLiteralBrackets # 884
  • [x] Diseño / SpaceInsideBlockBraces # 884
  • [x] Layout / SpaceInsideHashLiteralBraces # 884
  • [x] Diseño / SpaceInsideParens # 884
  • [x] Layout / SpaceInsidePercentLiteralDelimiters # 884
  • [x] Diseño / TrailingBlankLines # 872
  • [x] Diseño / Espacio en blanco final
  • [x] Pelusa / AssignmentInCondition # 874
  • [x] Excepciones de pelusa / mango # 896
  • [x] Lint / ReturnInVoidContext # 896
  • [x] Lint / StringConversionInInterpolation # 891
  • [x] Lint / UnneededRequireStatement # 896
  • [x] Lint / UnusedBlockArgument # 896
  • [x] Lint / UnusedMethodArgument # 896
  • [x] Pelusa / Tarea inútil # 891
  • [x] Pelusa / Vacío # 896
  • [x] _Publicado indefinidamente_ ~ Métricas / AbcSize ~
  • [x] Métricas / BlockLength # 883 # 927
  • [x] _Publicado indefinidamente_ ~ Métricas / ClassLength # 944 ~
  • [x] _Pospuesta indefinidamente_ ~ Métricas / Complejidad ciclomática ~
  • [x] _Pospuesta indefinidamente_ ~ Métricas / MethodLength ~
  • [x] _Publicado indefinidamente_ ~ Métricas / ModuleLength ~
  • [x] _Pospuesta indefinidamente_ ~ Métricas / Complejidad percibida ~
  • [x] Naming / ConstantName # 897
  • [x] Naming / MemoizedInstanceVariableName # 891
  • [x] Naming / PredicateName # 897
  • [x] Naming / UncommunicativeMethodParamName # 897
  • [x] Rendimiento / RedundantBlockCall # 897
  • [x] Rendimiento / Reemplazo de cuerdas # 897
  • [x] Style / AccessModifierDeclarations # 897
  • [x] Estilo / Alias ​​# 897
  • [x] Estilo / AndOr # 897
  • [x] Style / BlockDelimiters # 906
  • [x] Style / BracesAroundHashParameters # 907
  • [x] Estilo / Igualdad de casos # 902
  • [x] Style / ClassAndModuleChildren # 902
  • [x] Estilo / ClassCheck # 902
  • [x] Style / ClassVars # 933
  • [x] Style / ColonMethodCall # 894
  • [x] Estilo / ComentarioAnotación n. ° 876
  • [x] Estilo / Asignación condicional n.º 902
  • [x] Estilo / Documentación
  • [x] Estilo / DoubleNegation # 922
  • [x] Estilo / EachWithObject # 901
  • [x] Estilo / Método vacío n. ° 912
  • [x] Style / ExpandPathArguments # 901
  • [x] Style / FormatString # 901
  • [x] Style / FormatStringToken # 914
  • [x] Estilo / FrozenStringLiteralComment # 868
  • [x] Estilo / GlobalVars # 943
  • [x] Style / GuardClause # 931
  • [x] Estilo / HashSyntax # 878
  • [x] Estilo / IfInsideElse # 915
  • [x] Style / IfUnlessModifier # 926
  • [x] Estilo / Lambda n. ° 901
  • [x] Style / MethodMissingSuper # 928
  • [x] Estilo / MissingRespondToMissing # 930
  • [x] Estilo / Módulo Función n.º 925
  • [x] Style / MultilineIfModifier # 924
  • [x] Style / MultilineTernaryOperator # 913
  • [x] Style / MultipleComparison # 923
  • [x] Estilo / Constante mutable # 925
  • [x] Estilo / NegadoIf # 901
  • [x] Style / NestedParenthesizedCalls # 901
  • [x] Estilo / Siguiente n. ° 901
  • [x] Style / NilComparison # 921
  • [x] Estilo / No # 901
  • [x] Estilo / NumericPredicate # 921
  • [x] Style / ParallelAssignment # 920
  • [x] Style / ParenthesesAroundCondition # 920
  • [x] Style / PercentLiteralDelimiters # 905
  • [x] Estilo / PerlBackrefs # 920
  • [x] Style / PreferredHashMethods # 920
  • [x] Estilo / Proc # 920
  • [x] Estilo / RaiseArgs # 910
  • [x] Style / RedundantException # 895
  • [x] Estilo / Padres redundantes n. ° 895
  • [x] Estilo / RedundantReturn # 895
  • [x] Estilo / RedundantSelf # 895
  • [x] Estilo / RegexpLiteral # 910
  • [x] Style / RescueStandardError # 910
  • [x] Estilo / Navegación segura n. ° 909
  • [x] Estilo / Punto y coma n. ° 908
  • [x] Style / SingleLineMethods # 909
  • [x] Estilo / SpecialGlobalVars n.º 909
  • [x] Estilo / StderrPuts # 908
  • [x] Estilo / StringLiterals # 874
  • [x] Style / StringLiteralsInInterpolation # 909
  • [x] Style / StructInheritance # 904
  • [x] Style / SymbolArray # 898
  • [x] Style / SymbolProc # 898
  • [x] Estilo / TernaryParentheses # 898
  • [x] Style / TrailingCommaInArrayLiteral # 859
  • [x] Estilo / TrailingCommaInHashLiteral # 859
  • [x] Style / TrivialAccessors # 898
  • [x] Estilo / UnlessElse # 898
  • [x] Estilo / WordArray # 893
  • [x] Estilo / Yoda Condición # 898
  • [x] Style / ZeroLengthPredicate # 858
  • [x] Métricas / LineLength # 938
help wanted

Comentario más útil

¡Gracias a todos! 🚀

Todos 5 comentarios

Eliminando este comentario. Mi afirmación anterior estaba equivocada. Los futuros desarrolladores deben tener en cuenta que el archivo .rubocop_todo.yml al verificar si hay violaciones.

La referencia maestra actual tiene algunas infracciones de Rubocop que CI no detecta. Esos problemas se solucionan en https://github.com/lostisland/faraday/pull/870 y https://github.com/lostisland/faraday/pull/871.

Además, si los RP se denominan algo así como [RuboCop] fix Layout/TrailingBlankLines , será mucho más fácil agregarlos a la lista de verificación anterior.

Marqué Style/GlobalVars porque el único infractor es script/generate_certs . Una vez que las antiguas pruebas de integración se hayan portado por completo, los antiguos scripts para la suite de integración pueden desaparecer, y esta infracción se solucionará mágicamente. Cualquier otra variable global agregada en otro lugar debe seguir marcada como delitos rubocop.

No había visto esta publicación antes de arreglar el Style/Globalvars : man_shrugging:

¡Gracias a todos! 🚀

¿Fue útil esta página
0 / 5 - 0 calificaciones

Temas relacionados

subvertallchris picture subvertallchris  ·  5Comentarios

amrrbakry picture amrrbakry  ·  4Comentarios

iMacTia picture iMacTia  ·  3Comentarios

mattmill30 picture mattmill30  ·  4Comentarios

JasonBarnabe picture JasonBarnabe  ·  4Comentarios