Faraday: Problema da missão RuboCop

Criado em 20 fev. 2019  ·  5Comentários  ·  Fonte: lostisland/faraday

Informação básica

Estamos lintando toda a base de código usando RuboCop.

Esta é uma lista de todas as regras em .rubocop_todo.yml quando começamos. As marcas de seleção significam "isso foi corrigido e mesclado com o mestre".

Se você criar um PR para corrigir um desses, use a opção --only no RuboCop, para concentrar o esforço em 1 tipo de correção. É tão fácil ficar sobrecarregado ao revisar um código como este. (Se você corrigir um pouco mais do que isso, não é nada demais. O objetivo é manter as alterações revisáveis.)

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

Um fluxo de trabalho

Descrição do problema

  • [x] Bundler / OrderedGems # 856
  • [x] Layout / AccessModifierIndentation # 862
  • [x] Layout / AlignHash # 863
  • [x] Layout / AlignParameters # 867
  • [x] Layout / BlockEndNewline
  • [x] Layout / CaseIndentation # 864
  • [x] Layout / CommentIndentation # 864
  • [x] Layout / DotPosition # 880
  • [x] Layout / ElseAlignment # 871
  • [x] Layout / EmptyLineAfterGuardClause # 860
  • [x] Layout / EmptyLineBetweenDefs # 860
  • [x] Layout / EmptyLines # 860
  • [x] Layout / EmptyLinesAroundAccessModifier # 881
  • [x] Layout / EmptyLinesAroundClassBody # 882
  • [x] Layout / EndAlignment # 887
  • [x] Layout / ExtraSpacing # 884
  • [x] Layout / IndentArray # 890
  • [x] Layout / IndentHash # 890
  • [x] Layout / IndentationWidth # 864
  • [x] Layout / LeadingCommentSpace # 860
  • [x] Layout / MultilineBlockLayout
  • [x] Layout / MultilineMethodCallIndentation # 864
  • [x] Layout / MultilineOperationIndentation # 864
  • [x] Layout / RescueEnsureAlignment # 890
  • [x] Layout / SpaceAfterComma # 884
  • [x] Layout / SpaceAroundEqualsInParameterDefault # 884
  • [x] Layout / SpaceAroundOperators # 884
  • [x] Layout / SpaceBeforeBlockBraces # 884
  • [x] Layout / SpaceInsideArrayLiteralBrackets # 884
  • [x] Layout / SpaceInsideBlockBraces # 884
  • [x] Layout / SpaceInsideHashLiteralBraces # 884
  • [x] Layout / 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] Fiapos / Vazio # 896
  • [x] _Postpondo indefinidamente_ ~ Metrics / AbcSize ~
  • [x] Metrics / BlockLength # 883 # 927
  • [x] _Postponed indefinitely_ ~ Metrics / ClassLength # 944 ~
  • [x] _Postponed indefinitely_ ~ Metrics / CyclomaticComplexity ~
  • [x] _Postpondo indefinidamente_ ~ Metrics / MethodLength ~
  • [x] _Postponed indefinidamente_ ~ Metrics / ModuleLength ~
  • [x] _Postponed indefinitely_ ~ Metrics / PerceivedComplexity ~
  • [x] Nomenclatura / Nome Constante # 897
  • [x] Naming / MemoizedInstanceVariableName # 891
  • [x] Nomenclatura / PredicateName # 897
  • [x] Naming / UncommunicativeMethodParamName # 897
  • [x] Performance / RedundantBlockCall # 897
  • [x] Performance / StringReplacement # 897
  • [x] Style / AccessModifierDeclarations # 897
  • [x] Estilo / Alias ​​# 897
  • [x] Estilo / AndOr # 897
  • [x] Style / BlockDelimiters # 906
  • [x] Style / BracesAroundHashParameters # 907
  • [x] Style / CaseEquality # 902
  • [x] Style / ClassAndModuleChildren # 902
  • [x] Style / ClassCheck # 902
  • [x] Style / ClassVars # 933
  • [x] Style / ColonMethodCall # 894
  • [x] Estilo / Comentário Anotação # 876
  • [x] Style / ConditionalAssignment # 902
  • [x] Estilo / Documentação
  • [x] Style / DoubleNegation # 922
  • [x] Style / EachWithObject # 901
  • [x] Style / EmptyMethod # 912
  • [x] Style / ExpandPathArguments # 901
  • [x] Style / FormatString # 901
  • [x] Style / FormatStringToken # 914
  • [x] Style / FrozenStringLiteralComment # 868
  • [x] Estilo / GlobalVars # 943
  • [x] Style / GuardClause # 931
  • [x] Style / HashSyntax # 878
  • [x] Style / IfInsideElse # 915
  • [x] Style / IfUnlessModifier # 926
  • [x] Estilo / Lambda # 901
  • [x] Style / MethodMissingSuper # 928
  • [x] Style / MissingRespondToMissing # 930
  • [x] Estilo / MóduloFunção # 925
  • [x] Style / MultilineIfModifier # 924
  • [x] Style / MultilineTernaryOperator # 913
  • [x] Estilo / Comparação Múltipla # 923
  • [x] Style / MutableConstant # 925
  • [x] Estilo / NegatedIf # 901
  • [x] Style / NestedParenthesizedCalls # 901
  • [x] Estilo / Próximo # 901
  • [x] Estilo / NilComparison # 921
  • [x] Estilo / Não # 901
  • [x] Style / NumericPredicate # 921
  • [x] Style / ParallelAssignment # 920
  • [x] Style / ParenthesesAroundCondition # 920
  • [x] Style / PercentLiteralDelimiters # 905
  • [x] Style / PerlBackrefs # 920
  • [x] Style / PreferredHashMethods # 920
  • [x] Estilo / Proc # 920
  • [x] Style / RaiseArgs # 910
  • [x] Style / RedundantException # 895
  • [x] Estilo / Parênteses redundantes # 895
  • [x] Estilo / RedundantReturn # 895
  • [x] Style / RedundantSelf # 895
  • [x] Estilo / RegexpLiteral # 910
  • [x] Style / RescueStandardError # 910
  • [x] Estilo / SafeNavigation # 909
  • [x] Estilo / Ponto e vírgula # 908
  • [x] Style / SingleLineMethods # 909
  • [x] Style / SpecialGlobalVars # 909
  • [x] Style / StderrPuts # 908
  • [x] Style / StringLiterals # 874
  • [x] Style / StringLiteralsInInterpolation # 909
  • [x] Style / StructInheritance # 904
  • [x] Style / SymbolArray # 898
  • [x] Style / SymbolProc # 898
  • [x] Style / TernaryParentheses # 898
  • [x] Style / TrailingCommaInArrayLiteral # 859
  • [x] Style / TrailingCommaInHashLiteral # 859
  • [x] Style / TrivialAccessors # 898
  • [x] Style / UnlessElse # 898
  • [x] Estilo / WordArray # 893
  • [x] Style / Yoda Condição # 898
  • [x] Style / ZeroLengthPredicate # 858
  • [x] Metrics / LineLength # 938
help wanted

Comentários muito úteis

Obrigado a todos! 🚀

Todos 5 comentários

Removendo este comentário. Minha afirmação anterior estava errada. Os desenvolvedores futuros devem observar o arquivo .rubocop_todo.yml ao verificar as violações.

O atual mestre ref tem algumas violações do rubocop que não foram detectadas pelo CI. Esses problemas foram corrigidos em https://github.com/lostisland/faraday/pull/870 e https://github.com/lostisland/faraday/pull/871.

Além disso, se os PRs forem nomeados como [RuboCop] fix Layout/TrailingBlankLines , será muito mais fácil adicioná-los à lista de verificação acima.

Eu marquei Style/GlobalVars porque o único infrator é script/generate_certs . Uma vez que os testes de integração antigos foram totalmente portados, os scripts antigos para o pacote de integração podem ir, e esta ofensa será corrigida magicamente. Quaisquer outras variáveis ​​globais adicionadas em outro lugar devem continuar a ser sinalizadas como ofensas rubocop.

Eu não tinha visto esta postagem antes de consertar o Style/Globalvars : man_shrugging:

Obrigado a todos! 🚀

Esta página foi útil?
0 / 5 - 0 avaliações

Questões relacionadas

asf-stripe picture asf-stripe  ·  3Comentários

Lewiscowles1986 picture Lewiscowles1986  ·  4Comentários

mattmill30 picture mattmill30  ·  4Comentários

jedeleh picture jedeleh  ·  3Comentários

subvertallchris picture subvertallchris  ·  5Comentários