Update rubocop: 0.52.1 → 0.60.0 (major) #138
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've updated a dependency and here is what you need to know:
Additionally, the update changed a few other dependencies as well:
You should probably take a good look at the info here and the test results before merging this pull request, of course.
What changed?
✳️ rubocop (0.52.1 → 0.60.0) · Repo · Changelog
Release Notes
0.60.0
New features
--safe
and--safe-auto-correct
options. (@Darhazer)--auto-gen-only-exclude
. (@Ana06, @jonas054)VersionAdded
meta data to config/default.yml when runningrake new_cop
. (@koic)Whitelist
config toRails/SkipsModelValidations
rule. (@DiscoStarslayer)Bug fixes
Rails/ReversibleMigration
when using variable assignment. (@koic, @scottmatthewman)Style/RedundantFreeze
and a false negative forStyle/MutableConstant
when assigning a regexp object to a constant. (@koic)Style/RedundantFreeze
when assigning a range object to a constant. (@koic)Rails/ReversibleMigration
when block argument is empty. (@koic)LineLength
cop for tab-indented code. (@AlexWayfer)Changes
key
option inLayout/AlignHash
cop. (@albaer)0.59.2
Bug fixes
Rails/HasManyOrHasOneDependent
when using associations of Active Resource. (@tejasbubane, @koic)Style/For
when settingEnforcedStyle: each
andfor
dose not havedo
or semicolon. (@autopp)Layout/EmptyLineAfterGuardClause
when guard clause including heredoc. (@koic)AllowURI
option forMetrics/LineLength
cop with disabledLayut/Tab
cop. (@AlexWayfer)Metrics/BlockLength
into the respective length cops. (@drenmi)Style/ZeroLengthPredicate
false positives when inspectingTempfile
,StringIO
, andFile::Stat
objects. (@drenmi)Layout/EmptyLinesAroundAccessModifier
andLayout/EmptyLinesAroundAccessModifier
when specifying a superclass that breaks the line. (@koic)Style/IfUnlessModifier
when using named capture. (@drenmi)Style/Semicolon
from breaking on single line if-then-else in assignment. (@drenmi)Rails/HasManyOrHasOneDependent
when an Active Record model does not have any relations. (@koic)Style/For
when settingEnforcedStyle: each
with range provided to thefor
loop without ado
keyword or semicolon and without enclosing parenthesis. (@lukasz-wojcik)Changes
Metrics/MethodLength
. (@akanoi)0.59.1
Bug fixes
Rails/FindEach
. (@Knack)Naming/FileName
when investigating gemspecs. (@kddeisz)Naming/FileName
when investigating dotfiles. (@sinsoku)Style/EmptyCaseCondition
auto-correction removes comment betweencase
and firstwhen
. (@koic)Style/RedundantBegin
when callingsuper
with a block. (@eitoball)Layout/EmptyLineAfterGuardClause
when guard clause is after heredoc including string interpolation. (@koic)Style/MultilineMethodSignature
. (@drenmi)Layout/EmptyLineAfterGuardClause
cop whenif
condition is after heredoc. (@koic)Changes
Lint/UnreachableCode
detectexit
,exit!
andabort
. (@hoshinotsuyoshi)#===
fromNaming/BinaryOperatorParameterName
. (@zverok)+
to allowed file names ofNaming/FileName
. (@yensaki)0.59.0
New features
Bundler/GemComment
cop. (@sunny)IgnoredMethods
option toStyle/NumericPredicate
cop. (@AlexWayfer)--display-only-fail-level-offenses
to only output offenses at or above the fail level. (@robotdana)Style/For
. (@rrosenblum)AllowImplicitReturn
option toRails/SaveBang
cop. (@robotdana)comparison
style toStyle/NilComparison
. (@khiav223577)Style/MultilineMethodSignature
cop. (@drenmi)Performance/ChainArrayAllocation
cop. (@schneems)Layout/EmptyLinesAroundClassBody
aware of specifying a superclass that breaks the line. (@koic)Bug fixes
Style/DateTime
not detecting#to_datetime
. It can be configured to allow this. (@bdewater)Naming/FileName
whenInclude
ofAllCops
is the default setting. (@koic)Layout/MultilineOperationIndentation
. (@jonas054)Layout/ClosingParenthesisIndentation
when method arguments are empty with newlines. (@tatsuyafw)Layout/AccessModifierIndentation
when using access modifiers with arguments within nested classes. (@gmalette)Style/IfUnlessModifier
cop for disabledLayout/Tab
cop when there is noIndentationWidth
config. (@AlexWayfer)AllowURI
option ofMetrics/LineLength
cop for files with tabs indentation. (@AlexWayfer)Style/UnneededCondition
when using operator method higher precedence than||
. (@koic)Lint/ShadowedArgument
. (@jonas054)Layout/MultilineHashBraceLayout
andLayout/MultilineArrayBraceLayout
auto-correct syntax error when there is a comment on the last element. (@bacchir)Style/BracesAroundHashParameters
auto-correct syntax error when there is a trailing comma. (@bacchir)Style/RedundantBegin
aware of stabby lambdas. (@drenmi)Naming/PredicateName
. (@sunny)Style/EmptyCaseCondition
when usingreturn
inwhen
clause and assigning the return value ofcase
. (@koic)Rails/Delegate
. (@sunny)Style/WordArray
when settingEnforcedStyle: brackets
and using string interpolation in%W
literal. (@koic)Lint/RescueEnsureAlignment
whenend
is misaligned. The alignment and message are now based on the beginning position rather than theend
position. (@rrosenblum)Date
usage inStyle/DateTime
. (@deivid-rodriguez)Changes
Rails/FindEach
cop. Makes the cop also check for the following scopes:eager_load
,includes
,joins
,left_joins
,left_outer_joins
,preload
,references
, andunscoped
. (@repinel)db
to allowed names ofNaming/UncommunicativeMethodParamName
cop in default config. (@mkenyon)Lint/DuplicateMethods
to include the method name. (@rrosenblum)rubocop --auto-gen-conf
if the todo file is successfully created even if there are offenses. (@MagedMilad)Rails/RelativeDateConstant
by default. (@koic)*
) to match the hidden file. (@koic)Style/For
now highlights the entire statement rather than just the keyword. (@rrosenblum)Performance/CaseWhenSplat
and its auto-correction by default. (@rrosenblum)Layout/EmptyLineAfterGuardClause
cop by default. (@koic)Style/DateTime
has been moved to disabled by default. (@deivid-rodriguez)0.58.2
Changes
New features
#6105: Support
{a,b}
file name globs inExclude
andInclude
config. (@mikeyhew)#6116: Add
ip
to allowed names ofNaming/UncommunicativeMethodParamName
cop in default config. (@nijikon)Bug fixes
Layout/IndentationWidth
when multiple modifiers are used in a block and a method call is made at end of the block. (@koic)Naming/MemoizedInstanceVariableName
cop to allow methods to have leading underscores. (@kenman345)Layout/ClassStructure
when there is a comment in the macro method to be auto-correct. (@koic)Lint/OrderedMagicComments
when using{ encoding: Encoding::SJIS }
hash object afterfrozen_string_literal
magic comment. (@koic)0.58.1
Bug fixes
Style/MethodCallWithArgsParentheses
when arguments are method calls. (@maxh)Style/RedundantParentheses
with hash literal as first argument tosuper
. (@maxh)Gemspec/OrderedDependencies
when using method call to gem names in gemspec. (@koic)Rails/BulkChangeTable
aware of variable table name. (@wata727)Layout/MultilineAssignmentLayout
cop when using multi-line block defines on separate lines. (@koic)0.57.2
Bug fixes
Layout/ClosingHeredocIndentation
from raising an error on<<
heredocs. (@dvandersluis)Layout/ClosingHeredocIndentation
from raising an error on heredocs containing only a newline. (@drenmi)Layout/IndentationConsistency
cop triggered by an empty expression string interpolation. (@alexander-lazarov)Style/MethodCallWithArgsParentheses
from raising an error in certain cases. (@drenmi)0.57.1
Bug fixes
inherit_mode
directive. (@jonas054)Layout/IndentationWidth
when an access modifier section has an invalid indentation body. (@tatsuyafw)Layout/IndentationConsistency
should still register an offense for private methods. (@jaredbeck)Rails/BulkChangeTable
. (@wata727)Style/UnneededCondition
cop accepts a case of condition andif_branch
are same when usingelsif
branch. (@koic)0.57.0
New features
Rails/BulkChangeTable
cop. (@wata727)Style/AccessModifierDeclarations
cop. (@brandonweiss)Style/UnneededCondition
cop. (@balbesina)Layout/ClosingHeredocIndentation
cop. (@siggymcfried)slashes
style toRails/FilePath
since Ruby accepts forward slashes even on Windows. (@sunny)Layout/LeadingBlankLines
checks for empty lines at the beginning of a file. (@rrosenblum)Bug fixes
Style/SymbolArray
andStyle/WordArray
not working on arrays of size 1. (@TikiTDO)Rails/AssertNot
to allow it to have failure message. (@koic)headers
orenv
keyword arguments inRails/HttpPositionalArguments
. (@rrosenblum)Style/BracesAroundHashParameters
auto-correct going past the end of the file when the closing curly brace is on the last line of a file. (@EiNSTeiN-)Style/FrozenStringLiteralComment
would be added to the second line if the first line is empty. (@rrosenblum)Layout/SpaceInsideReferenceBrackets
aware ofno_space
when using nested reference brackets. (@koic)Style/MixinGrouping
when method namedinclude
accepts block. (@Darhazer)Changes
--fix-layout/-x
command line alias. (@scottmatthewman)Lint/SplatKeywordArguments
cop. (@koic)httpdate
to acceptedRails/TimeZone
methods. (@cupakromer)xmlschema
to acceptedRails/TimeZone
methods. (@koic)rake repl
task tobin/console
command. (@koic)inherit_mode
work for default configuration too. (@jonas054)unicode/display_width
. (@nroman-stripe)0.56.0
New features
Performance/InefficientHashSearch
cop. (@JacobEvelyn)Rails/RefuteMethods
cop. (@koic)Rails/AssertNot
cop. (@composerinteralia)Layout/ClosingParenthesisIndentation
detection including method chaining. (@jfelchner)consistent_relative_to_receiver
style option toLayout/FirstParameterIndentation
. (@jfelchner)AR::Migration#up_only
forRails/ReversibleMigration
cop. (@koic)Lint/ErbNewArguments
cop. (@koic)Lint/SplatKeywordArguments
cop. (@koic)Include
,Exclude
and the newRubyInterpreters
parameters for file selection. (@jonas054)Bug fixes
Style/EmptyMethod
which concatenated the method name and first argument if no method def parentheses are used. (@thomasbrus)Rails/SaveBang
when using negated if. (@Edouard-chin)Lint/SafeNavigationChain
not detecting chained operators after block. (@Darhazer)Lint/SafeNavigationConsistency
registers multiple offenses for the same method call. (@rrosenblum)Style/CommentAnnotation
reporting only the first of multiple consecutive offending lines. (@svendittmer)Lint/SafeNavigationConsistency
when there is code around the condition. (@rrosenblum)Rails/HasManyOrHasOneDependent
when using nestedwith_options
. (@koic)--stdin
always treats input as Ruby source irregardless of filename. (@PointlessOne)Style/MethodCallWithArgsParentheses
adding extra parentheses if the method argument was already parenthesized. (@dvandersluis)AllCops/Include
were not inspected when passing the file name as an option. (@drenmi)Lint/PercentStringArray
andLint/PercentSymbolArray
when the inspected file is binary encoded. (@akhramov)nil
responds to inLint/SafeNavigationConsistency
. (@rrosenblum)Lint/LiteralInInterpolation
if contains numbers. (@koic)Rails/CreateTableWithTimestamps
when using hash options. (@wata727)Lint/UnneededCopEnableDirective
for instruction '# rubocop:enable all'. (@balbesina)Rails/HttpPositionalArgumnets
to usesession
instead ofheader
. (@rrosenblum)Changes
Style/MethodMissing
into two cops,Style/MethodMissingSuper
andStyle/MissingRespondToMissing
. (@rrosenblum)AllowInMultilineConditions
option toStyle/ParenthesesAroundCondition
cop. (@Darhazer)Layout/SpaceInsideReferenceBrackets
when assigning a reference bracket to a reference bracket. (@joshuapinter)--auto-correct
. (@jonas054)try!
to the list of whitelisted methods forLint/SafeNavigationChain
andStyle/SafeNavigation
. (@rrosenblum)Style/EmptyLineAfterGuardClause
cop toLayout
department. (@koic)Not all release notes shown. View the full release notes
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
Commits
See the full diff on Github. The new version differs by 66 commits:
Update changelog.
Bump version.
- lexer.rl: Partially revert 5ba072d and properly handle 'm = -> *args do end'.
Update changelog.
Bump version.
Fix YARD type annotations for parameterized types
Fix YARD type annotation for nilable types
Fix doc typo
Revert parsing of '-> do rescue; end' for ruby25, it's valid only starting from 26. (#510)
- lexer.rl: Fix parsing of 'm = -> *args do end'.
Update changelog.
- AST::Processor: Properly recurse into "kwsplat" nodes
+ ruby26.y: Endless ranges support.
- ruby24, ruby25, ruby26: Fix cmdargs after command_args followed by tLBRACE_ARG.
- lexer.rl: Fix parsing of `let (:a) { m do; end }`.
Fix a wrong indentation in the AST_FORMAT.md
Update changelog.
Bump version.
- lexer.rl, Dedenter: Treat slash in heredocs as a line continuation.
- lexer.rl: Fix parsing of `a ? b + '': nil`.
- lexer.rl: Reject `m a: {} {}` and `m [] {}` since 25.
* Parser::Current: bump latest 2.2 branch to 2.2.10.
Parser::Current: bump latest versions to 2.3.7, 2.4.4, 2.5.1. (#489)
call String#getbyte
- builders/default: allow class/module/dynamic constant definition in the method body if there's a sclass between them. (bug #490)
- lexer.rl: Emit :!@ as :!, :~@ as :~.
- parse{23,24,25}.y: use only CMDARG/COND _PUSH/POP for cmdarg/cond management. (bug #481)
+ ruby26.y: Raise a syntax error on 'else' without 'rescue'.
- lexer.rl: emit tSTRING_BEG and tSTRING_DBEG one by one to allow parser to properly manipulate cmdarg stack. (bug #480)
ruby26.y: branch parser.
Bump version.
Update changelog.
Bump version.
Moved @last_token capturing from Lexer#emit to Parser#next_token.
ruby-parse displays escape sequences only in tty
- AST::Processor: handle on_index, on_indexasgn, on_lambda.
Fix cmdarg handling around string interpolation. (#467)
Update changelog.
Allow bundler 1.15 (Debian unstable).
Bump version.
Update changelog.
- Accept `BEGIN` and `END` as correct method name (#463)
Remove duplicate test case in test_source_tree_rewriter.rb (#462)
Fix cmdarg handling for parsers < 24.
Make sure Source::Buffer#name is a string
Fix Out of range error reporting
Fix wording [ci-skip]
- Parser::Source::Buffer: Fixed parsing of encoding comment when the file contains only shebang.
Bump warning message for 2.4.x branch in the parser/current.
call String#b instead of #dup+#force_encoding
Bump version.
- ruby24.y, ruby25.y: Replicate cmdargs handling from MRI. (#453)
Update changelog.
Bump version.
Fix running `rake changelog` on tagged commit.
- parser/current: latest released Ruby series is 2.5.x.
- builders/default: x[], x[]=1: emit as s(:index), s(:indexasgn) via AST opt-in.
+ builders/default: __ENCODING__: emit as s(:__ENCODING__) via AST opt-in.
- lexer.rl: "#{-> foo {}}": fix parsing of interpolated lambda with open args.
Fixed encoding comment handling.
Fixed cmdarg manipulation in command_args rule.
+ ruby25.y: Extract expr_value_do rule.
+ ruby25.y: Extract begin_block rule.
+ ruby25.y: Allow class and method definition in the while condition. (#432)
+ ruby25: Allow `-> do rescue; end`. (#431)
Update changelog.
Commits
See the full diff on Github. The new version differs by 13 commits:
Cut 0.1.2
[Fix #27] Don't return nils from remove_prefix and remove_suffix
[Fix #34] Revert "Fixing the tests and the definition of sum"
Bump the yard dependency
Update Enumerable#sum to match the builtin (#35)
Update Travis config (#36)
Add jruby-9.1.13.0 to the TravisCI matrix (#31)
Use SVG badges in the README [ci skip] (#32)
Fixing the tests and the definition of sum
Fixing rbx
Update the TravisCI config
Use the ISO date format in the changelog
Add some contribution guidelines
Commits
See the full diff on Github. The new version differs by 12 commits:
Release v1.4.0
Unicode 11
Release v1.3.3
Clarify supported Rubies
Replace Gem::Util.gunzip with direct zlib implementation
Release v1.3.2
Explicitly load rubygems/util, fixes regression in 1.3.1 (autoload issue)
Release v1.3.1
Update travis rubies
Merge pull request #15 from Schwad/master
Updates 'Gem.gunzip' to 'Gem::Util.gunzip'
Update travis rubies
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