hanami / validations

Validation mixin for Ruby objects
http://hanamirb.org
MIT License
213 stars 49 forks source link

Upgrade rubocop to version 0.89.0 #206

Closed depfu[bot] closed 4 years ago

depfu[bot] commented 4 years ago

Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ rubocop (0.81 → 0.89.0) · Repo · Changelog

Release Notes

0.89.0

New features

Bug fixes

  • #8346: Allow parentheses in single-line inheritance with Style/MethodCallWithArgsParentheses EnforcedStyle: omit_parentheses to fix invalid Ruby auto-correction. (@gsamokovarov)
  • #8324: Fix crash for Layout/SpaceAroundMethodCallOperator when using Proc#call shorthand syntax. (@fatkodima)
  • #8332: Fix auto-correct in Style/ConditionalAssignment to preserve constant namespace. (@biinari)
  • #8344: Fix crash for Style/CaseLikeIf when checking against equal? and match? without a receiver. (@fatkodima)
  • #8323: Fix a false positive for Style/HashAsLastArrayItem when hash is not a last array item. (@fatkodima)
  • #8299: Fix an incorrect auto-correct for Style/RedundantCondition when using raise, rescue, or and without argument parentheses in else. (@koic)
  • #8335: Fix incorrect character class detection for nested or POSIX bracket character classes in Style/RedundantRegexpEscape. (@owst)
  • #8347: Fix an incorrect auto-correct for EnforcedStyle: hash_rockets of Style/HashSyntax with Layout/HashAlignment. (@koic)
  • #8375: Fix an infinite loop error for Style/EmptyMethod. (@koic)
  • #8385: Remove auto-correction for Lint/EnsureReturn. (@marcandre)
  • #8391: Mark Style/ArrayCoercion as not safe. (@marcandre)
  • #8406: Improve Style/AccessorGrouping's auto-correction to remove redundant blank lines. (@koic)
  • #8330: Fix a false positive for Style/MissingRespondToMissing when defined method with inline access modifier. (@koic)
  • #8422: Fix an error for Lint/SelfAssignment when using or-assignment for constant. (@koic)
  • #8423: Fix an error for Style/SingleArgumentDig when without a receiver. (@koic)
  • #8424: Fix an error for Lint/IneffectiveAccessModifier when there is begin...end before a method definition. (@koic)
  • #8006: Fix line length calculation for Style/IfUnlessModifier to correctly take into account code before the if condition when considering conversation to a single-line form. (@dsavochkin)
  • #8283: Fix line length calculation for Style/IfUnlessModifier to correctly take into account a comment on the first line when considering conversation to a single-line form. (@dsavochkin)
  • #7957: Fix line length calculation for Style/IfUnlessModifier to correctly take into account code on the last line after the end keyword when considering conversion to a single-line form. (@dsavochkin)
  • #8226: Fix Style/IfUnlessModifier to add parentheses when converting if-end condition inside an array or a hash to a single-line form. (@dsavochkin)
  • #8443: Fix an incorrect auto-correct for Style/StructInheritance when there is a comment before class declaration. (@koic)
  • #8444: Fix an error for Layout/FirstMethodArgumentLineBreak when using kwargs in super. (@koic)

Changes

  • #8376: Style/MethodMissingSuper cop is removed in favor of new Lint/MissingSuper cop. (@fatkodima)
  • #8433: Lint/UselessComparison cop is removed in favor of new Lint/BinaryOperatorWithIdenticalOperands cop. (@fatkodima)
  • #8350: Set default max line length to 120 for Style/MultilineMethodSignature. (@koic)
  • #8338: potentially breaking. Config#for_department now returns only the config specified for that department; the 'Enabled' attribute is no longer calculated. (@marcandre)
  • #8037: (Breaking) Cop Metrics/AbcSize now counts ||=, &&=, multiple assignments, for, yield, iterating blocks. &. now count as conditions too (unless repeated on the same variable). Default bumped from 15 to 17. Consider using rubocop -a --disable-uncorrectable to ease transition. (@marcandre)
  • #8276: Cop Metrics/CyclomaticComplexity not longer counts &. when repeated on the same variable. (@marcandre)
  • #8204: (Breaking) Cop Metrics/PerceivedComplexity now counts else in case statements, &., ||=, &&= and blocks known to iterate. Default bumped from 7 to 8. Consider using rubocop -a --disable-uncorrectable to ease transition. (@marcandre)
  • #8416: Cop Lint/InterpolationCheck marked as unsafe. (@marcandre)
  • #8442: Remove RuboCop::Cop::ParserDiagnostic mixin module. (@koic)

0.88.0

New features

Bug fixes

  • #8232: Fix a false positive for Layout/EmptyLinesAroundAccessModifier when end immediately after access modifier. (@koic)
  • #7777: Fix crash for Layout/MultilineArrayBraceLayout when comment is present after last element. (@shekhar-patil)
  • #7776: Fix crash for Layout/MultilineMethodCallBraceLayout when comment is present before closing braces. (@shekhar-patil)
  • #8282: Fix Style/IfUnlessModifier bad precedence detection. (@tejasbubane)
  • #8289: Fix Style/AccessorGrouping to not register offense for accessor with comment. (@tejasbubane)
  • #8310: Handle major version requirements in Gemspec/RequiredRubyVersion. (@eugeneius)
  • #8315: Fix crash for Style/PercentLiteralDelimiters when the source contains invalid characters. (@eugeneius)
  • #8239: Don't load .rubocop.yml files at all outside of the current project, unless they are personal configuration files and the project has no configuration. (@deivid-rodriguez)

Changes

  • #8021: Rewrite Layout/SpaceAroundMethodCallOperator cop to make it faster. (@fatkodima)
  • #8294: Add of to AllowedNames of MethodParameterName cop. (@AlexWayfer)

0.87.1

Bug fixes

  • #8252: Fix a command line option name from --safe-autocorrect to --safe-auto-correct, which is compatible with RuboCop 0.86 and lower. (@koic)
  • #8259: Fix false positives for Style/BisectedAttrAccessor when accessors have different access modifiers. (@fatkodima)
  • #8253: Fix false positives for Style/AccessorGrouping when accessors have different access modifiers. (@fatkodima)
  • #8257: Fix an error for Style/BisectedAttrAccessor when using attr_reader and attr_writer with splat arguments. (@fatkodima)
  • #8239: Don't load .rubocop.yml from personal folders to check for exclusions if given a custom configuration file. (@deivid-rodriguez)
  • #8256: Fix an error for --auto-gen-config when running a cop who do not support auto-correction. (@koic)
  • #8262: Fix Lint/DeprecatedOpenSSLConstant auto-correction of OpenSSL::Cipher to use lower case, as some Linux-based systems do not accept upper cased cipher names. (@bdewater)

0.87.0

New features

  • #7868: Cop::Base is the new recommended base class for cops. (@marcandre)
  • #3983: Add new Style/AccessorGrouping cop. (@fatkodima)
  • #8244: Add new Style/BisectedAttrAccessor cop. (@fatkodima)
  • #7458: Add new AsciiConstants option for Naming/AsciiIdentifiers. (@fatkodima)
  • #7373: Add new Style/RedundantAssignment cop. (@fatkodima)
  • #8213: Permit to specify TargetRubyVersion 2.8 (experimental). (@koic)
  • #8159: Add new CountAsOne option for code length related Metric cops. (@fatkodima)
  • #8164: Support auto-correction for Lint/InterpolationCheck. (@koic)
  • #8223: Support auto-correction for Style/IfUnlessModifierOfIfUnless. (@koic)
  • #8172: Support auto-correction for Lint/SafeNavigationWithEmpty. (@koic)

Bug fixes

  • #8039: Fix false positives for Lint/ParenthesesAsGroupedExpression in when using operators or chain functions. (@CamilleDrapier)
  • #8196: Fix a false positive for Style/RedundantFetchBlock when using with Rails.cache. (@fatkodima)
  • #8195: Fix an error for Style/RedundantFetchBlock when using #fetch with empty block. (@koic)
  • #8193: Fix a false positive for Style/RedundantRegexpCharacterClass when using [\b]. (@owst)
  • #8205: Fix a false positive for Style/RedundantRegexpCharacterClass when using a leading escaped ]. (@owst)
  • #8208: Fix Style/RedundantParentheses with hash literal as first argument to yield. (@karlwithak)
  • #8176: Don't load .rubocop.yml from personal folders to check for exclusions if there's a project configuration. (@deivid-rodriguez)

Changes

  • #7868: (Breaking) Extensive refactoring of internal classes Team, Commissioner, Corrector. Cop::Cop#corrections not completely compatible. See Upgrade Notes. (@marcandre)
  • #8156: (Breaking) rubocop -a / --autocorrect no longer run unsafe corrections; rubocop -A / --autocorrect-all run both safe and unsafe corrections. Options --safe-autocorrect is deprecated. (@marcandre)
  • #8207: (Breaking) Order for gems names now disregards underscores and dashes unless ConsiderPunctuation setting is set to true. (@marcandre)
  • #8211: Style/ClassVars cop now detects class_variable_set. (@biinari)
  • #8245: Detect top-level constants like ::Const in various cops. (@biinari)

0.86.0

New features

  • #8147: Add new Style/RedundantFetchBlock cop. (@fatkodima)
  • #8111: Add auto-correct for Style/StructInheritance. (@tejasbubane)
  • #8113: Let expect_offense templates add variable-length whitespace with _{foo}. (@eugeneius)
  • #8148: Support auto-correction for Style/MultilineTernaryOperator. (@koic)
  • #8151: Support auto-correction for Style/NestedTernaryOperator. (@koic)
  • #8142: Add Lint/ConstantResolution cop. (@robotdana)
  • #8170: Support auto-correction for Lint/RegexpAsCondition. (@koic)
  • #8169: Support auto-correction for Lint/RaiseException. (@koic)

Bug fixes

  • #8132: Fix the problem with Naming/MethodName: EnforcedStyle: camelCase and _ or i variables. (@avrusanov)
  • #8115: Fix false negative for Lint::FormatParameterMismatch when argument contains formatting. (@andrykonchin)
  • #8131: Fix false positive for Style/RedundantRegexpEscape with escaped delimiters. (@owst)
  • #8124: Fix a false positive for Lint/FormatParameterMismatch when using named parameters with escaped %. (@koic)
  • #7979: Fix "uninitialized constant DidYouMean::SpellChecker" exception. (@bquorning)
  • #8098: Fix a false positive for Style/RedundantRegexpCharacterClass when using interpolations. (@owst)
  • #8150: Fix a false positive for Layout/EmptyLinesAroundAttributeAccessor when using attribute accessors in if ... else branches. (@koic)
  • #8179: Fix an infinite correction loop error for Layout/MultilineBlockLayout when missing newline before opening parenthesis ( for block body. (@koic)
  • #8185: Fix a false positive for Style/YodaCondition when interpolation is used on the left hand side. (@koic)

Changes

  • #8146: Use UTC in RuboCop todo file generation. (@mauro-oto)
  • #8149: Cop Metrics/CyclomaticComplexity now counts &., ||=, &&= and blocks known to iterate. Default bumped from 6 to 7. (@marcandre)
  • #8178: Mark unsafe for Lint/RaiseException. (@koic)

0.85.1

Bug fixes

  • #8083: Fix an error for Lint/MixedRegexpCaptureTypes cop when using a regular expression that cannot be processed by regexp_parser gem. (@koic)
  • #8081: Fix a false positive for Lint/SuppressedException when empty rescue block in do block. (@koic)
  • #8096: Fix a false positive for Lint/SuppressedException when empty rescue block in defs. (@koic)
  • #8108: Fix infinite loop in Layout/HeredocIndentation auto-correct. (@jonas054)
  • #8042: Fix raising error in Lint::FormatParameterMismatch when it handles invalid format strings and add new offense. (@andrykonchin)

0.85.0

New features

  • #6289: Add new CheckDefinitionPathHierarchy option for Naming/FileName. (@jschneid)
  • #8055: Add new Style/RedundantRegexpCharacterClass cop. (@owst)
  • #8069: New option for expect_offense to help format offense templates. (@marcandre)
  • #7908: Add new Style/RedundantRegexpEscape cop. (@owst)
  • #7978: Add new option OnlyFor to the Bundler/GemComment cop. (@ric2b)
  • #8063: Add new AllowedNames option for Naming/ClassAndModuleCamelCase. (@tejasbubane)
  • #8050: New option --display-only-failed that can be used with --format junit. Speeds up test report processing for large codebases and helps address the sorts of concerns raised at mikian/rubocop-junit-formatter #18. (@burnettk)
  • #7746: Add new Lint/MixedRegexpCaptureTypes cop. (@pocke)

Bug fixes

  • #8008: Fix an error for Lint/SuppressedException when empty rescue block in def. (@koic)
  • #8012: Fix an incorrect autocorrect for Lint/DeprecatedOpenSSLConstant when deprecated OpenSSL constant is used in a block. (@koic)
  • #8017: Fix a false positive for Lint/SuppressedException when empty rescue with comment in def. (@koic)
  • #7990: Fix resolving inherit_gem in remote configs. (@CvX)
  • #8035: Fix a false positive for Lint/DeprecatedOpenSSLConstant when using double quoted string argument. (@koic)
  • #7971: Fix an issue where --disable-uncorrectable would not update uncorrected code with rubocop:todo. (@rrosenblum)
  • #8035: Fix a false positive for Lint/DeprecatedOpenSSLConstant when argument is a variable, method, or consntant. (@koic)

Changes

  • #8056: (Breaking) Remove support for unindent/active_support/powerpack from Layout/HeredocIndentation, so it only recommends using squiggy heredoc. (@bquorning)

0.84.0

New features

  • #7735: NodePattern and AST classes have been moved to the rubocop-ast gem. (@marcandre)
  • #7950: Add new Lint/DeprecatedOpenSSLConstant cop. (@bdewater)
  • #7976: Add AllowAliasSyntax and AllowedMethods options for Layout/EmptyLinesAroundAttributeAccessor. (@koic)
  • #7984: New rake task "check_commit" will run rspec and rubocop on files touched by the last commit. (@marcandre)

Bug fixes

  • #7953: Fix an error for Lint/AmbiguousOperator when a method with no arguments is used in advance. (@koic)
  • #7962: Fix a false positive for Lint/ParenthesesAsGroupedExpression when heredoc has a space between the same string as the method name and (. (@koic)
  • #7967: Style/SlicingWithRange cop now supports any expression as its first index. (@zverok)
  • #7972: Fix an incorrect autocrrect for Style/HashSyntax when using a return value uses return. (@koic)
  • #7886: Fix a bug in AllowComments logic in Lint/SuppressedException. (@jonas054)
  • #7991: Fix an error for Layout/EmptyLinesAroundAttributeAccessor when attribute method is method chained. (@koic)
  • #7993: Fix a false positive for Migration/DepartmentName when a disable comment contains an unexpected character for department name. (@koic)

Changes

  • #7952: (Breaking) Change the max line length of Layout/LineLength to 120 by default. (@koic)
  • #7959: Change enforced style to conditionals for Style/AndOr. (@koic)
  • #7985: Add EnforcedStyle for Style/DoubleNegation cop and allow double nagation in contexts that use boolean as a return value. (@koic)

0.83.0

New features

  • #7951: Include rakefile file by default. (@jethrodaniel)
  • #7921: Add new Style/SlicingWithRange cop. (@zverok)
  • #7895: Include .simplecov file by default. (@robotdana)
  • #7916: Support autocorrection for Lint/AmbiguousRegexpLiteral. (@koic)
  • #7917: Support autocorrection for Lint/UselessAccessModifier. (@koic)
  • #595: Add ERB pre-processing for configuration files. (@jonas054)
  • #7918: Support autocorrection for Lint/AmbiguousOperator. (@koic)
  • #7937: Support autocorrection for Style/IfWithSemicolon. (@koic)
  • #3696: Add AllowComments option to Lint/EmptyWhen cop. (@koic)
  • #7910: Support autocorrection for Lint/ParenthesesAsGroupedExpression. (@koic)
  • #7925: Support autocorrection for Layout/ConditionPosition. (@koic)
  • #7934: Support autocorrection for Lint/EnsureReturn. (@koic)
  • #7922: Add new Layout/EmptyLineAroundAttributeAccessor cop. (@koic)

Bug fixes

  • #7929: Fix Style/FrozenStringLiteralComment to accept frozen_string_literal anywhere in leading comment lines. (@jeffcarbs)
  • #7882: Fix Style/CaseEquality when AllowOnConstant is true and the method receiver is implicit. (@rafaelfranca)
  • #7790: Fix --parallel and --ignore-parent-exclusion combination. (@jonas054)
  • #7881: Fix --parallel and --force-default-config combination. (@jonas054)
  • #7635: Fix a false positive for Style/MultilineWhenThen when then required for a body of when is used. (@koic)
  • #7905: Fix an error when running rubocop --only or rubocop --except options without cop name argument. (@koic)
  • #7903: Fix an incorrect autocorrect for Style/HashTransformKeys and Style/HashTransformValues cops when line break before to_h method. (@diogoosorio, @koic)
  • #7899: Fix an infinite loop error for Layout/SpaceAroundOperators with Layout/ExtraSpacing when using ForceEqualSignAlignment: true. (@koic)
  • #7885: Fix Style/IfUnlessModifier logic when tabs are used for indentation. (@jonas054)
  • #7909: Fix a false positive for Lint/ParenthesesAsGroupedExpression when using an intended grouped parentheses. (@koic)
  • #7913: Fix a false positive for Lint/LiteralAsCondition when using true literal in while and similar cases. (@koic)
  • #7928: Fix a false message for Style/GuardClause when using and or or operators for guard clause in then or else branches. (@koic)
  • #7928: Fix a false positive for Style/GuardClause when assigning the result of a guard condition with else. (@koic)

Changes

  • #7860: Change AllowInHeredoc option of Layout/TrailingWhitespace to true by default. (@koic)
  • #7094: Clarify alignment in Layout/MultilineOperationIndentation. (@jonas054)
  • #4245: (Breaking) Inspect all files given on command line unless --only-recognized-file-types is given. (@jonas054)
  • #7390: (Breaking) Enabling a cop overrides disabling its department. (@jonas054)
  • #7936: Mark Lint/BooleanSymbol as unsafe. (@laurmurclar)
  • #7948: Mark unsafe for Style/OptionalArguments. (@koic)
  • #7931: Remove dependency on the jaro_winkler gem, instead depending on did_you_mean. This may be a breaking change for RuboCop libraries calling NameSimilarity#find_similar_name. (@bquorning)

0.82.0

New features

Bug fixes

  • #7871: Fix an auto-correction bug in Lint/BooleanSymbol. (@knu)
  • #7842: Fix a false positive for Lint/RaiseException when raising Exception with explicit namespace. (@koic)
  • #7834: Fix Lint/UriRegexp to register offense with array arguments. (@tejasbubane)
  • #7841: Fix an error for Style/TrailingCommaInBlockArgs when lambda literal (->) has multiple arguments. (@koic)
  • #7842: Fix a false positive for Lint/RaiseException when Exception without cbase specified under the namespace Gem by adding AllowedImplicitNamespaces option. (@koic)
  • Style/IfUnlessModifier does not infinite-loop when autocorrecting long lines which use if/unless modifiers and have multiple statements separated by semicolons. (@alexdowad)
  • rubocop-hq/rubocop-rails#127: Use ConfigLoader.default_configuration for the default config. (@hanachin)

Changes

  • (Breaking) Renamed Layout/Tab cop to Layout/IndentationStyle. (@DracoAter)
  • #7869: (Breaking) Drop support for Ruby 2.3. (@koic)

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)
depfu[bot] commented 4 years ago

Closed in favor of #207.