Recent Releases of https://github.com/rubocop/rubocop
https://github.com/rubocop/rubocop - RuboCop 0.70
New features
- #6649:
Layout/AlignHashsupports list of options. (@stoivo) - Add
IgnoreMethodPatternsconfig option toStyle/MethodCallWithArgsParentheses. (@tejasbubane) - #7059: Add
EnforcedStyletoLayout/EmptyLinesAroundAccessModifier. (@koic) - #7052: Add
AllowCommentsoption toLint/HandleExceptions. (@tejasbubane)
Bug fixes
- #7013: Respect DisabledByDefault for custom cops. (@XrXr)
- #7043: Prevent RDoc error when installing RuboCop 0.69.0 on Ubuntu. (@koic)
- #7023: Autocorrection for
Lint/NumberConversion. (@Bhacaz)
Changes
- #6359: Mark
Style/PreferredHashMethodsas unsafe. (@tejasbubane)
- Ruby
Published by bbatsov almost 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.69
New features
- Add support for subclassing using
Class.newtoLint/InheritException. (@houli) - #6779: Add new cop
Style/NegativeUnlessthat checks for unless with negative condition. (@tejasbubane)
Bug fixes
- #6900: Fix
Rails/TimeZoneautocorrectTime.currenttoTime.zone.now. (@vfonic) - #6900: Fix
Rails/TimeZoneto preferTime.zone.#{method}over other acceptable corrections. (@vfonic) - #7007: Fix
Style/BlockDelimiterswithbraces_for_chainingstyle false positive, when chaining using safe navigation. (@Darhazer) - #6880: Fix
.rubocopfile parsing. (@hoshinotsuyoshi) - #5782: Do not autocorrect
Lint/UnifiedIntegerifTargetRubyVersion < 2.4. (@lavoiesl) - #6387: Prevent
Lint/NumberConversionfrom reporting error withTime/DateTime. (@tejasbubane) - #6980: Fix
Style/StringHashKeysto allow string as keys for hash arguments to gsub methods. (@tejasbubane) - #6969: Fix a false positive with block methods in
Style/InverseMethods. (@dduugg) - #6729: Handle array spread for
change_column_defaultinRails/ReversibleMigrationcop. (@tejasbubane) - #7033: Fix an error for
Layout/EmptyLineAfterGuardClausewhen guard clause is a ternary operator. (@koic)
Changes
- #6945: Drop support for Ruby 2.2. (@koic)
- #6945: Set default
EnforcedStyletosquigglyoption forLayout/IndentHeredocandauto_detectionoption is removed. (@koic) - #6945: Set default
EnforcedStyletoalwaysoption forStyle/FrozenStringLiteralCommentandwhen_neededoption is removed. (@koic) - #7027: Allow unicode/display_width dependency version 1.6.0. (@tagliala)
- Ruby
Published by koic almost 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.68.1
Bug fixes
- #6993: Allowing for empty if blocks, preventing
Style/SafeNavigationfrom crashing. (@RicardoTrindade) - #6995: Fix an incorrect auto-correct for
Style/RedundantParentheseswhen enclosed in parentheses atwhile-postoruntil-post. (@koic) - #6996: Fix a false positive for
Style/RedundantFreezewhen freezing the result ofString#*. (@bquorning) - #6998: Fix autocorrect of
Naming/RescuedExceptionsVariableNameto also rename all references to the variable. (@Darhazer) - #6992: Fix unknown default configuration for
Layout/IndentFirstParametercop. (@drenmi) - #6972: Fix a false positive for
Style/MixinUsagewhen using inside block andifcondition is afterinclude. (@koic) - #6738: Prevent auto-correct conflict of
Style/NextandStyle/SafeNavigation. (@hoshinotsuyoshi) - #6847: Fix
Style/BlockDelimitersto properly check if the node is chaned whenbraces_for_chainingis set. (@att14)
- Ruby
Published by bbatsov almost 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.68
New features
- #6973: Add
always_bracestoStyle/BlockDelimiter. (@iGEL) - #6841: Node patterns can now match children in any order using
<>. (@marcandre) - #6928: Add
--initoption for generate.rubocop.ymlfile in the current directory. (@koic) - Add new
Layout/HeredocArgumentClosingParenthesiscop. (@maxh) - #6895: Add support for XDG config home for user-config. (@Mange, @tejasbubane)
- Add initial autocorrection support to
Metrics/LineLength. (@maxh) - Add
Layout/IndentFirstParameter. (@maxh) - #6974: Make
Layout/FirstMethodArgumentLineBreakaware of calling usingsuper. (@koic) - Add new
Lint/HeredocMethodCallPositioncop. (@maxh)
Bug fixes
- Do not annotate message with cop name in JSON output. (@elebow)
- #6914: Fix an error for
Rails/RedundantAllowNilwhen with interpolations. (@Blue-Pix) - #6888: Fix an error for
Rails/ActiveRecordOverridewhen noparent_classpresent. (@diachini) - #6941: Add missing absence validations to
Rails/Validation. (@jmanian) - #6926: Allow nil values to unset config defaults. (@dduugg)
- #6946: Allow
Rails/ReflectionClassNameto use string interpolation forclass_name. (@r7kamura) - #6778: Fix a false positive in
Style/HashSyntaxcop when a hash key is an interpolated string and EnforcedStyle is ruby19_no_mixed_keys. (@tatsuyafw) - #6902: Fix a bug where
Naming/RescuedExceptionsVariableNamewould handle an only first rescue for multiple rescue groups. (@tatsuyafw) - #6860: Prevent auto-correct conflict of
Style/InverseMethodsandStyle/Not. (@hoshinotsuyoshi) - #6935:
Layout/AccessModifierIndentationshould ignore access modifiers that apply to specific methods. (@deivid-rodriguez) - #6956: Prevent auto-correct confliction of
Lint/LambdaandLint/UnusedBlockArgument. (@koic) - #6915: Fix false positive in
Style/SafeNavigationwhen a modifier if is safe guarding a method call being passed tobreak,fail,next,raise,return,throw, andyield. (@rrosenblum) - #6822: Fix Lint/LiteralInInterpolation autocorrection for single quotes. (@hoshinotsuyoshi)
- #6985: Fix an incorrect auto-correct for
Lint/LiteralInInterpolationif contains array percent literal. (@yakout)
Changes
- #6966: Mark Rails/TimeZone as unsafe. (@vfonic)
- #5977: Remove Performance cops. (@koic)
- Add auto-correction to
Naming/RescuedExceptionsVariableName. (@anthony-robin) - #6903: Handle variables prefixed with
_inNaming/RescuedExceptionsVariableNamecop. (@anthony-robin) - #6917: Bump Bundler dependency to >= 1.15.0. (@koic)
- Add
--auto-gen-only-excludeto the command outputted inrubocop_todo.ymlif the option is specified. (@dvandersluis) - #6887: Allow
Lint/UnderscorePrefixedVariableNamecop to be configured to allow use of block keyword args. (@dduugg) - #6885: Revert adding psych >= 3.1 as runtime dependency. (@andreaseger)
- Rename
Layout/FirstParameterIndentationtoLayout/IndentFirstArgument. (@maxh) - Extract method call argument alignment behavior from
Layout/AlignParametersintoLayout/AlignArguments. (@maxh) - Rename
IndentArrayandIndentHashtoIndentFirstArrayElementandIndentFirstHashElement. (@maxh)
- Ruby
Published by bbatsov almost 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.67.2
Bug fixes
- #6882: Fix an error for
Rails/RedundantAllowNilwhen not using bothallow_nilandallow_blank. (@koic)
- Ruby
Published by koic almost 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.67.1
Changes
- Ruby
Published by koic almost 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.67
New features
- #5184: Add new multiline element line break cops. (@maxh)
- Add new cop
Rails/ActiveRecordOverridethat checks for overriding Active Record methods instead of using callbacks. (@elebow) - Add new cop
Rails/RedundantAllowNilthat checks for cases whenallow_blankmakesallow_nilunnecessary in model validations. (@elebow) - Add new
Naming/RescuedExceptionsVariableNamecop. (@AdrienSldy)
Bug fixes
- #6761: Make
Naming/UncommunicativeMethodParamNameaccount for param names prefixed with underscores. (@thomthom) - #6855: Fix an exception in
Rails/RedundantReceiverInWithOptionswhen the body is empty. (@ericsullivan) - #6856: Fix auto-correction for
Style/BlockCommentswhen the file is missing a trailing blank line. (@ericsullivan) - #6858: Fix an incorrect auto-correct for
Lint/ToJSONwhen there are noto_jsonarguments. (@koic) - #6865: Fix deactivated
StyleGuideBaseURLforLayout/ClassStructure. (@aeroastro) - #6868: Fix
Rails/LinkToBlankauto-correct bug when using symbol for target. (@r7kamura) - #6869: Fix false positive for
Rails/LinkToBlankwhen rel is a symbol value. (@r7kamura) - Add
IncludedMacrosparam to default rubocop config forStyle/MethodCallWithArgsParentheses. (@maxh) - #6785: Do not register an offense for
Rails/PresentorRails/Blankin anunless elsecontext whenStyle/UnlessElseis enabled. (@rrosenblum)
Changes
- #6854: Mark Rails/LexicallyScopedActionFilter as unsafe and document risks. (@urbanautomaton)
- #5977: Warn for Performance Cops. (@koic)
- #6637: Move
LstripRstripfromPerformancetoStyledepartment and rename it toStrip. (@anuja-joshi) - #6875: Mention block form of
Struct.newinStyle/StructInheritance. (@XrXr) - #6871: Move
Performance/RedundantSortBy,Performance/UnneededSortandPerformance/Sampleto the Style department. (@bbatsov)
- Ruby
Published by bbatsov almost 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.66
New features
- #6393: Add
AllowBracesOnProceduralOneLinersoption to fine-tuneStyle/BlockDelimiter's semantic mode. (@davearonson) - #6383: Add
AllowBeforeTrailingCommentsoption onLayout/ExtraSpacingcop. (@davearonson) - New cop
Lint/SafeNavigationWithEmptychecks forfoo&.empty?in conditionals. (@rspeicher) - Add new
Style/ConstantVisibilitycop for enforcing visibility declarations of class and module constants. (@drenmi) - #6378: Add
Lint/ToJSONcop to enforce an argument when overriding#to_json. (@allcentury) - #6346: Add auto-correction to
Rails/TimeZone. (@dcluna) - #6840: Node patterns now allow unlimited elements after
.... (@marcandre)
Bug fixes
- #4321: Fix false offense for
Style/RedundantSelfwhen the method is also defined onKernel. (@mikegee) - #6821: Fix false negative for
Rails/LinkToBlankwhen_blankis a symbol. (@Intrepidd) - #6699: Fix infinite loop for
Layout/IndentationWidthandLayout/IndentationConsistencywhen bad modifier indentation before good method definition. (@koic) - #6777: Fix a false positive for
Style/TrivialAccessorswhen using trivial reader/writer methods at the top level. (@koic) - #6799: Fix errors for
Style/ConditionalAssignment,Style/IdenticalConditionalBranches,Lint/ElseLayout, andLayout/IndentationWidthwith empty braces. (@pocke) - #6802: Fix auto-correction for
Style/SymbolArraywith array contains interpolation whenEnforcedStyleisbrackets. (@pocke) - #6797: Fix false negative for Layout/SpaceAroundBlockParameters on block parameter with parens. (@pocke)
- #6798: Fix infinite loop for
Layout/SpaceAroundBlockParameterswithEnforcedStyleInsidePipes: :space. (@pocke) - #6803: Fix error for
Style/NumericLiteralson a literal that contains spaces. (@pocke) - #6801: Fix auto-correction for
Style/Lambdawith no-space argument. (@pocke) - #6804: Fix auto-correction of
Style/NumericLiteralson numeric literal with exponent. (@pocke) - #6800: Fix an incorrect auto-correct for
Rails/Validationwhen method arguments are enclosed in parentheses. (@koic) - #6808: Prevent false positive in
Naming/ConstantNamewhen assigning a frozen range. (@drenmi) - Fix the calculation of
Metrics/AbcSize. Comparison methods andelsebranches add to the comparison count. (@rrosenblum) - #6791: Allow
Rails/ReflectionClassNameto use symbol argument forclass_name. (@unasuke) - #5465: Fix
Layout/ClassStructureto allow grouping macros by their visibility. (@gprado) - #6461: Restrict
Ctrl-Chandling to RuboCop's loop and simplify it to a single phase. (@deivid-rodriguez)
Changes
- Add
$stdout/$stderrandSTDOUT/STDERRmethod calls toRails/Output. (@elebow) - #6688: Add
iterator?to deprecated methods and preferblock_given?instead. (@tejasbubane) - #6806: Remove
powerpackdependency. (@dduugg) - #6810: Exclude gemspec file by default for
Metrics/BlockLengthcop. (@koic) - #6813: Allow unicode/display_width dependency version 1.5.0. (@tagliala)
- Make
Style/RedundantFreezeaware of methods that will produce frozen objects. (@rrosenblum) - #6675: Avoid printing deprecation warnings about constants. (@elmasantos)
- #6746: Avoid offense on
$stderr.putswith no arguments. (@luciamo) - Replace md5 with sha1 for FIPS compliance. (@dirtyharrycallahan)
- Ruby
Published by bbatsov almost 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.65
New features
- #6126: Add an experimental strict mode to
Style/MutableConstantthat will freeze all constants, rather than just literals. (@rrosenblum)
Bug fixes
- #6765: Fix false positives in keyword arguments for
Style/MethodCallWithArgsParenthesesomit_parentheses. (@gsamokovarov) - #6763: Fix false positives in range literals for
Style/MethodCallWithArgsParenthesesomit_parentheses. (@gsamokovarov) - #6748: Fix
Style/RaiseArgsauto-correction breaking in contexts that require parentheses. (@drenmi) - #6751: Prevent
Style/OneLineConditionalfrom breaking onretryandbreakkeywords. (@drenmi) - #6755: Prevent
Style/TrailingCommaInArgumentfrom breaking when a safe method call is chained on the offending method. (@drenmi, @hoshinotsuyoshi)
Changes
- #6766: Drop support for Ruby 2.2.0 and 2.2.1. (@pocke)
- #6733: Warn duplicated keys in
.rubocop.yml. (@pocke) - #6613: Mark
Style/ModuleFunctionasSafeAutocorrect: falseand disable autocorrect by default. (@dduugg)
- Ruby
Published by Drenmi about 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.64
New features
- #6704: Add new
Rails/ReflectionClassNamecop. (@Bhacaz) - #6643: Support
AllowParenthesesInCamelCaseMethodoption onStyle/MethodCallWithArgsParenthesesomit_parentheses. (@dazuma)
Bug fixes
- #6254: Fix
Layout/RescueEnsureAlignmentfor non-local assignments. (@marcotc) - #6648: Fix auto-correction of
Style/EmptyLiteralwhenHash.newis passed as the first argument tosuper. (@rrosenblum) - #6351: Fix a false positive for
Layout/ClosingParenthesisIndentationwhen first argument is multiline. (@antonzaytsev) - #6689: Support more complex argument patterns on
Rails/Validationauto-correction. (@r7kamura) - #6668: Fix autocorrection for
Style/UnneededConditionwhen conditional has theunlessform. (@mvz) - #6382: Fix
Layout/IndentationWidthwithLayout/EndAlignmentset to start_of_line. (@dischorde, @siegfault, @mhelmetag) - #6710: Fix
Naming/MemoizedInstanceVariableNameon method starts with underscore. (@pocke) - #6722: Fix an error for
Style/OneLineConditionalwhenthenbranch has no body. (@koic) - #6702: Fix
TrailingCommaregression where heredoc with commas caused false positives. (@abrom) - #6737: Fix an incorrect auto-correct for
Rails/LinkToBlankwhenlink_tomethod arguments are enclosed in parentheses. (@koic) - #6720: Fix detection of
:nativeline ending forLayout/EndOfLineon JRuby. (@enkessler)
Changes
- #6597:
Style/LineEndConcatenationis now known to be unsafe for auto-correct. (@jaredbeck) - #6725: Mark
Style/SymbolProcas unsafe for auto-correct. (@drenmi) - #6708: Make
Style/CommentedKeywordallow the:yields:RDoc comment. (@bquorning) - #6749: Make some cops aware of safe navigation operator. (@hoshinotsuyoshi)
- Ruby
Published by Drenmi about 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.63.1
Bug fixes
- #6678: Fix
Lint/DisjunctiveAssignmentInConstructorwhen it finds an empty constructor. (@rmm5t) - Do not attempt to auto-correct mass assignment or optional assignment in
Rails/RelativeDateConstant. (@rrosenblum) - Fix auto-correction of
Style/WordArrayandStyle/SymbolArraywhen all elements are on separate lines and there is a trailing comment after the closing bracket. (@rrosenblum) - Fix an exception that occurs when auto-correcting
Layout/ClosingParenthesesIndentationwhen there are no arguments. (@rrosenblum)
- Ruby
Published by Drenmi about 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.63
New features
- #6604: Add auto-correct support to
Rails/LinkToBlank. (@Intrepidd) - #6660: Add new
Rails/IgnoredSkipActionFilterOptioncop. (@wata727) - #6363: Allow
Style/YodaConditioncop to be configured to enforce yoda conditions. (@tejasbubane) - #6150: Add support to enforce disabled cops to be executed. (@roooodcastro)
- #6596: Add new
Rails/BelongsTocop with auto-correct for Rails >= 5. (@petehamilton)
Bug fixes
- #6627: Fix handling of hashes in trailing comma. (@abrom)
- #6623: Fix heredoc detection in trailing comma. (@palkan)
- #6100: Fix a false positive in
Naming/ConstantNamecop when rhs is a conditional expression. (@tatsuyafw) - #6526: Fix a wrong line highlight in
Lint/ShadowedExceptioncop. (@tatsuyafw) - #6617: Prevent traversal error on infinite ranges. (@drenmi)
- #6625: Revert the "auto-exclusion of files ignored by git" feature. (@bbatsov)
- #4460: Fix the determination of unsafe auto-correct in
Style/TernaryParentheses. (@jonas054) - #6651: Fix auto-correct issue in
Style/RegexpLiteralcop when there is string interpolation. (@roooodcastro) - #6670: Fix a false positive for
Style/SafeNavigationwhen a method call safeguarded with a negative check for the object. (@koic) - #6633: Fix
Lint/SafeNavigationcomplaining about use ofto_d. (@tejasbubane) - #6575: Fix
Naming/PredicateNamesuggesting invalid rename. (@tejasbubane) - #6673: Fix
Style/DocumentationMethodcop to recognize documentation comments fordefinline withmodule_function. (@tejasbubane)
Changes
- #6607: Improve CLI usage message for --stdin option. (@jaredbeck)
- #6641: Specify
Performance/RangeIncludeas unsafe becauseRange#include?andRange#cover?are not equivalent. (@koic) - #6636: Move
FlipFlopcop fromStyletoLintdepartment because flip-flop is deprecated since Ruby 2.6.0. (@koic) - #6661: Abandon making frozen string literals default for Ruby 3.0. (@koic)
- Ruby
Published by bbatsov about 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.61.1
Bug fixes
- Ruby
Published by bbatsov about 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.62
New features
- #6580: New cop
Rails/LinkToBlankchecks forlink_tocalls withtarget: '_blank'and norel: 'noopener'. (@Intrepidd)
Bug fixes
- #6560: Consider file count, not offense count, for
--exclude-limitin combination with--auto-gen-only-exclude. (@jonas054) - #4229: Fix unexpected Style/HashSyntax consistency offence. (@timon)
- #6500: Add offense to use
in_time_zoneinstead of deprecatedto_time_in_current_zone. (@nadiyaka) - #6577: Prevent Rails/Blank cop from adding offense when define the blank method. (@jonatas)
- #6554: Prevent Layout/RescueEnsureAlignment cop from breaking on block assignment when assignment is on a separate line. (@timmcanty)
- #6343: Optimise
--auto-gen-configwhenMetrics/LineLengthcop is disabled. (@tom-lord) - #6389: Fix false negative for
Style/TrailingCommaInHashLiteral/Style/TrailingCommaInArrayLiteralwhen there is a comment in the last line. (@bayandin) - #6566: Fix false positive for
Layout/EmptyLinesAroundAccessModifierwhen at the end of specifying a superclass is missing blank line. (@koic) - #6571: Fix a false positive for
Layout/TrailingCommaInArgumentswhen a line break before a method call andEnforcedStyleForMultilineis set toconsistent_comma. (@koic) - #6573: Make
Layout/AccessModifierIndentationwork for dynamic module or class definitions. (@deivid-rodriguez) - #6562: Fix a false positive for
Style/MethodCallWithArgsParenthesesomit_parenthesesenforced style after safe navigation call. (@gsamokovarov) - #6570: Fix a false positive for
Style/MethodCallWithArgsParenthesesomit_parenthesesenforced style while splatting the result of a method invocation. (@gsamokovarov) - #6598: Fix a false positive for
Style/MethodCallWithArgsParenthesesomit_parenthesesenforced style for calls with regexp slash literals argument. (@gsamokovarov) - #6598: Fix a false positive for
Style/MethodCallWithArgsParenthesesomit_parenthesesenforced style for default argument value calls. (@gsamokovarov) - #6598: Fix a false positive for
Style/MethodCallWithArgsParenthesesomit_parenthesesenforced style for argument calls with braced blocks. (@gsamokovarov) - #6594: Fix a false positive for
Rails/OutputSafetywhen the receiver is a non-interpolated string literal. (@amatsuda) - #6574: Fix
Style/AccessModifierIndentationnot handling arbitrary blocks. (@deivid-rodriguez) - #6370: Fix the enforcing style from
extend selfintomodule_functionwhen there are private methods. (@Ruffeng)
Changes
- #595: Exclude files ignored by
git. (@AlexWayfer) - #6429: Fix autocorrect in Rails/Validation to not wrap hash options with braces in an extra set of braces. (@bquorning)
- #6533: Improved warning message for unrecognized cop parameters to include Supported parameters. (@MagedMilad)
- Ruby
Published by bbatsov about 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.61
New features
- #6457: Support inner slash correction on
Style/RegexpLiteral. (@r7kamura) - #6475: Support brace correction on
Style/Lambda. (@r7kamura) - #6469: Enforce no parentheses style in the
Style/MethodCallWithArgsParenthesescop. (@gsamokovarov) - New cop
Performance/OpenStructchecks forOpenStruct.newcalls. (@xlts)
Bug fixes
- #6433: Fix Ruby 2.5
Layout/RescueEnsureAlignmenterror on assigned blocks. (@gmcgibbon) - #6405: Fix a false positive for
Lint/UselessAssignmentwhen using a variable in a module name. (@itsWill) - #5934: Handle the combination of
--auto-gen-configand--config FILEcorrectly. (@jonas054) - #5970: Make running
--auto-gen-configin a subdirectory work. (@jonas054) - #6412: Fix an
unknown keywordserror when usingPsych.safe_loadwith Ruby 2.6.0-preview2. (@koic) - #6436: Fix exit status code to be 130 when rubocop is interrupted. (@deivid-rodriguez)
- #6443: Fix an incorrect autocorrect for
Style/BracesAroundHashParameterswhen the opening brace is before the first hash element at same line. (@koic) - #6445: Treat
yieldandsuperlike regular method calls inStyle/AlignHash. (@mvz) - #3301: Don't suggest or make semantic changes to the code in
Style/InfiniteLoop. (@jonas054) - #3586: Handle single argument spanning multiple lines in
Style/TrailingCommaInArguments. (@jonas054) - #6478: Fix EmacsComment#encoding to match the
codingvariable. (@akihiro17) - Don't show "unrecognized parameter" warning for
inherit_modeparameter to individual cop configurations. (@maxh) - #6449: Fix a false negative for
Layout/IndentationWidthwhen settingEnforcedStyle: railsofLayout/IndentationConsistencyand method definition indented to access modifier in a singleton class. (@koic) - #6482: Fix a false positive for
Lint/FormatParameterMismatchwhen using (digit)$ flag. (@koic) - #6489: Fix an error for
Style/UnneededConditionwhenifcondition andthenbranch are the same and it has noelsebranch. (@koic) - Fix NoMethodError for
Style/FrozenStringLiteralwhen a file contains only a shebang. (@takaram) - #6511: Fix an incorrect auto-correct for
Style/EmptyCaseConditionwhen used as an argument of a method. (@koic) - #6509: Fix an incorrect auto-correct for
Style/RaiseArgswhen an exception object is assigned to a local variable. (@koic) - #6534: Fix a false positive for
Lint/UselessAccessModifierwhen usingprivate_class_method. (@dduugg) - #6545: Fix a regression where
Performance/RedundantMergeraises an error on a sole double splat argument passed tomerge!. (@mmedal) - #6360: Detect bad indentation in
ifnodes even if the first branch is empty. (@bquorning)
Changes
- #6492: Auto-correct chunks of comment lines in
Layout/CommentIndentationto avoid unnecessary iterations forrubocop -a. (@jonas054)
- Ruby
Published by bbatsov over 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.60
New features
- #5980: Add
--safeand--safe-auto-correctoptions. (@Darhazer) - #4156: Add command line option
--auto-gen-only-exclude. (@Ana06, @jonas054) - #6386: Add
VersionAddedmeta data to config/default.yml when runningrake new_cop. (@koic) - #6395: Permit to specify TargetRubyVersion 2.6. (@koic)
- #6392: Add
Whitelistconfig toRails/SkipsModelValidationsrule. (@DiscoStarslayer)
Bug fixes
- #6330: Fix an error for
Rails/ReversibleMigrationwhen using variable assignment. (@koic, @scottmatthewman) - #6331: Fix a false positive for
Style/RedundantFreezeand a false negative forStyle/MutableConstantwhen assigning a regexp object to a constant. (@koic) - #6334: Fix a false negative for
Style/RedundantFreezewhen assigning a range object to a constant. (@koic) - #5538: Fix false negatives in modifier cops when line length cop is disabled. (@drenmi)
- #6340: Fix an error for
Rails/ReversibleMigrationwhen block argument is empty. (@koic) - #6274: Fix "[Corrected]" message being displayed even when nothing has been corrected. (@jekuta)
- #6380: Allow use of a hyphen-separated frozen string literal in Emacs style magic comment. (@y-yagi)
- Fix and improve
LineLengthcop for tab-indented code. (@AlexWayfer)
Changes
- #3727: Enforce single spaces for
keyoption inLayout/AlignHashcop. (@albaer) - #6321: Fix run of RuboCop when cache directory is not writable. (@Kevinrob)
- Ruby
Published by bbatsov over 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.59.2
Bug fixes
- #6266: Fix a false positive for
Rails/HasManyOrHasOneDependentwhen using associations of Active Resource. (@tejasbubane, @koic) - #6296: Fix an auto-correct error for
Style/Forwhen settingEnforcedStyle: eachandfordose not havedoor semicolon. (@autopp) - #6300: Fix a false positive for
Layout/EmptyLineAfterGuardClausewhen guard clause including heredoc. (@koic) - #6287: Fix
AllowURIoption forMetrics/LineLengthcop with disabledLayut/Tabcop. (@AlexWayfer) - #5338: Move checking of class- and module defining blocks from
Metrics/BlockLengthinto the respective length cops. (@drenmi) - #2841: Fix
Style/ZeroLengthPredicatefalse positives when inspectingTempfile,StringIO, andFile::Statobjects. (@drenmi) - #6305: Fix infinite loop for
Layout/EmptyLinesAroundAccessModifierandLayout/EmptyLinesAroundAccessModifierwhen specifying a superclass that breaks the line. (@koic) - #6007: Fix false positive in
Style/IfUnlessModifierwhen using named capture. (@drenmi) - #6311: Prevent
Style/Semicolonfrom breaking on single line if-then-else in assignment. (@drenmi) - #6315: Fix an error for
Rails/HasManyOrHasOneDependentwhen an Active Record model does not have any relations. (@koic) - #6316: Fix an auto-correct error for
Style/Forwhen settingEnforcedStyle: eachwith range provided to theforloop without adokeyword or semicolon and without enclosing parenthesis. (@lukasz-wojcik)
Changes
- Ruby
Published by bbatsov over 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.59.1
Bug fixes
- #6267: Fix undefined method 'method_name' for
Rails/FindEach. (@Knack) - #6278: Fix false positive for
Naming/FileNamewhen investigating gemspecs. (@kddeisz) - #6256: Fix false positive for
Naming/FileNamewhen investigating dotfiles. (@sinsoku) - #6242: Fix
Style/EmptyCaseConditionauto-correction removes comment betweencaseand firstwhen. (@koic) - #6261: Fix undefined method error for
Style/RedundantBeginwhen callingsuperwith a block. (@eitoball) - #6263: Fix an error
Layout/EmptyLineAfterGuardClausewhen guard clause is after heredoc including string interpolation. (@koic) - #6281: Fix false negative in
Style/MultilineMethodSignature. (@drenmi) - #6264: Fix an incorrect autocorrect for
Layout/EmptyLineAfterGuardClausecop whenifcondition is after heredoc. (@koic)
Changes
- #6272: Make
Lint/UnreachableCodedetectexit,exit!andabort. (@hoshinotsuyoshi) - #6295: Exclude
#===fromNaming/BinaryOperatorParameterName. (@zverok) - Add
+to allowed file names ofNaming/FileName. (@yensaki)
- Ruby
Published by bbatsov over 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.59.0
New features
- #6109: Add new
Bundler/GemCommentcop. (@sunny) - #6148: Add
IgnoredMethodsoption toStyle/NumericPredicatecop. (@AlexWayfer) - #6174: Add
--display-only-fail-level-offensesto only output offenses at or above the fail level. (@robotdana) - Add autocorrect to
Style/For. (@rrosenblum) - #6173: Add
AllowImplicitReturnoption toRails/SaveBangcop. (@robotdana) - #6218: Add
comparisonstyle toStyle/NilComparison. (@khiav223577) - Add new
Style/MultilineMethodSignaturecop. (@drenmi) - #6234: Add
Performance/ChainArrayAllocationcop. (@schneems) - #6136: Add remote url in remote url download error message. (@ShockwaveNN)
- #5659: Make
Layout/EmptyLinesAroundClassBodyaware of specifying a superclass that breaks the line. (@koic)
Bug fixes
- #6107: Fix indentation of multiline postfix conditionals. (@jaredbeck)
- #6140: Fix
Style/DateTimenot detecting#to_datetime. It can be configured to allow this. (@bdewater) - #6132: Fix a false negative for
Naming/FileNamewhenIncludeofAllCopsis the default setting. (@koic) - #4115: Fix false positive for unary operations in
Layout/MultilineOperationIndentation. (@jonas054) - #6127: Fix an error for
Layout/ClosingParenthesisIndentationwhen method arguments are empty with newlines. (@tatsuyafw) - #6152: Fix a false negative for
Layout/AccessModifierIndentationwhen using access modifiers with arguments within nested classes. (@gmalette) - #6124: Fix
Style/IfUnlessModifiercop for disabledLayout/Tabcop when there is noIndentationWidthconfig. (@AlexWayfer) - #6133: Fix
AllowURIoption ofMetrics/LineLengthcop for files with tabs indentation. (@AlexWayfer) - #6164: Fix incorrect autocorrect for
Style/UnneededConditionwhen using operator method higher precedence than||. (@koic) - #6138: Fix a false positive for assigning a block local variable in
Lint/ShadowedArgument. (@jonas054) - #6022: Fix
Layout/MultilineHashBraceLayoutandLayout/MultilineArrayBraceLayoutauto-correct syntax error when there is a comment on the last element. (@bacchir) - #6175: Fix
Style/BracesAroundHashParametersauto-correct syntax error when there is a trailing comma. (@bacchir) - #6192: Make
Style/RedundantBeginaware of stabby lambdas. (@drenmi) - #6208: Ignore assignment methods in
Naming/PredicateName. (@sunny) - #6196: Fix incorrect autocorrect for
Style/EmptyCaseConditionwhen usingreturninwhenclause and assigning the return value ofcase. (@koic) - #6142: Ignore keyword arguments in
Rails/Delegate. (@sunny) - #6240: Fix an auto-correct error for
Style/WordArraywhen settingEnforcedStyle: bracketsand using string interpolation in%Wliteral. (@koic) - #6202: Fix infinite loop when auto-correcting
Lint/RescueEnsureAlignmentwhenendis misaligned. The alignment and message are now based on the beginning position rather than theendposition. (@rrosenblum) - #6199: Don't recommend
Dateusage inStyle/DateTime. (@deivid-rodriguez)
Changes
- #6161: Add scope methods to
Rails/FindEachcop. Makes the cop also check for the following scopes:eager_load,includes,joins,left_joins,left_outer_joins,preload,references, andunscoped. (@repinel) - #6137: Allow
dbto allowed names ofNaming/UncommunicativeMethodParamNamecop in default config. (@mkenyon) - Update the highlighting of
Lint/DuplicateMethodsto include the method name. (@rrosenblum) - #6057: Return 0 when running
rubocop --auto-gen-confif the todo file is successfully created even if there are offenses. (@MagedMilad) - #4301: Turn off autocorrect for
Rails/RelativeDateConstantby default. (@koic) - #4832: Change the path pattern (
*) to match the hidden file. (@koic) Style/Fornow highlights the entire statement rather than just the keyword. (@rrosenblum)- Disable
Performance/CaseWhenSplatand its auto-correction by default. (@rrosenblum) - #6235: Enable
Layout/EmptyLineAfterGuardClausecop by default. (@koic) - #6199:
Style/DateTimehas been moved to disabled by default. (@deivid-rodriguez)
- Ruby
Published by bbatsov over 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.58.2
Changes
New features
-
#6105: Support
{a,b}file name globs inExcludeandIncludeconfig. (@mikeyhew) -
#6116: Add
ipto allowed names ofNaming/UncommunicativeMethodParamNamecop in default config. (@nijikon)
Bug fixes
- #6103: Fix a false positive for
Layout/IndentationWidthwhen multiple modifiers are used in a block and a method call is made at end of the block. (@koic) - #6084: Fix
Naming/MemoizedInstanceVariableNamecop to allow methods to have leading underscores. (@kenman345) - #6098: Fix an error for
Layout/ClassStructurewhen there is a comment in the macro method to be auto-correct. (@koic) - #6115: Fix a false positive for
Lint/OrderedMagicCommentswhen using{ encoding: Encoding::SJIS }hash object afterfrozen_string_literalmagic comment. (@koic)
- Ruby
Published by bbatsov over 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.58.1
Bug fixes
- #6071: Fix auto-correct
Style/MethodCallWithArgsParentheseswhen arguments are method calls. (@maxh) - Fix
Style/RedundantParentheseswith hash literal as first argument tosuper. (@maxh) - #6086: Fix an error for
Gemspec/OrderedDependencieswhen using method call to gem names in gemspec. (@koic) - #6089: Make
Rails/BulkChangeTableaware of variable table name. (@wata727) - #6088: Fix an error for
Layout/MultilineAssignmentLayoutcop when using multi-line block defines on separate lines. (@koic) - #6092: Don't use the broken parser 2.5.1.1 version. (@bbatsov)
- Ruby
Published by bbatsov over 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.58
New features
- #5973: Add new
Style/IpAddressescop. (@dvandersluis) - #5843: Add configuration options to
Naming/MemoizedInstanceVariableNamecop to allow leading underscores. (@leklund) - #5843: Add
EnforcedStyleForLeadingUnderscorestoNaming/MemoizedInstanceVariableNamecop to allow leading underscores. (@leklund) Performance/Samplewill now register an offense when usingshufflefollowed byatorslice. (@rrosenblum)
Bug fixes
- #5987: Suppress errors when using ERB template in Rails/BulkChangeTable. (@wata727)
- #4878: Fix false positive in
Layout/IndentationWidthwhen multiple modifiers and def are on the same line. (@tatsuyafw) - #5966: Fix a false positive for
Layout/ClosingHeredocIndentationwhen heredoc content is outdented compared to the closing. (@koic) - Fix auto-correct support check for custom cops on --auto-gen-config. (@r7kamura)
- Fix exception that occurs when auto-correcting a modifier if statement in
Style/UnneededCondition. (@rrosenblum) - #6025: Fix an incorrect auto-correct for
Lint/UnneededConditionwhen using if_branch inelsebranch. (@koic) - #6029: Fix a false positive for
Lint/ShadowedArgumentwhen reassigning to splat variable. (@koic) - #6035: Fix error on autocorrection when
Layout/LeadingBlankLinesis the first cop to act. (@Vasfed) - #6036: Make
Rails/BulkChangeTableaware of string table name. (@wata727) - #5467: Fix a false negative for
Style/MultipleComparisonwhen multiple comparison is not part of a conditional. (@koic) - #6042: Fix
Lint/RedundantWithObjecterror on missing parameter toeach_with_object. (@Vasfed) - #6056: Support string timestamps in
Rails/CreateTableWithTimestampscop. (@drn) - #6052: Fix a false positive for
Style/SymbolProcwhen using block with adding a comma after the sole argument. (@koic) - #2743: Support
<<as a kind of assignment operator inLayout/EndAlignment. (@jonas054) - #6067: Prevent auto-correct error for
Performance/InefficientHashSearchwhen a method by itself andinclude?method are method chaining. (@koic)
Changes
- #6006: Remove
rake repltask. (@koic) - #5990: Drop support for MRI 2.1. (@drenmi)
- #3299:
Lint/UselessAccessModifiernow warns whenprivate_class_methodis used without arguments. (@Darhazer) - #6026: Exclude
refineby default fromMetrics/BlockLengthcop. (@kddeisz) - #4882: Use
IndentationWidthofLayout/Tabfor other cops. (@AlexWayfer)
- Ruby
Published by bbatsov over 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.57.2
Bug fixes
- #5968: Prevent
Layout/ClosingHeredocIndentationfrom raising an error on<<heredocs. (@dvandersluis) - #5965: Prevent
Layout/ClosingHeredocIndentationfrom raising an error on heredocs containing only a newline. (@drenmi) - Prevent a crash in
Layout/IndentationConsistencycop triggered by an empty expression string interpolation. (@alexander-lazarov) - #5951: Prevent
Style/MethodCallWithArgsParenthesesfrom raising an error in certain cases. (@drenmi)
- Ruby
Published by bbatsov over 7 years ago
https://github.com/rubocop/rubocop - RuboCop 0.57.1
Bug fixes
- #5963: Allow Performance/ReverseEach to apply to any receiver. (@dvandersluis)
- #5917: Fix erroneous warning for
inherit_modedirective. (@jonas054) - #5380: Fix false negative in
Layout/IndentationWidthwhen an access modifier section has an invalid indentation body. (@tatsuyafw) - #5909: Even when a module has no public methods,
Layout/IndentationConsistencyshould still register an offense for private methods. (@jaredbeck) - #5958: Handle empty method body in
Rails/BulkChangeTable. (@wata727) - #5954: Make
Style/UnneededConditioncop accepts a case of condition andif_branchare same when usingelsifbranch. (@koic)
- Ruby
Published by bbatsov almost 8 years ago
https://github.com/rubocop/rubocop - RuboCop 0.57
New features
- #5881: Add new
Rails/BulkChangeTablecop. (@wata727) - #5444: Add new
Style/AccessModifierDeclarationscop. (@brandonweiss) - #5803: Add new
Style/UnneededConditioncop. (@balbesina) - #5406: Add new
Layout/ClosingHeredocIndentationcop. (@siggymcfried) - #5823: Add new
slashesstyle toRails/FilePathsince Ruby accepts forward slashes even on Windows. (@sunny) - New cop
Layout/LeadingBlankLineschecks for empty lines at the beginning of a file. (@rrosenblum)
Bug fixes
- #5897: Fix
Style/SymbolArrayandStyle/WordArraynot working on arrays of size 1. (@TikiTDO) - #5894: Fix
Rails/AssertNotto allow it to have failure message. (@koic) - #5888: Do not register an offense for
headersorenvkeyword arguments inRails/HttpPositionalArguments. (@rrosenblum) - Fix the indentation of autocorrected closing squiggly heredocs. (@garettarrowood)
- #5908: Fix
Style/BracesAroundHashParametersauto-correct going past the end of the file when the closing curly brace is on the last line of a file. (@EiNSTeiN-) - Fix a bug where
Style/FrozenStringLiteralCommentwould be added to the second line if the first line is empty. (@rrosenblum) - #5914: Make
Layout/SpaceInsideReferenceBracketsaware ofno_spacewhen using nested reference brackets. (@koic) - #5799: Fix false positive in
Style/MixinGroupingwhen method namedincludeaccepts block. (@Darhazer)
Changes
- #5937: Add new
--fix-layout/-xcommand line alias. (@scottmatthewman) - #5887: Remove
Lint/SplatKeywordArgumentscop. (@koic) - #5761: Add
httpdateto acceptedRails/TimeZonemethods. (@cupakromer) - #5899: Add
xmlschemato acceptedRails/TimeZonemethods. (@koic) - #5906: Move REPL command from
rake repltask tobin/consolecommand. (@koic) - #5917: Let
inherit_modework for default configuration too. (@jonas054) - #5929: Stop including string extensions from
unicode/display_width. (@nroman-stripe)
- Ruby
Published by bbatsov almost 8 years ago
https://github.com/rubocop/rubocop - RuboCop 0.56
New features
- #5848: Add new
Performance/InefficientHashSearchcop. (@JacobEvelyn) - #5801: Add new
Rails/RefuteMethodscop. (@koic) - #5805: Add new
Rails/AssertNotcop. (@composerinteralia) - #4136: Allow more robust
Layout/ClosingParenthesisIndentationdetection including method chaining. (@jfelchner) - #5699: Add
consistent_relative_to_receiverstyle option toLayout/FirstParameterIndentation. (@jfelchner) - #5821: Support
AR::Migration#up_onlyforRails/ReversibleMigrationcop. (@koic) - #5800: Don't show a stracktrace for invalid command-line params. (@shanecav84)
- #5845: Add new
Lint/ErbNewArgumentscop. (@koic) - #5871: Add new
Lint/SplatKeywordArgumentscop. (@koic) - #4247: Remove hard-coded file patterns and use only
Include,Excludeand the newRubyInterpretersparameters for file selection. (@jonas054)
Bug fixes
- Fix bug in
Style/EmptyMethodwhich concatenated the method name and first argument if no method def parentheses are used. (@thomasbrus) - #5819: Fix
Rails/SaveBangwhen using negated if. (@Edouard-chin) - #5286: Fix
Lint/SafeNavigationChainnot detecting chained operators after block. (@Darhazer) - Fix bug where
Lint/SafeNavigationConsistencyregisters multiple offenses for the same method call. (@rrosenblum) - #5713: Fix
Style/CommentAnnotationreporting only the first of multiple consecutive offending lines. (@svendittmer) - #5791: Fix exception in
Lint/SafeNavigationConsistencywhen there is code around the condition. (@rrosenblum) - #5784: Fix a false positive for
Rails/HasManyOrHasOneDependentwhen using nestedwith_options. (@koic) - #4666:
--stdinalways treats input as Ruby source irregardless of filename. (@PointlessOne) - Fix auto-correction for
Style/MethodCallWithArgsParenthesesadding extra parentheses if the method argument was already parenthesized. (@dvandersluis) - #5668: Fix an issue where files with unknown extensions, listed in
AllCops/Includewere not inspected when passing the file name as an option. (@drenmi) - #5809: Fix exception
Lint/PercentStringArrayandLint/PercentSymbolArraywhen the inspected file is binary encoded. (@akhramov) - #5840: Do not register an offense for methods that
nilresponds to inLint/SafeNavigationConsistency. (@rrosenblum) - #5862: Fix an incorrect auto-correct for
Lint/LiteralInInterpolationif contains numbers. (@koic) - #5868: Fix
Rails/CreateTableWithTimestampswhen using hash options. (@wata727) - #5708: Fix exception in
Lint/UnneededCopEnableDirectivefor instruction '# rubocop:enable all'. (@balbesina) - Fix auto-correction of
Rails/HttpPositionalArgumnetsto usesessioninstead ofheader. (@rrosenblum)
Changes
- Split
Style/MethodMissinginto two cops,Style/MethodMissingSuperandStyle/MissingRespondToMissing. (@rrosenblum) - #5757: Add
AllowInMultilineConditionsoption toStyle/ParenthesesAroundConditioncop. (@Darhazer) - #5806: Fix
Layout/SpaceInsideReferenceBracketswhen assigning a reference bracket to a reference bracket. (@joshuapinter) - #5082: Allow caching together with
--auto-correct. (@jonas054) - Add
try!to the list of whitelisted methods forLint/SafeNavigationChainandStyle/SafeNavigation. (@rrosenblum) - #5886: Move
Style/EmptyLineAfterGuardClausecop toLayoutdepartment. (@koic)
- Ruby
Published by bbatsov almost 8 years ago
https://github.com/rubocop/rubocop - RuboCop 0.55
New features
- #5753: Add new
Performance/UnneededSortcop. (@parkerfinch) - Add new
Lint/SafeNavigationConsistencycop. (@rrosenblum)
Bug fixes
- #5759: Fix
Performance/RegexpMatchcop not correcting negated match operator. (@bdewater) - #5726: Fix false positive for
:class_nameoption in Rails/InverseOf cop. (@bdewater) - #5686: Fix a regression for
Style/SymbolArrayandStyle/WordArrayfor multiline Arrays. (@istateside) - #5730: Stop
Rails/InverseOfcop allowinginverse_of: nilto opt-out. (@bdewater) - #5561: Fix
Lint/ShadowedArgumentfalse positive with shorthand assignments. (@akhramov) - #5403: Fix
Naming/HeredocDelimiterNamingblacklist patterns. (@mcfisch) - #4298: Fix auto-correction of
Performance/RegexpMatchto produce code that safe guards against the receiver beingnil. (@rrosenblum) - #5738: Make
Rails/HttpStatusignoring hash order to fix false negative. (@pocke) - #5720: Fix false positive for
Style/EmptyLineAfterGuardClausewhen guard clause is after heredoc. (@koic) - #5760: Fix incorrect offense location for
Style/EmptyLineAfterGuardClausewhen guard clause is after heredoc argument. (@koic) - #5764: Fix
Style/Unpackfirstfalse positive ofunpack('h*').take(1). (@parkerfinch) - #5766: Update
Style/FrozenStringLiteralCommentauto-correction to insert a new line between the comment and the code. (@rrosenblum) - #5551: Fix
Lint/Voidnot detecting void context in blocks with single expression. (@Darhazer)
Changes
- #5752: Add
String#delete_{prefix,suffix}to Lint/Void cop. (@bdewater) - #5734: Add
by,on,inandatto allowed names ofNaming/UncommunicativeMethodParamNamecop in default config. (@AlexWayfer) - #5666: Add spaces as an
EnforcedStyleoption toLayout/SpaceInsideParens, allowing you to enforce spaces inside of parentheses. (@joshuapinter) - #4257: Allow specifying module name in
Metrics/BlockLength'sExcludedMethodsconfiguration option. (@akhramov) - #4753: Add
IgnoredMethodsoption toStyle/MethodCallWithoutArgsParenthesescop. (@Darhazer) - #4517: Add option to allow trailing whitespaces inside heredoc strings. (@Darhazer)
- #5652: Make
Style/OptionHashaware of implicit parameter passing to super. (@Wei-LiangChew) - #5451: When using --auto-gen-config, do not ouput offenses unless the --output-offenses flag is also passed. (@drewpterry)
- Ruby
Published by bbatsov almost 8 years ago
https://github.com/rubocop/rubocop - RuboCop 0.54
New features
- #5597: Add new
Rails/HttpStatuscop. (@anthony-robin) - #5643: Add new
Style/UnpackFirstcop. (@bdewater)
Bug fixes
- #5683: Fix message for
Naming/UncommunicativeXParamNamecops. (@jlfaber) - #5680: Fix
Layout/ElseAlignmentforrescue/else/ensureinsidedo/endblocks. (@YukiJikumaru) - #5642: Fix
Style/Documentation:nodoc:for compact-style nested modules/classes. (@ojab) - #5648: Suggest valid memoized instance variable for predicate method. (@satyap)
- #5670: Suggest valid memoized instance variable for bang method. (@pocke)
- #5623: Fix
Bundler/OrderedGemswhen a group includes duplicate gems. (@colorbox) - #5633: Fix broken
--fail-fast. (@mmyoji) - #5630: Fix false positive for
Style/FormatStringTokenwhen using placeholder arguments informatmethod. (@koic) - #5651: Fix NoMethodError when specified config file that does not exist. (@onk)
- #5647: Fix encoding method of RuboCop::MagicComment::SimpleComment. (@htwroclau)
- #5619: Do not register an offense in
Style/InverseMethodswhen comparing constants with<,>,<=, or>=. If the code is being used to determine class hierarchy, the correction might not be accurate. (@rrosenblum) - #5641: Disable
Style/TrivialAccessorsauto-correction fordefwithprivate. (@pocke) - Fix bug where
Style/SafeNavigationdoes not auto-correct all chained methods resulting in aLint/SafeNavigationChainoffense. (@rrosenblum) - #5436: Allow empty kwrest args in
UncommunicativeNamecops. (@pocke) - #5674: Fix auto-correction of
Layout/EmptyCommentwhen the empty comment appears on the same line as code. (@rrosenblum) - #5679: Fix a false positive for
Style/EmptyLineAfterGuardClausewhen guard clause is beforerescueorensure. (@koic) - #5694: Match Rails versions with multiple digits when reading the TargetRailsVersion from the bundler lock files. (@roberts1000)
- #5700: Fix a false positive for
Style/EmptyLineAfterGuardClausewhen guard clause is beforeelse. (@koic) - Fix false positive in
Naming/ConstantNamewhen using conditional assignment. (@drenmi)
Changes
- #5626: Change
Naming/UncommunicativeMethodParamNameaddtoto allowed names in default config. (@unused) - #5640: Warn about user configuration overriding other user configuration only with
--debug. (@jonas054) - #5637: Fix error for
Layout/SpaceInsideArrayLiteralBracketswhen contains an array literal as an argument after a heredoc is started. (@koic) - #5610: Use
gems.lockedorGemfile.lockto determine the bestTargetRubyVersionwhen it is not specified in the config. (@roberts1000) - #5390: Allow exceptions to
Style/InlineCommentfor inline comments which enable or disable rubocop cops. (@jfelchner) - Add progress bar to offenses formatter. (@drewpterry)
- #5498: Correct
IndentHeredocmessage for Ruby 2.3 when using<<~operator with invalid indentation. (@hamada14)
- Ruby
Published by bbatsov almost 8 years ago
https://github.com/rubocop/rubocop - RuboCop 0.53.0
New features
- #3666: Add new
Naming/UncommunicativeBlockParamNamecop. (@garettarrowood) - #3666: Add new
Naming/UncommunicativeMethodParamNamecop. (@garettarrowood) - #5356: Add new
Lint/UnneededCopEnableDirectivecop. (@garettarrowood) - #5248: Add new
Lint/BigDecimalNewcop. (@koic) - Add new
Style/TrailingBodyOnClasscop. (@garettarrowood) - Add new
Style/TrailingBodyOnModulecop. (@garettarrowood) - #3394: Add new
Style/TrailingCommmaInArrayLiteralcop. (@garettarrowood) - #3394: Add new
Style/TrailingCommmaInHashLiteralcop. (@garettarrowood) - #5319: Add new
Security/Opencop. (@mame) - Add
EnforcedStyleForEmptyBracketsconfiguration toLayout/SpaceInsideReferenceBrackets.(@garettarrowood) - #5050: Add auto-correction to
Style/ModuleFunction. (@garettarrowood) - #5358:
--no-auto-gen-timestampCLI option suppresses the inclusion of the date and time it was generated in auto-generated config. (@dominicsayers) - #4274: Add new
Layout/EmptyCommentcop. (@koic) - #4477: Add new configuration directive:
inherit_modefor merging arrays. (@leklund) - #5532: Include
.axlsxfile by default. (@georf) - #5490: Add new
Lint/OrderedMagicCommentscop. (@koic) - #4008: Add new
Style/ExpandPathArgumentscop. (@koic) - #4812: Add
beginning_onlyandending_onlystyle options toLayout/EmptyLinesAroundClassBodycop. (@jmks) - #5591: Include
.arbfile by default. (@deivid-rodriguez) - #5473: Use
gems.lockedorGemfile.lockto determine the bestTargetRailsVersionwhen it is not specified in the config. (@roberts1000) - Add new
Naming/MemoizedInstanceVariableNamecop. (@satyap) - #5376: Add new
Style/EmptyLineAfterGuardClausecop. (@unkmas) - Add new
Rails/ActiveRecordAliasescop. (@elebow)
Bug fixes
- #4105: Fix
Lint/IndentationWidthwhenLint/EndAlignmentis configured withstart_of_line. (@brandonweiss) - #5453: Fix erroneous downcase in
Performance/Casecmpauto-correction. (@walinga) - #5343: Fix offense detection in
Style/TrailingMethodEndStatement. (@garettarrowood) - #5334: Fix semicolon removal for
Style/TrailingBodyOnMethodDefinitionautocorrection. (@garettarrowood) - #5350: Fix
Metric/LineLengthfalse offenses for URLs in double quotes. (@garettarrowood) - #5333: Fix
Layout/EmptyLinesAroundArgumentsfalse positives for inline access modifiers. (@garettarrowood) - #5339: Fix
Layout/EmptyLinesAroundArgumentsfalse positives for multiline heredoc arguments. (@garettarrowood) - #5383: Fix
Rails/Presencefalse detection of receiver for locally definedblank?&present?methods. (@garettarrowood) - #5314: Fix false positives for
Lint/NestedPercentLiteralwhen percent characters are nested. (@asherkach) - #5357: Fix
Lint/InterpolationCheckfalse positives on escaped interpolations. (@pocke) - #5409: Fix multiline indent for
Style/SymbolArrayandStyle/WordArrayautocorrect. (@flyerhzm) - #5393: Fix
Rails/Delegate's false positive with a method call with arguments. (@pocke) - #5348: Fix false positive for
Style/SafeNavigationwhen safe guarding more comparison methods. (@rrosenblum) - #4889: Auto-correcting
Style/SafeNavigationwill add safe navigation to all methods in a method chain. (@rrosenblum) - #5287: Do not register an offense in
Style/SafeNavigationif there is an unsafe method used in a method chain. (@rrosenblum) - #5401: Fix
Style/RedundantReturnto trigger when begin-end, rescue, and ensure blocks present. (@asherkach) - #5426: Make
Rails/InverseOfacceptinverse_of: nilto opt-out. (@wata727) - #5448: Improve
Rails/LexicallyScopedActionFilter. (@wata727) - #3947: Fix false positive for
Rails/FilePathwhen usingRails.root.joinin string interpolation of argument. (@koic) - #5479: Fix false positives for
Rails/Presencewhen using withelsif. (@wata727) - #5427: Fix exception when executing from a different drive on Windows. (@orgads)
- #5429: Detect tabs other than indentation by
Layout/Tab. (@pocke) - #5496: Fix a false positive of
Style/FormatStringTokenwith unrelatedformatcall. (@pocke) - #5503: Fix
Rails/CreateTableWithTimestampsfalse positive when usingto_procsyntax. (@wata727) - #5512: Improve
Lint/Voidto detectKernel#tapas method that ignores the block's value. (@untitaker) - #5520: Fix
Style/RedundantExceptionauto-correction does not keep parenthesization. (@dpostorivo) - #5524: Return the instance based on the new type when calls
RuboCop::AST::Node#updated. (@wata727) - #5527: Avoid behavior-changing corrections in
Style/SafeNavigation. (@jonas054) - #5539: Fix compilation error and ruby code generation when passing args to funcall and predicates. (@Edouard-chin)
- #4669: Use binary file contents for cache key so changing EOL characters invalidates the cache. (@jonas054)
- #3947: Fix false positive for
Performance::RegexpMatchwhen usingMatchDatabefore guard clause. (@koic) - #5515: Fix
Style/EmptyElseautocorrect for nested if and case statements. (@asherkach) - #5582: Fix
endalignment for variable assignment with line break after=inLayout/EndAlignment. (@jonas054) - #5602: Fix false positive for
Style/ColonMethodCallwhen using Java package namespace. (@koic) - #5603: Fix falsy offense for
Style/RedundantSelfwith pseudo variables. (@pocke) - #5547: Fix auto-correction of of
Layout/BlockEndNewlinewhen there is top level code outside of a class. (@rrosenblum) - #5599: Fix the suggestion being used by
Lint/NumberConversionto use base 10 with Integer. (@rrosenblum) - #5534: Fix
Style/EachWithObjectauto-correction leaves an empty line. (@flyerhzm)
Changes
- #5589: Remove
Performance/HashEachMethodscop as it no longer provides a performance benefit. (@urbanautomaton) - #3394: Remove
Style/TrailingCommmaInLiteralin favor of two new cops. (@garettarrowood) - Rename
Lint/UnneededDisabletoLint/UnneededCopDisableDirective. (@garettarrowood) - #5365: Add
*.gemfileto Bundler cop target. (@sue445) - #4477: Warn when user configuration overrides other user configuration. (@jonas054)
- #5240: Make
Style/StringHashKeysto accepts environment variables. (@pocke) - #5395: Always exit 2 when specified configuration file does not exist. (@pocke)
- #5402: Remove undefined
ActiveSupport::TimeZone#strftimemethod from defined dangerous methods ofRails/TimeZonecop. (@koic) - #4704: Move
Lint/EndAlignment,Lint/DefEndAlignment,Lint/BlockAlignment, andLint/ConditionPositionto theLayoutnamespace. (@bquorning) - #5283: Change file path output by
Formatter::JSONFormatterfrom relative path to smart path. (@koic) Style/SafeNavigationwill now register an offense for methods thatnilresponds to. (@rrosenblum)- #5542: Exclude
.git/by default. (@pocke) - Tell Read the Docs to build downloadable docs. (@eostrom)
- Change
Style/SafeNavigationto no longer register an offense for method chains exceeding 2 methods. (@rrosenblum) - Remove auto-correction from
Lint/SafeNavigationChain. (@rrosenblum) - Change the highlighting of
Lint/SafeNavigationChainto highlight the entire method chain beyond the safe navigation portion. (@rrosenblum)
- Ruby
Published by bbatsov about 8 years ago
https://github.com/rubocop/rubocop - RuboCop 0.52.1
Bug fixes
- #5241: Fix an error for
Layout/AlignHashwhen using a hash including only a keyword splat. (@wata727) - #5245: Make
Style/FormatStringTokento allow regexp token. (@pocke) - #5224: Fix false positives for
Layout/EmptyLinesAroundArgumentsoperating on blocks. (@garettarrowood) - #5234: Fix a false positive for
Rails/HasManyOrHasOneDependentwhen usingclass_nameoption. (@koic) - #5273: Fix
Style/EvalWithLocationreporting bad line offset. (@pocke) - #5228: Handle overridden
Metrics/LineLength:Maxfor--auto-gen-config. (@jonas054) - #5226: Suppress false positives for
Rails/RedundantReceiverInWithOptionswhen including another receiver inwith_options. (@wata727) - #5259: Fix false positives in
Style/CommentedKeyword. (@garettarrowood) - #5238: Fix error when #present? or #blank? is used in if or unless modifier. (@eitoball)
- #5261: Fix a false positive for
Style/MixinUsagewhen using inside class or module. (@koic) - #5289: Fix
Layout/SpaceInsideReferenceBracketsandLayout/SpaceInsideArrayLiteralBracketsconfiguration conflicts. (@garettarrowood) - #4444: Fix
Style/AutoResourceCleanupshouldn't flagFile.open(...).close. (@dpostorivo) - #5278: Fix deprecation check to use
loaded_pathin warning. (@chrishulton) - #5293: Fix a regression for
Rails/HasManyOrHasOneDependentwhen using a option ofhas_manyorhas_oneassociation. (@koic) - #5223: False offences in :unannotated Style/FormatStringToken. (@nattfodd)
- #5258: Fix incorrect autocorrection for
Rails/Presencewhen the else block is multiline. (@wata727) - #5297: Improve inspection for
Rails/InverseOfwhen includingthroughorpolymorphicoptions. (@wata727) - #5281: Fix issue where
--auto-gen-configmight fail on invalid YAML. (@bquorning) - #5313: Fix
Style/HashSyntaxfrom stripping quotes off of symbols during autocorrection for ruby22+. (@garettarrowood) - #5315: Fix a false positive of
Layout/RescueEnsureAlignmentin Ruby 2.5. (@pocke) - #5236: Fix false positives for
Rails/InverseOfwhen usingwith_options. (@wata727) - #5291: Fix multiline indent for
Style/BracesAroundHashParametersautocorrect. (@flyerhzm) - #3318: Look for
.ruby-versionin parent directories. (@ybiquitous)
Changes
- #5300: Display correction candidate if an incorrect cop name is given. (@yhirano55)
- #5233: Remove
Style/ExtendSelfcop. (@pocke) - #5221: Change
Layout/SpaceBeforeBlockBraces'sEnforcedStyleForEmptyBracesfromno_spacetospace. (@garettarrowood) - #3558: Create
Correctorclasses and move allautocorrectmethods out of mixin Modules. (@garettarrowood)
- Ruby
Published by bbatsov about 8 years ago
https://github.com/rubocop/rubocop - RuboCop 0.52
New features
- #5101: Allow to specify
TargetRubyVersion2.5. (@walf443) - #1575: Add new
Layout/ClassStructurecop that checks whether definitions in a class are in the configured order. This cop is disabled by default. (@jonatas) - New cop
Rails/InverseOfchecks for association arguments that require setting theinverse_ofoption manually. (@bdewater) - #4811: Add new
Layout/SpaceInsideReferenceBracketscop. (@garettarrowood) - #4811: Add new
Layout/SpaceInsideArrayLiteralBracketscop. (@garettarrowood) - #4252: Add new
Style/TrailingBodyOnMethodDefinitioncop. (@garettarrowood) - Add new
Style/TrailingMethodEndStatmentcop. (@garettarrowood) - #5074: Add Layout/EmptyLinesAroundArguments cop. (@garettarrowood)
- #4650: Add new
Style/StringHashKeyscop. (@donjar) - #1583: Add a quiet formatter. (@drenmi)
- Add new
Style/RandomWithOffsetcop. (@donjar) - #4892: Add new
Lint/ShadowedArgumentcop and remove argument shadowing detection fromLint/UnusedBlockArgumentandLint/UnusedMethodArgument. (@akhramov) - #4674: Add a new
Lint/MissingCopEnableDirectivecop. (@tdeo) - Add new
Rails/EnvironmentComparisoncop. (@tdeo) - Add
AllowedCharsoption toStyle/AsciiCommentscop. (@hedgesky) - #5031: Add new
Style/EmptyBlockParameterandStyle/EmptyLambdaParametercops. (@pocke) - #5057: Add new
Gemspec/RequiredRubyVersioncop. (@koic) - #5087: Add new
Gemspec/RedundantAssignmentcop. (@koic) - Add
unannotatedoption toStyle/FormatStringTokencop. (@drenmi) - #5077: Add new
Rails/CreateTableWithTimestampscop. (@wata727) - Add new
Style/ColonMethodDefinitioncop. (@rrosenblum) - Add new
Style/ExtendSelfcop. (@drenmi) - #5185: Add new
Rails/RedundantReceiverInWithOptionscop. (@koic) - #5177: Add new
Rails/LexicallyScopedActionFiltercop. (@wata727) - #5173: Add new
Style/EvalWithLocationcop. (@pocke) - #5208: Add new
Rails/Presencecop. (@wata727)
Bug fixes
- #5096: Fix incorrect detection and autocorrection of multiple extend/include/prepend. (@marcandre)
- #5219: Fix incorrect empty line detection for block arguments in
Layout/EmptyLinesAroundArguments. (@garettarrowood) - #4662: Fix incorrect indent level detection when first line of heredoc is blank. (@sambostock)
- #5016: Fix a false positive for
Style/ConstantNamewith constant names using non-ASCII capital letters with accents. (@timrogers) - #4866: Prevent
Layout/BlockEndNewlinecop from introducing trailing whitespaces. (@bgeuken) - #3396: Concise error when config. file not found. (@jaredbeck)
- #4881: Fix a false positive for
Performance/HashEachMethodswhen unused argument(s) exists in other blocks. (@pocke) - #4883: Fix auto-correction for
Performance/HashEachMethods. (@pocke) - #4896: Fix Style/DateTime wrongly triggered on classes
...::DateTime. (@dpostorivo) - #4938: Fix behavior of
Lint/UnneededDisable, which was returning offenses even after being disabled in a comment. (@tdeo) - #4887: Add undeclared configuration option
EnforcedStyleForEmptyBracesforLayout/SpaceBeforeBlockBracescop. (@drenmi) - #4987: Skip permission check when using stdin option. (@mtsmfm)
- #4909: Make
Rails/HasManyOrHasOneDependentaware of multiple associations inwith_options. (@koic) - #4794: Fix an error in
Layout/MultilineOperationIndentationwhen an operation spans multiple lines and contains a ternary expression. (@rrosenblum) - #4885: Fix false offense detected by
Style/MixinUsagecop. (@koic) - #3363: Fix
Style/EmptyElseautocorrection removes comments from branches. (@dpostorivo) - #5025: Fix error with Layout/MultilineMethodCallIndentation cop and lambda.(...). (@dpostorivo)
- #4781: Prevent
Style/UnneededPercentQfrom breaking on strings that are concated with backslash. (@pocke) - #4363: Fix
Style/PercentLiteralDelimitersincorrectly automatically modifies escaped percent literal delimiter. (@koic) - #5053: Fix
Naming/ConstantNamefalse offense on assigning to a nonoffensive assignment. (@garettarrowood) - #5019: Fix auto-correct for
Style/HashSyntaxcop when hash is used as unspaced argument. (@drenmi) - #5052: Improve accuracy of
Style/BracesAroundHashParametersauto-correction. (@garettarrowood) - #5059: Fix a false positive for
Style/MixinUsagewhenincludecall is a method argument. (@koic) - #5071: Fix a false positive in
Lint/UnneededSplatExpansion, whenArray.newresides in an array literal. (@akhramov) - #4071: Prevent generating wrong code by Style/ColonMethodCall and Style/RedundantSelf. (@pocke)
- #5089: Fix false positive for
Style/SafeNavigationwhen safe guarding arithmetic operation or assignment. (@tiagotex) - #5099: Prevent
Style/MinMaxfrom breaking on implicit receivers. (@drenmi) - #5079: Fix false positive for
Style/SafeNavigationwhen safe guarding comparisons. (@tiagotex) - #5075: Fix auto-correct for
Style/RedundantParenthesescop when unspaced ternary is present. (@tiagotex) - #5155: Fix a false negative for
Naming/ConstantNamecop when using frozen object assignment. (@koic) - Fix a false positive in
Style/SafeNavigationwhen the right hand side is negated. (@rrosenblum) - #5128: Fix
Bundler/OrderedGemswhen gems are references from variables (ignores them in the sorting). (@tdeo)
Changes
- #4848: Exclude lambdas and procs from
Metrics/ParameterLists. (@reitermarkus) - #5120: Improve speed of RuboCop::PathUtil#smart_path. (@walf443)
- #4888: Improve offense message of
Style/StderrPuts. (@jaredbeck) - #4886: Fix false offense for Style/CommentedKeyword. (@michniewicz)
- #4977: Make
Lint/RedundantWithIndexcop aware of offset argument. (@koic) - #2679: Handle dependencies to
Metrics/LineLength: Maxwhen generating.rubocop_todo.yml. (@jonas054) - #4943: Make cop generator compliant with the repo's rubocop config. (@tdeo)
- #5011: Remove
SupportedStylesfrom "Configuration parameters" in.rubocop_todo.yml. (@pocke) Lint/RescueWithoutErrorClasshas been replaced byStyle/RescueStandardError. (@rrosenblum)- #4811: Remove
Layout/SpaceInsideBracketsin favor of two new configurable cops. (@garettarrowood) - #5042: Make offense locations of metrics cops to contain whole a method. (@pocke)
- #5044: Add last_line and last_column into outputs of the JSON formatter. (@pocke)
- #4633: Make metrics cops aware of
define_method. (@pocke) - #5037: Make display cop names to enable by default. (@pocke)
- #4449: Make
Layout/IndentHeredocaware of line length. (@pocke) - #5146: Make
--show-copsoption aware of--force-default-config. (@pocke) - #3001: Add configuration to
Lint/MissingCopEnableDirectivecop. (@tdeo) - #4932: Do not fail if configuration contains
Lint/Syntaxcop with the same settings as the default. (@tdeo) - #5175: Make Style/RedundantBegin aware of do-end block in Ruby 2.5. (@pocke)
- Ruby
Published by bbatsov about 8 years ago
https://github.com/rubocop/rubocop - RuboCop 0.51
New features
- #4791: Add new
Rails/UnknownEnvcop. (@pocke) - #4690: Add new
Lint/UnneededRequireStatementcop. (@koic) - #4813: Add new
Style/StderrPutscop. (@koic) - #4796: Add new
Lint/RedundantWithObjectcop. (@koic) - #4663: Add new
Style/CommentedKeywordcop. (@donjar) - Add
IndentationWidthconfiguration forLayout/Tabcop. (@rrosenblum) - #4854: Add new
Lint/RegexpAsConditioncop. (@pocke) - #4862: Add
MethodDefinitionMacrosoption toNaming/PredicateNamecop. (@koic) - #4874: Add new
Gemspec/OrderedDependenciescop. (@sue445) - #4840: Add new
Style/MixinUsagecop. (@koic) - #1952: Add new
Style/DateTimecop. (@dpostorivo)
Bug fixes
- #3312: Make
Rails/DateCorrect false positive on#to_timefor strings ending in UTC-"Z".(@erikdstock) - #4741: Make
Style/SafeNavigationcorrectly exclude methods called without dot. (@drenmi) - #4740: Make
Lint/RescueWithoutErrorClassaware of modifier formrescue. (@drenmi) - #4745: Make
Style/SafeNavigationignore negated continuations. (@drenmi) - #4732: Prevent
Performance/HashEachMethodsfrom registering an offense when#eachfollows#to_a. (@drenmi) - #4730: False positive on Lint/InterpolationCheck. (@koic)
- #4751: Prevent
Rails/HasManyOrHasOneDependentcop from registering offense if:throughoption was specified. (@smakagon) - #4737: Fix ReturnInVoidContext cop when
returnis in top scope. (@frodsan) - #4776: Non utf-8 magic encoding comments are now respected. (@deivid-rodriguez)
- #4241: Prevent
Rails/BlankandRails/Presentfrom breaking when there is no explicit receiver. (@rrosenblum) - #4814: Prevent
Rails/Blankfrom breaking on send with an argument. (@pocke) - #4759: Make
Naming/HeredocDelimiterNamingandNaming/HeredocDelimiterCaseaware of more delimiter patterns. (@drenmi) - #4823: Make
Lint/UnusedMethodArgumentandLint/UnusedBlockArgumentaware of overriding assignments. (@akhramov) - #4830: Prevent
Lint/BooleanSymbolfrom truncating symbol's value in the message when offense is located in the new syntax hash. (@akhramov) - #4747: Fix
Rails/HasManyOrHasOneDependentcop incorrectly flagswith_optionsblocks. (@koic) - #4836: Make
Rails/OutputSafetyaware of safe navigation operator. (@drenmi) - #4843: Make
Lint/ShadowedExceptioncop aware of same system error code. (@koic) - #4757: Make
Style/TrailingUnderscoreVariablework for nested assignments. (@donjar) - #4597: Fix
Style/StringLiteralscop not registering an offense on single quoted strings containing an escaped single quote when configured to use double quotes. (@promisedlandt) - #4850:
Lint/UnusedMethodArgumentrespectsIgnoreEmptyMethodssetting by ignoring unused method arguments for singleton methods. (@jmks) - #2040: Document how to write a custom cop. (@jonatas)
Changes
- #4746: The
Lint/InvalidCharacterLiteralcop has been removed since it was never being actually triggered. (@deivid-rodriguez) - #4789: Analyzing code that needs to support MRI 1.9 is no longer supported. (@deivid-rodriguez)
- #4582:
Severityand other common parameters can be configured on department level. (@jonas054) - #4787: Analyzing code that needs to support MRI 2.0 is no longer supported. (@deivid-rodriguez)
- #4787: RuboCop no longer installs on MRI 2.0. (@deivid-rodriguez)
- #4266: Download the inherited config files of a remote file from the same remote. (@tdeo)
- #4853: Make
Lint/LiteralInConditioncop aware of!andnot. (@pocke) - #4864: Rename
Lint/LiteralInConditiontoLint/LiteralAsCondition. (@pocke)
- Ruby
Published by bbatsov over 8 years ago
https://github.com/rubocop/rubocop - RuboCop 0.50
New features
- #4464: Add
EnforcedStyleForEmptyBracesparameter toLayout/SpaceBeforeBlockBracescop. (@palkan) - #4453: New cop
Style/RedundantConditionalchecks for conditionals that return true/false. (@petehamilton) - #4448: Add new
TapFormatter. (@cyberdelia) - Add new
Style/HeredocDelimiterscop. (@drenmi) - #4153: New cop
Lint/ReturnInVoidContextchecks for the use of a return with a value in a context where it will be ignored. (@harold-s) - Add auto-correct support to
Lint/ScriptPermission. (@rrosenblum) - #4514: Add configuration options to
Style/YodaConditionto support checking all comparison operators or equality operators only. (@smakagon) - Add new
Lint/BooleanSymbolcop. (@droptheplot) - Make
Rails/PluralizationGrammaruse singular methods for-1/-1.0. (@promisedlandt) - #4541: Add new
Rails/HasManyOrHasOneDependentcop. (@oboxodo) - Add new
Style/Dircop. (@drenmi) - Add new
Style/HeredocDelimiterCasecop. (@drenmi) - #2943: Add new
Lint/RescueWithoutErrorClasscop. (@drenmi) - #4568: Fix autocorrection for
Style/TrailingUnderscoreVariable. (@smakagon) - #4586: Add new
Performance/UnfreezeStringcop. (@pocke) - #2976: Add
Whitelistconfiguration option toStyle/NestedParenthesizedCallscop. (@drenmi) - #3965: Add new
Style/DoublePipeEqualscop. (@donjar) - Make
rake new_copcreate parent directories if they do not already exist. (@highb) - #4368: Make
Performance/HashEachMethodinspect send nodes with any receiver. (@gohdaniel15) - #4508: Add new
Style/ReturnNilcop. (@donjar) - #4629: Add Metrics/MethodLength cop for
define_method. (@jekuta) - #4702: Add new
Lint/UriEscapeUnescapecop. (@koic) - #4696: Add new
Performance/UriDefaultParsercop. (@koic) - #4694: Add new
Lint/UriRegexpcop. (@koic) - Add new
Style/MinMaxcop. (@drenmi) - #4720: Add new
Bundler/InsecureProtocolSourcecop. (@koic) - #4708: Add new
Lint/RedundantWithIndexcop`. (@koic)
Bug fixes
- #4709: Use cached remote config on network failure. (@kristjan)
- #4688: Accept yoda condition which isn't commutative. (@fujimura)
- #4676: Make
Style/RedundantConditionalcop work with elsif. (@akhramov) - #4656: Modify
Style/ConditionalAssignmentautocorrection to work with unbracketed arrays. (@akhramov) - #4615: Don't consider
<=>a comparison method. (@iGEL) - #4664: Fix typos in Rails/HttpPositionalArguments. (@JoeCohen)
- #4618: Fix
Lint/FormatParameterMismatchfalse positive if format string includes%%5B(CGI encoded left bracket). (@barthez) - #4604: Fix
Style/LambdaCallto autocorrectobj.calltoobj.. (@iGEL) - #4443: Prevent
Style/YodaConditionfrom breakingnot LITERAL. (@pocke) - #4434: Prevent bad auto-correct in
Style/Aliasfor non-literal arguments. (@drenmi) - #4451: Make
Style/AndOrcop aware of comparison methods. (@drenmi) - #4457: Fix false negative in
Lint/Voidwith initialize and setter methods. (@pocke) - #4418: Register an offense in
Style/ConditionalAssignmentwhen the assignment line is the longest line, and it does not exceed the max line length. (@rrosenblum) - #4491: Prevent bad auto-correct in
Style/EmptyElsefor nestedif. (@pocke) - #4485: Handle 304 status for remote config files. (@daniloisr)
- #4529: Make
Lint/UnreachableCodeaware ofifandcase. (@pocke) - #4469: Include permissions in file cache. (@pocke)
- #4270: Fix false positive in
Performance/RegexpMatchfor named captures. (@pocke) - #4525: Fix regexp for checking comment config of
rubocop:disable allinLint/UnneededDisable. (@meganemura) - #4555: Make
Style/VariableNameaware of optarg, kwarg and other arguments. (@pocke) - #4481: Prevent
Style/WordArrayandStyle/SymbolArrayfrom registering offenses where percent arrays don't work. (@drenmi) - #4447: Prevent
Layout/EmptyLineBetweenDefsfrom removing too many lines. (@drenmi) - #3892: Make
Style/NumericPredicateignore numeric comparison of global variables. (@drenmi) - #4101: Skip auto-correct for literals with trailing comment and chained method call in
Layout/Multiline*BraceLayout. (@jonas054) - #4518: Fix bug where
Style/SafeNavigationdoes not register an offense when there are chained method calls. (@rrosenblum) - #3040: Ignore safe navigation in
Rails/Delegate. (@cgriego) - #4587: Fix false negative for void unary operators in
Lint/Voidcop. (@pocke) - #4589: Fix false positive in
Performance/RegexpMatchcop for=~is in a class method. (@pocke) - #4578: Fix false positive in
Lint/FormatParameterMismatchfor format with "asterisk" (*) width and precision. (@smakagon) - #4285: Make
Lint/DefEndAlignmentaware of multiple modifiers. (@drenmi) - #4634: Handle heredoc that contains empty lines only in
Layout/IndentHeredoccop. (@pocke) - #4646: Make
Lint/Debuggeraware ofKerneland cbase. (@pocke) - #4643: Modify
Style/InverseMethodsto not register a separate offense for an inverse method nested inside of the block of an inverse method offense. (@rrosenblum) - #4593: Fix false positive in
Rails/SaveBangwhensave/update_attributeis used with acasestatement. (@theRealNG) - #4322: Fix Style/MultilineMemoization from autocorrecting to invalid ruby. (@dpostorivo)
- #4722: Fix
rake new_copproblem that doesn't addrequireline. (@koic) - #4723: Fix
RaiseArgsauto-correction issue forraisewith 3 arguments. (@smakagon)
Changes
- #4470: Improve the error message for
Lint/AssignmentInCondition. (@brandonweiss) - #4553: Add
node_modulesto default excludes. (@iainbeeston) - #4445: Make
Style/Encodingcop enabled by default. (@deivid-rodriguez) - #4452: Add option to
Rails/Delegatefor enforcing the prefixed method name case. (@klesse413) - #4493: Make
Lint/Voidcop aware ofEnumerable#eachandfor. (@pocke) - #4492: Make
Lint/DuplicateMethodsaware ofaliasandalias_method. (@pocke) - #4478: Fix confusing message of
Performance/Callercop. (@pocke) - #4543: Make
Lint/DuplicateMethodsaware ofattr_*methods. (@pocke) - #4550: Mark
RuboCop::CLI#runas a public API. (@yujinakayama) - #4551: Make
Performance/Calleraware ofcaller_locations. (@pocke) - Rename
Style/HeredocDelimiterstoStyle/HeredocDelimiterNaming. (@drenmi) - #4157: Enhance offense message for
Style/RedudantReturncop. (@gohdaniel15) - #4521: Move naming related cops into their own
Namingdepartment. (@drenmi) - #4600: Make
Style/RedundantSelfaware of arguments of a block. (@Envek) - #4658: Disable auto-correction for
Performance/TimesMapby default. (@Envek)
- Ruby
Published by bbatsov over 8 years ago
https://github.com/rubocop/rubocop - RuboCop 0.49.1
Bug fixes
- #4411: Handle properly safe navigation in
Style/YodaCondition. (@bbatsov) - #4412: Handle properly literal comparisons in
Style/YodaCondition. (@bbatsov) - Handle properly class variables and global variables in
Style/YodaCondition. (@bbatsov) - #4392: Fix the auto-correct of
Style/Nextwhen theendis misaligned. (@rrosenblum) - #4407: Prevent
Performance/RegexpMatchfrom blowing up onmatchwithout arguments. (@pocke) - #4414: Handle pseudo-assignments in
forloops inStyle/ConditionalAssignment. (@bbatsov) - #4419: Handle combination
AllCops: DisabledByDefault: trueandRails: Enabled: true. (@jonas054) - #4422: Fix missing space in message for
Style/MultipleComparison. (@timrogers) - #4420: Ensure
Style/EmptyMethodhonours indentation when auto-correcting. (@drenmi) - #4442: Prevent
Style/WordArrayfrom breaking on strings that aren't valid UTF-8. (@pocke) - #4441: Prevent
Layout/SpaceAroundBlockParametersfrom breaking on lambda. (@pocke)
Changes
- Ruby
Published by bbatsov almost 9 years ago
https://github.com/rubocop/rubocop - RuboCop 0.49
New features
- #117: Add
--paralleloption for running RuboCop in multiple processes or threads. (@jonas054) - Add auto-correct support to
Style/MixinGrouping. (@rrosenblum) - #4236: Add new
Rails/ApplicationJobandRails/ApplicationRecordcops. (@tjwp) - #4078: Add new
Performance/Callercop. (@alpaca-tc) - #4314: Check slow hash accessing in
Array#sortbyPerformance/CompareWithBlock. (@pocke) - #3438: Add new
Style/FormatStringTokencop. (@backus) - #4342: Add new
Lint/ScriptPermissioncop. (@yhirano55) - #4145: Add new
Style/YodaConditioncop. (@smakagon) - #4403: Add public API
Cop.autocorrect_incompatible_withfor specifying other cops that should not autocorrect together. (@backus) - #4354: Add autocorrect to
Style/FormatString. (@hoshinotsuyoshi) - #4021: Add new
Style/MultipleComparisoncop. (@dabroz) - New
Lint/RescueTypecop. (@rrosenblum)
Changes
- #4262: Add new
MinSizeconfiguration toStyle/SymbolArray, consistent with the same configuration inStyle/WordArray. (@scottmatthewman) - #3400: Remove auto-correct support from Lint/Debugger. (@ilansh)
- #4278: Move all cops dealing with whitespace into a new department called
Layout. (@jonas054) - #4320: Update
Rails/OutputSafetyto disallow wrappingraworhtml_safewithsafe_join. (@klesse413) - #4336: Store
rubocop_cachein safer directories. (@jonas054) - #4361: Use relative path for offense message in
Lint/DuplicateMethods. (@pocke) - #4385: Include
.jbfile by default. (@pocke)
Bug fixes
- #4265: Require a space before first argument of a method call in
Style/SpaceBeforeFirstArgcop. (@cjlarose) - #4237: Fix false positive in
Lint/AmbiguousBlockAssociationcop for lambdas. (@smakagon) - #4242: Add
Capfileto the list of known Ruby filenames. (@bbatsov) - #4240: Handle
||=inRails/RelativeDateConstant. (@bbatsov) - #4241: Prevent
Rails/BlankandRails/Presentfrom breaking when there is no explicit receiver. (@rrosenblum) - #4249: Handle multiple assignment in
Rails/RelativeDateConstant. (@bbatsov) - #4250: Improve a bit the Ruby code detection config. (@bbatsov)
- #4283: Fix
Style/EmptyCaseConditionautocorrect bug - when firstwhenbranch includes comma-delimited alternatives. (@ilansh) - #4268: Handle end-of-line comments when autocorrecting Style/EmptyLinesAroundAccessModifier. (@vergenzt)
- #4275: Prevent
Style/MethodCallWithArgsParenthesesfrom blowing up onyield. (@drenmi) - #3969: Handle multiline method call alignment for arguments to methods. (@jonas054)
- #4304: Allow enabling whole departments when
DisabledByDefaultistrue. (@jonas054) - #4264: Prevent
Rails/SaveBangfrom blowing up when using the assigned variable in a hash. (@drenmi) - #4310: Treat paths containing invalid byte sequences as non-matches. (@mclark)
- #4063: Fix Rails/ReversibleMigration misdetection. (@gprado)
- #4339: Fix false positive in
Security/Evalcop for multiline string lietral. (@pocke) - #4339: Fix false negative in
Security/Evalcop forBinding#eval. (@pocke) - #4327: Prevent
Layout/SpaceInsidePercentLiteralDelimitersfrom registering offenses on execute-strings. (@drenmi) - #4371: Prevent
Style/MethodNamefrom complaining about unary operator definitions. (@drenmi) - #4366: Prevent
Performance/RedundantMergefrom blowing up on double splat arguments. (@drenmi) - #4352: Fix the auto-correct of
Style/AndOrwhen Enumerable accessors ([]) are used. (@rrosenblum) - #4393: Prevent
Style/InverseMethodsfrom registering an offense for methods that are double negated. (@rrosenblum) - #4394: Prevent some cops from breaking on safe navigation operator. (@drenmi)
- #4260: Prevent
Rails/SkipsModelValidationsfrom registering an offense forFileUtils.touch. (@rrosenblum)
- Ruby
Published by bbatsov almost 9 years ago
https://github.com/rubocop/rubocop - RuboCop 0.48.1
Changes
- #4219: Add a link to style guide for
Style/IndentationConsistencycop. (@pocke) - #4168: Removed
-noption. (@sadovnik) - #4039: Change
Style/PercentLiteralDelimitersdefault configuration to match Style Guide update. (@drenmi) - #4235: Improved copy of offense message in
Lint/AmbiguousBlockAssociationcop. (@smakagon)
Bug fixes
- #4171: Prevent
Rails/Blankfrom breaking when RHS oforis a naked falsiness check. (@drenmi) - #4189: Make
Lint/AmbiguousBlockAssociationaware of lambdas passed as arguments. (@drenmi) - #4179: Prevent
Rails/Blankfrom breaking when LHS oforis a naked falsiness check. (@rrosenblum) - #4172: Fix false positives in
Style/MixinGroupingcop. (@drenmi) - #4185: Make
Lint/NestedMethodDefinitionaware of#*_execclass of methods. (@drenmi) - #4197: Fix false positive in
Style/RedundantSelfcop with parallel assignment. (@drenmi) - #4199: Fix incorrect auto correction in
Style/SymbolArrayandStyle/WordArraycop. (@pocke) - #4218: Make
Lint/NestedMethodDefinitionaware of class shovel scope. (@drenmi) - #4198: Make
Lint/AmbguousBlockAssociationaware of operator methods. (@drenmi) - #4152: Make
Style/MethodCallWithArgsParenthesesnot require parens on setter methods. (@drenmi) - #4226: Show in
--helpoutput that--stdintakes a file name argument. (@jonas054) - #4217: Fix false positive in
Rails/FilePathcop with non string argument. (@soutaro) - #4106: Make
Style/TernaryParenthesesunsafe autocorrect detector aware of literals and constants. (@drenmi) - #4228: Fix false positive in
Lint/AmbiguousBlockAssociationcop. (@smakagon) - #4234: Fix false positive in
Rails/RelativeDatefor lambdas and procs. (@smakagon)
- Ruby
Published by bbatsov almost 9 years ago
https://github.com/rubocop/rubocop - RuboCop 0.47.1
Bug fixes
- #3911: Prevent a crash in
Performance/RegexpMatchcop with module definition. (@pocke) - #3908: Prevent
Style/AlignHashfrom breaking on a keyword splat when using enforcedtablestyle. (@drenmi) - #3918: Prevent
Rails/EnumUniquenessfrom breaking on a non-literal hash value. (@drenmi) - #3914: Fix department resolution for third party cops required through configuration. (@backus)
- #3846:
NodePatternworks for hyphenated node types. (@alexdowad) - #3922: Prevent
Style/NegatedIffrom breaking on negated ternary. (@drenmi) - #3915: Fix a false positive in
Lint/SafeNavigationChaincop withtrymethod. (@pocke)
- Ruby
Published by bbatsov almost 9 years ago
https://github.com/rubocop/rubocop - RuboCop 0.48
New features
- #4107: New
TargetRailsVersionconfiguration parameter can be used to specify which version of Rails the inspected code is intended to run on. (@maxbeizer) - #4104: Add
prefixandpostfixstyles toStyle/NegatedIf. (@brandonweiss) - #4083: Add new configuration
NumberOfEmptyLinesforStyle/EmptyLineBetweenDefs. (@dorian) - #4045: Add new configuration
StrictforStyle/NumericLiteralto make the change to this cop in 0.47.0 configurable. (@iGEL) - #4005: Add new
AllCops/EnabledByDefaultoption. (@betesh) - #3893: Add a new configuration,
IncludeActiveSupportAliases, toPerformance/DoublStartEndWith. This configuration will check for ActiveSupport'sstarts_with?andends_with?. (@rrosenblum) - #3889: Add new
Style/EmptyLineAfterMagicCommentcop. (@backus) - #3800: Make
Style/EndOfLineconfigurable withlf,crlf, andnative(default) styles. (@jonas054) - #3936: Add new
Style/MixinGroupingcop. (@drenmi) - #4003: Add new
Rails/RelativeDateConstantcop. (@sinsoku) - #3984: Add new
Style/EmptyLinesAroundBeginBodycop. (@pocke) - #3995: Add new
Style/EmptyLinesAroundExceptionHandlingKeywordscop. (@pocke) - #4019: Make configurable
Style/MultilineMemoizationcop. (@pocke) - #4018: Add autocorrect
Lint/EmptyEnsurecop. (@pocke) - #4028: Add new
Style/IndentHeredoccop. (@pocke) - #3931: Add new
Lint/AmbiguousBlockAssociationcop. (@smakagon) - Add new
Style/InverseMethodscop. (@rrosenblum) - #4038: Allow
defaultkey in theStyle/PercentLiteralDelimiterscop config to set all preferred delimiters. (@kddeisz) - Add
IgnoreMacrosoption toStyle/MethodCallWithArgsParentheses. (@drenmi) - #3937: Add new
Rails/ActiveSupportAliasescop. (@tdeo) - Add new
Rails/Blankcop. (@rrosenblum) - Add new
Rails/Presentcop. (@rrosenblum)
Changes
- #4100: Rails/SaveBang should flag
update_attributes. (@andriymosin) - #4083:
Style/EmptyLineBetweenDefsdoesn't allow more than one empty line between method definitions by default (seeNumberOfEmptyLines). (@dorian) - #3997: Include all ruby files by default and exclude non-ruby files. (@dorian)
- #4012: Mark
foo[:bar]as not complex inStyle/TernaryParenthesescop withrequire_parentheses_when_complexstyle. (@onk) - #3915: Make configurable whitelist for
Lint/SafeNavigationChaincop. (@pocke) - #3944: Allow keyword arguments in
Style/RaiseArgscop. (@mikegee) - Add auto-correct to
Performance/DoubleStartEndWith. (@rrosenblum) - #3951: Make
Rails/Datecop to register an offence for a string without timezone. (@sinsoku) - #4020: Fixed
new_cop.rakesuggested path. (@dabroz) - #4055: Add parameters count to offense message for
Metrics/ParameterListscop. (@pocke) - #4081: Allow
Marshal.loadif argument is aMarshal.dumpinSecurity/MarshalLoadcop. (@droptheplot) - #4124: Make
Style/SymbolArraycop to enable by default. (@pocke) - #3331: Change
Style/MultilineMethodCallIndentationindented_relative_to_receiverto indent relative to the reciever and not relative to the caller. (@jfelchner) - #4137: Allow lines to be exempted from
IndentationWidthby regex. (@jfelchner)
Bug fixes
- #4007: Skip
Rails/SkipsModelValidationsfor methods that don't accept arguments. (@dorian) - #3923: Allow asciibetical sorting in
Bundler/OrderedGems. (@mikegee) - #3855: Make
Lint/NonLocalExitFromIteratoraware of method definitions. (@drenmi) - #2643: Allow uppercase and dashes in
MagicComment. (@mikegee) - #3959: Don't wrap "percent arrays" with extra brackets when autocorrecting
Style/MutableConstant. (@mikegee) - #3978: Fix false positive in
Performance/RegexpMatchwithEnglishmodule. (@pocke) - #3242: Ignore
Errno::ENOENTduring cache cleanup fromFile.mtimetoo. (@mikegee) - #3958:
Style/SpaceInsideHashLiteralBracesdoesn't add and offence when checking an hash where a value is a left brace string (e.g. { k: '{' }). (@nodo) - #4006: Prevent
Style/WhileUntilModifierfrom breaking on a multiline modifier. (@drenmi) - #3345: Allow
Style/WordArray'sWordRegexconfiguration value to be an instance ofString. (@mikegee) - #4013: Follow redirects for RemoteConfig. (@buenaventure)
- #3917: Rails/FilePath Match nodes in a method call only once. (@unmanbearpig)
- #3673: Fix regression on
Style/RedundantSelfwhen assigning to same local variable. (@bankair) - #4047: Allow
find_zoneandfind_zone!methods inRails/TimeZone. (@attilahorvath) - #3457: Clear a warning and prevent new warnings. (@mikegee)
- #4066: Register an offense in
Lint/ShadowedExceptionwhen an exception is shadowed and there is an implicit begin. (@rrosenblum) - #4001: Lint/UnneededDisable of Metrics/LineLength that isn't unneeded. (@wkurniawan07)
- #3960: Let
Include/Excludepaths in all files beginning with.rubocopbe relative to the configuration file's directory and not to the current directory. (@jonas054) - #4049: Bugfix for
Style/EmptyLiteralcop. (@ota42y) - #4112: Fix false positives about double quotes in
Style/StringLiterals,Style/UnneededCapitalWandStyle/UnneededPercentQcops. (@pocke) - #4109: Fix incorrect auto correction in
Style/SelfAssignmentcop. (@pocke) - #4110: Fix incorrect auto correction in
Style/BracesAroundHashParameterscop. (@musialik) - #4084: Fix incorrect auto correction in
Style/TernaryParenthesescop. (@musialik) - #4102: Fix
Security/JSONLoad,Security/MarshalLoadandSecurity/YAMLLoadcops patterns not matching ::Const. (@musialik) - #3580: Handle combinations of
# rubocop:disable alland# rubocop:disable SomeCop. (@jonas054) - #4124: Fix auto correction bugs in
Style/SymbolArraycop. (@pocke) - #4128: Prevent
Style/CaseIndentationcop from registering offenses on single-line case statements. (@drenmi) - #4143: Prevent
Style/IdenticalConditionalBranchesfrom registering offenses when a case statement has an empty when. (@dpostorivo)
- Ruby
Published by bbatsov almost 9 years ago
https://github.com/rubocop/rubocop - RuboCop 0.47
New features
- #3822: Add
Rails/FilePathcop. (@iguchi1124) - #3821: Add
Security/YAMLLoadcop. (@cyberdelia) - #3816: Add
Security/MarshalLoadcop. (@cyberdelia) - #3757: Add Auto-Correct for
Bundler/OrderedGemscop. (@pocke) Style/FrozenStringLiteralCommentnow supports the styleneverthat will remove thefrozen_string_literalcomment. (@rrosenblum)- #3795: Add
Lint/MultipleComparecop. (@pocke) - #3772: Allow exclusion of certain methods for
Metrics/BlockLength. (@NobodysNightmare) - #3804: Add new
Lint/SafeNavigationChaincop. (@pocke) - #3670: Add
CountBlocksboolean option toMetrics/BlockNesting. It allows blocks to be counted towards the nesting limit. (@georgyangelov) - #2992: Add a configuration to
Style/ConditionalAssignmentto toggle offenses for ternary expressions. (@rrosenblum) - #3824: Add new
Perfomance/RegexpMatchcop. (@pocke) - #3825: Add new
Rails/SkipsModelValidationscop. (@rahulcs) - #3737: Add new
Style/MethodCallWithArgsParenthesescop. (@dominh) - Renamed
MethodCallParenthesestoMethodCallWithoutArgsParentheses. (@dominh) - #3854: Add new
Rails/ReversibleMigrationcop. (@sue445) - #3872: Detect
String#%with hash literal. (@backus) - #2731: Allow configuration of method calls that create methods for
Lint/UselessAccessModifier. (@pat)
Changes
- #3820: Rename
Lint/EvaltoSecurity/Eval. (@cyberdelia) - #3725: Disable
Style/SingleLineBlockParamsby default. (@tejasbubane) - #3765: Add a validation for supported styles other than EnforcedStyle.
AlignWith,IndentWhenRelativeToandEnforcedModeconfigurations are renamed. (@pocke) - #3782: Add check for
add_referencemethod byRails/NotNullColumncop. (@pocke) - #3761: Update
Style/RedundantFreezemessage fromFreezing immutable objects is pointless.toDo not freeze immutable objects, as freezing them has no effect.. (@lucasuyezu) - #3753: Change error message of
Bundler/OrderedGemsto mentionAlphabetize Gems. (@tejasbubane) - #3802: Ignore case when checking Gemfile order. (@breckenedge)
- Add missing examples in
Lintcops documentation. (@enriikke) - Make
Style/EmptyMethodcop aware of class methods. (@drenmi) - #3871: Add check for void
defined?andselfbyLint/Voidcop. (@pocke)
Bug fixes
- #3751: Avoid crash in
Rails/EnumUniquenesscop. (@pocke) - #3766: Avoid crash in
Style/ConditionalAssignmentcop with masgn. (@pocke) - #3770:
Style/RedundantParenthesesDon't flag raised to a power negative numeric literals, since removing the parentheses would change the meaning of the expressions. (@amogil) - #3750: Register an offense in
Style/ConditionalAssignmentwhen the assignment spans multiple lines. (@rrosenblum) - #3775: Avoid crash in
Style/HashSyntaxcop with an empty hash. (@pocke) - #3783: Maintain parentheses in
Rails/HttpPositionalArgumentswhen methods are defined with them. (@kevindew) - #3786: Avoid crash
Style/ConditionalAssignmentcop with mass assign method. (@pocke) - #3749: Detect corner case of
Style/NumericLitterals. (@kamaradclimber) - #3788: Prevent bad auto-correct in
Style/Nextwhen block has nested conditionals. (@drenmi) - #3807: Prevent
Style/DocumentationandStyle/DocumentationMethodfrom mistaking RuboCop directives for class documentation. (@drenmi) - #3815: Fix false positive in
Style/IdenticalConditionalBranchescop when branches have same line at leading. (@pocke) - Fix false negative in
Rails/HttpPositionalArgumentswhere offense would go undetected if one of the request parameter names matched one of the special keyword arguments. (@deivid-rodriguez) - Fix false negative in
Rails/HttpPositionalArgumentswhere offense would go undetected if the:formatkeyword was used with other non-special keywords. (@deivid-rodriguez) - #3406: Enable cops if Enabled is not explicitly set to false. (@metcalf)
- Fix
Lint/FormatParameterMismatchfor splatted last argument. (@zverok) - #3853: Fix false positive in
RedundantParenthesescop with multiple expression. (@pocke) - #3870: Avoid crash in
Rails/HttpPositionalArguments. (@pocke) - #3869: Prevent
Lint/FormatParameterMismatchfrom breaking when#%is passed an empty array. (@drenmi) - #3879: Properly handle Emacs and Vim magic comments for
FrozenStringLiteralComment. (@backus) - #3736: Fix to remove accumulator return value by auto-correction in
Style/EachWithObject. (@pocke)
- Ruby
Published by bbatsov about 9 years ago
https://github.com/rubocop/rubocop - RuboCop 0.46
New features
- #3600: Add new
Bundler/DuplicatedGemcop. (@jmks) - #3624: Add new configuration option
empty_lines_specialtoStyle/EmptyLinesAroundClassBodyandStyle/EmptyLinesAroundModuleBody. (@legendetm) - Add new
Style/EmptyMethodcop. (@drenmi) Style/EmptyLiteralwill now auto-correctHash.newwhen it is the first argument being passed to a method. The arguments will be wrapped with parenthesis. (@rrosenblum)- #3713: Respect
DisabledByDefaultin parent configs. (@aroben) - New cop
Rails/EnumUniquenesschecks for duplicate values defined in enum config. (@olliebennett) - New cop
Rails/EnumUniquenesschecks for duplicate values defined in enum config hash. (@olliebennett) - #3451: Add new
require_parentheses_when_complexstyle toStyle/TernaryParenthesescop. (@swcraig) - #3600: Add new
Bundler/OrderedGemscop. (@tdeo) - #3479: Add new configuration option
IgnoredPatternstoMetrics/LineLength. (@jonas054)
Changes
- The offense range for
Performance/FlatMapnow includes any parameters that are passed toflatten. (@rrosenblum) - #1747: Update
Style/SpecialGlobalVarsmessages with a reminder torequire 'English'. (@ivanovaleksey) - Checks
binding.irbcall byLint/Debuggercop. (@pocke) - #3742: Checks
minandmaxcall byPerfomance/CompareWithBlockcop. (@pocke)
Bug fixes
- #3662: Fix the auto-correction of
Lint/UnneededSplatExpansionwhen the splat expansion is inside of another array. (@rrosenblum) - #3699: Fix false positive in
Style/VariableNumberon variable names ending with an underscore. (@bquorning) - #3687: Fix the fact that
Style/TernaryParenthesescop claims to correct uncorrected offenses. (@Ana06) - #3568: Fix
--auto-gen-configbehavior forStyle/VariableNumber. (@jonas054) - Add
formatas an acceptable keyword argument forRails/HttpPositionalArguments. (@aesthetikx) - #3598: In
Style/NumericPredicate, don't reportx != 0orx.nonzero?as the expressions have different values. (@jonas054) - #3690: Do not register an offense for multiline braces with content in
Style/SpaceInsideBlockBraces. (@rrosenblum) - #3746:
Lint/NonLocalExitFromIteratordoes not warn aboutreturnin a block which is passed toObject#define_singleton_method. (@AlexWayfer)
- Ruby
Published by bbatsov over 9 years ago
https://github.com/rubocop/rubocop - RuboCop 0.45 (The Halloween Release)
New features
- #3615: Add autocorrection for
Lint/EmptyInterpolation. (@pocke) - Make
PercentLiteralDelimitersenforce delimiters around%I()too. (@bronson) - #3408: Add check for repeated values in case conditionals. (@swcraig)
- #3646: Add new
Lint/EmptyWhencop. (@drenmi) - #3246: Add list of all cops to the manual (generated automatically from a rake task). (@sihu)
- #3647: Add
--force-default-configoption. (@jawshooah) - #3570: Add new
MultilineIfModifiercop to avoid usage of if/unless-modifiers on multiline statements. (@tessi) - #3631: Add new
Style/SpaceInLambdaLiteralcop to check for spaces in lambda literals. (@swcraig) - Add new
Lint/EmptyExpressioncop. (@drenmi)
Bug fixes
- #3553: Make
Style/RedundantSelfcop to not register an offence forself.(). (@iGEL) - #3474: Make the
Rails/TimeZoneonly analyze functions which have "Time" in the receiver. (@b-t-g) - #3607: Fix
Style/RedundantReturncop for empty if body. (@pocke) - #3291: Improve detection of
rawandhtml_safemethods inRails/OutputSafety. (@lumeet) - Redundant return style now properly handles empty
whenblocks. (@albus522) - #3622: Fix false positive for
Metrics/MethodLengthandMetrics/BlockLength. (@meganemura) - #3625: Fix some cops errors when condition is empty brace. (@pocke)
- #3468: Fix bug regarding alignment inside
begin..endblock inStyle/MultilineMethodCallIndentation. (@jonas054) - #3644: Fix generation incorrect documentation. (@pocke)
- #3637: Fix Style/NonNilCheck crashing for ternary condition. (@tejasbubane)
- #3654: Add missing keywords for
Rails/HttpPositionalArguments. (@eitoball) - #3652: Avoid crash Rails/HttpPositionalArguments for lvar params when auto-correct. (@pocke)
- Fix bug in
Style/SafeNavigationwhere there is a check for an object in an elsif statement with a method call on that object in the branch. (@rrosenblum) - #3660: Fix false positive for Rails/SafeNavigation when without receiver. (@pocke)
- #3650: Fix
Style/VariableNumberregistering an offense for variables with double digit numbers. (@rrosenblum) - #3494: Check
railsstyle indentation also inside blocks inStyle/IndentationWidth. (@jonas054) - #3676: Ignore raw and html_safe invocations when wrapped inside a safe_join. (@b-t-g)
Changes
- #3601: Change default args for
Style/SingleLineBlockParams. This cop checks thatreduceandinjectuse the variable namesaandefor block arguments. These defaults are uncommunicative variable names and thus conflict with the "Uncommunicative Variable Name" check in Reek. Default args changed toaccandelem.(@jessieay) - #3645: Fix bug with empty case when nodes in
Style/RedundantReturn. (@tiagocasanovapt) - #3263: Fix auto-correct of if statements inside of unless else statements in
Style/ConditionalAssignment. (@rrosenblum) - Bump default Ruby version to 2.1. (@drenmi)
- Ruby
Published by bbatsov over 9 years ago
https://github.com/rubocop/rubocop - RuboCop 0.44 (The Birthday Release)
New features
- #3560: Add a configuration option
empty_lines_except_namespacetoStyle/EmptyLinesAroundClassBodyandStyle/EmptyLinesAroundModuleBody. (@legendetm) - #3370: Add new
Rails/HttpPositionalArgumentscop to check your Rails 5 test code for existence of positional args usage. (@logicminds) - #3510: Add a configuration option,
ConvertCodeThatCanStartToReturnNil, toStyle/SafeNavigationto check for code that could start returningnilif safe navigation is used. (@rrosenblum) - Add a new
AllCops/StyleGuideBaseURLsetting that allows the use of relative paths and/or fragments within each cop'sStyleGuidesetting, to make forking of custom style guides easier. (@scottmatthewman) - #3566: Add new
Metric/BlockLengthcop to ensure blocks don't get too long. (@savef) - #3428: Add support for configuring
Style/PreferredHashMethodswith eithershortorverbosestyle method names. (@abrom) - #3455: Add new
Rails/DynamicFindBycop. (@pocke) - #3542: Add a configuration option,
IgnoreCopDirectives, toMetrics/LineLengthto stop cop directives (# rubocop:disable Metrics/AbcSize) from being counted when considering line length. (@jmks) - Add new
Rails/DelegateAllowBlankcop. (@connorjacobsen) - Add new
Style/MultilineMemoizationcop. (@drenmi)
Bug fixes
- #3103: Make
Style/ExtraSpacingcop register an offense for extra spaces present in single-line hash literals. (@tcdowney) - #3513: Fix false positive in
Style/TernaryParenthesesfor a ternary with ranges. (@dreyks) - #3520: Fix regression causing
Lint/AssignmentInConditionfalse positive. (@savef) - #3514: Make
Style/VariableNumbercop not register an offense when valid normal case variable names have an integer after the first_. (@b-t-g) - #3516: Make
Style/VariableNumbercop not register an offense when valid normal case variable names have an integer in the middle. (@b-t-g) - #3436: Make
Rails/SaveBangcop not register an offense when return value of a non-bang method is returned by the parent method. (@coorasse) - #3540: Fix
Style/GuardClauseto register offense for instance and singleton methods. (@tejasbubane) - #3311: Detect incompatibilities with the external encoding to prevent bad autocorrections in
Style/StringLiterals. (@deivid-rodriguez) - #3499: Ensure
Lint/UnusedBlockArgumentdoesn't make recommendations that would change arity for methods defined using#define_method. (@drenmi) - #3430: Fix exception in
Performance/RedundantMergewhen inspecting a#merge!with implicit receiver. (@drenmi) - #3411: Avoid auto-correction crash for single
wheninPerformance/CaseWhenSplat. (@jonas054) - #3286: Allow
self.a, self.b = b, ainStyle/ParallelAssignment. (@jonas054) - #3419: Report offense for
unless x.nil?inStyle/NonNilCheckifIncludeSemanticChangesistrue. (@jonas054) - #3382: Avoid auto-correction crash for multiple elsifs in
Style/EmptyElse. (@lumeet) - #3334: Do not register an offense for a literal space (
\s) inStyle/UnneededCapitalW. (@rrosenblum) - #3390: Fix SaveBang cop for multiple conditional. (@tejasbubane)
- #3577: Fix
Style/RaiseArgsnot allowing compact raise with splatted args. (@savef) - #3578: Fix safe navigation method call counting in
Metrics/AbcSize. (@savef) - #3592: Fix
Style/RedundantParenthesesfor indexing with literals. (@thegedge) - #3597: Fix the autocorrect of
Performance/CaseWhenSplatwhen trying to rearange splat expanded variables to the end of a when condition. (@rrosenblum)
Changes
- #3512: Change error message of
Lint/UnneededSplatExpansionfor array in method parameters. (@tejasbubane) - #3510: Fix some issues with
Style/SafeNavigation. Fix auto-correct of multiline if expressions, and do not register an offense for scenarios using||and ternary expression. (@rrosenblum) - #3503: Change misleading message of
Style/EmptyLinesAroundAccessModifier. (@bquorning) - #3407: Turn off autocorrect for unsafe rules by default. (@ptarjan)
- #3521: Turn off autocorrect for
Security/JSONLoadby default. (@savef) - #2903:
Style/RedundantReturnlooks for redundantreturninside conditional branches. (@lumeet)
- Ruby
Published by bbatsov over 9 years ago
https://github.com/rubocop/rubocop - RuboCop 0.43
New features
- #3379: Add table of contents at the beginning of HTML formatted output. (@hedgesky)
- #2968: Add new
Style/DocumentationMethodcop. (@sooyang) - #3360: Add
RequireForNonPublicMethodsconfiguration option toStyle/DocumentationMethodcop. (@drenmi) - Add new
Rails/SafeNavigationcop to converttry!to&.. (@rrosenblum) - #3415: Add new
Rails/NotNullColumncop. (@pocke) - #3167: Add new
Style/VariableNumbercop. (@sooyang) - Add new style
no_mixed_keystoStyle/HashSyntaxto only check for hashes with mixed keys. (@daviddavis) - Allow including multiple configuration files from a single gem. (@tjwallace)
- Add check for
persisted?method call when using a create method inRails/SaveBang. (@QuinnHarris) - Add new
Style/SafeNavigationcop to convert method calls safeguarded by a nonnilcheck for the object to&.. (@rrosenblum) - Add new
Performance/SortWithBlockcop to usesort_by(&:foo)instead ofsort_by { |a, b| a.foo <=> b.foo }. (@koic) - #3492: Add new
UnifiedIntegercop. (@pocke)
Bug fixes
- #3383: Fix the local variable reset issue with
Style/RedundantSelfcop. (@bankair) - #3445: Fix bad autocorrect for
Style/AndOrcop. (@mikezter) - #3349: Fix bad autocorrect for
Style/Lambdacop. (@metcalf) - #3351: Fix bad auto-correct for
Performance/RedundantMatchcop. (@annaswims) - #3347: Prevent infinite loop in
Style/TernaryParenthesescop when used together withStyle/RedundantParentheses. (@drenmi) - #3209: Remove faulty line length check from
Style/GuardClausecop. (@drenmi) - #3366: Make
Style/MutableConstantcop aware of splat assignments. (@drenmi) - #3372: Fix RuboCop crash with empty brackets in
Style/Nextcop. (@pocke) - #3358: Make
Style/MethodMissingcop aware of class scope. (@drenmi) - #3342: Fix error in
Lint/ShadowedExceptioncop if last rescue does not have parameter. (@soutaro) - #3380: Fix false positive in
Style/TrailingUnderscoreVariablecop. (@drenmi) - #3388: Fix bug where
Lint/ShadowedExceptionwould register an offense when rescuing different numbers of custom exceptions in multiple rescue groups. (@rrosenblum) - #3386: Make
VariableForceunderstand an empty RegExp literal as LHS to=~. (@drenmi) - #3421: Fix clobbering
inherit_fromadditions when not using Namespaces in the configs. (@nicklamuro) - #3425: Fix bug for invalid bytes in UTF-8 in
Lint/PercentStringArraycop. (@pocke) - #3374: Make
SpaceInsideBlockBracesandSpaceBeforeBlockBracesnot depend onBlockDelimitersconfiguration. (@jonas054) - Fix error in
Lint/ShadowedExceptioncop for higher number of rescue groups. (@groddeck) - #3456: Don't crash on a multiline empty brace in
Style/MultilineMethodCallBraceLayout. (@pocke) - #3423: Checks if .rubocop is a file before parsing. (@joejuzl)
- #3439: Fix variable assignment check not working properly when a block is used in
Rails/SaveBang. (@QuinnHarris) - #3401: Read file contents in binary mode so
Style/EndOfLineworks on Windows. (@jonas054) - #3450: Prevent
Style/TernaryParenthesescop from making unsafe corrections. (@drenmi) - #3460: Fix false positives in
Style/InlineCommentcop. (@drenmi) - #3485: Make OneLineConditional cop not register offense for empty else. (@tejasbubane)
- #3508: Fix false negatives in
Rails/NotNullColumn. (@pocke) - #3462: Don't create MultilineMethodCallBraceLayout offenses for single-line method calls when receiver spans multiple lines. (@maxjacobson)
Changes
- #3341: Exclude RSpec tests from inspection by
Style/NumericPredicatecop. (@drenmi) - Rename
Lint/UselessArraySplattoLint/UnneededSplatExpansion, and add functionality to check for unnecessary expansion of other literals. (@rrosenblum) - No longer register an offense for splat expansion of an array literal in
Performance/CaseWhenSplat.Lint/UnneededSplatExpansionnow handles this behavior. (@rrosenblum) Lint/InheritExceptionrestricts inheriting from standard library subclasses ofException. (@metcalf)- No longer register an offense if the first line of code starts with
#\inStyle/LeadingCommentSpace.config.rufiles consider such lines as options. (@scottohara) - #3292: Remove
Performance/PushSplatas it can produce code that is slower or even cause failure. (@jonas054)
- Ruby
Published by bbatsov over 9 years ago
https://github.com/rubocop/rubocop - RuboCop 0.42.0
New features
- #3306: Add autocorrection for
Style/EachWithObject. (@owst) - Add new
Style/TernaryParenthesescop. (@drenmi) - #3136: Add config for
UselessAccessModifierso it can be made aware of ActiveSupport'sconcerningandclass_methodsmethods. (@maxjacobson) - #3128: Add new
Rails/SaveBangcop. (@QuinnHarris)
Bug fixes
- #3271: Fix bad auto-correct for
Style/EachForSimpleLoopcop. (@drenmi) - #3288: Fix auto-correct of word and symbol arrays in
Style/ParallelAssignmentcop. (@jonas054) - #3307: Fix exception when inspecting an operator assignment with
Style/MethodCallParenthesescop. (@drenmi) - #3316: Fix error for blocks without arguments in
Style/SingleLineBlockParamscop. (@owst) - #3320: Make
Style/OpMethodaware of the backtick method. (@drenmi) - Do not register an offense in
Lint/ShadowedExceptionwhen rescuing an exception built into Ruby before a custom exception. (@rrosenblum)
Changes
- #2645:
Style/EmptyLiteralno longer generates an offense forString.newwhen using frozen string literals. (@drenmi) - #3308: Make
Lint/NextWithoutAccumulatoraware of nested enumeration. (@drenmi) - Extend
Style/MethodMissingcop to check for the conditions in the style guide. (@drenmi) - #3325: Drop support for MRI 1.9.3. (@drenmi)
- Add support for MRI 2.4. (@dvandersluis)
- #3256: Highlight the closing brace in
Style/Multiline...BraceLayoutcops. (@jonas054) - Always register an offense when rescuing
Exceptionbefore or along with any other exception inLint/ShadowedException. (@rrosenblum)
- Ruby
Published by bbatsov over 9 years ago
https://github.com/rubocop/rubocop - RuboCop 0.41.2
Bug fixes
- #3248: Support 'ruby-' prefix in
.ruby-version. (@tjwp) - #3250: Make regexp for cop names less restrictive in CommentConfig lines. (@tjwp)
- #3261: Prefer
TargetRubyVersionto.ruby-version. (@tjwp) - #3249: Account for
rescue nilinStyle/ShadowedException. (@rrosenblum) - Modify the highlighting in
Style/ShadowedExceptionto be more useful. Highlight justrescuearea. (@rrosenblum) - #3129: Fix
Style/MethodCallParenthesesto work with multiple assignments. (@tejasbubane) - #3247: Ensure whitespace after beginning of block in
Style/BlockDelimiters. (@tjwp) - #2941: Make sure
Lint/UnneededDisablecan do auto-correction. (@jonas054) - #3269: Fix
Lint/ShadowedExceptionto block arbitrary code execution. (@pocke) - #3266: Handle empty parentheses in
Performance/RedundantBlockCallauto-correct. (@jonas054) - #3272: Add escape character missing to LITERAL_REGEX. (@pocke)
- #3255: Fix auto-correct for
Style/RaiseArgswhen constructing exception without arguments. (@drenmi) - #3294: Allow to use
Time.zone_default. (@Tei)
Changes
- #3230: Improve highlighting for
Style/AsciiCommentscop. (@drenmi) - Improve highlighting for
Style/AsciiIdentifierscop. (@drenmi)
- Ruby
Published by bbatsov over 9 years ago
https://github.com/rubocop/rubocop - RuboCop 0.41
New features
- #2956: Prefer
.ruby-versiontoTargetRubyVersion. (@pclalv) - #3095: Add
IndentationWidthconfiguration parameter forStyle/AlignParameterscop. (@alexdowad) - #3066: Add new
Style/ImplicitRuntimeErrorcop which advises the use of an explicit exception class when raising an error. (@alexdowad) - #3018: Add new
Style/EachForSimpleLoopcop which advises the use ofInteger#timesfor simple loops which iterate a fixed number of times. (@alexdowad) - #2595: New
compactstyle forStyle/SpaceInsideLiteralHashBraces. (@alexdowad) - #2927: Add autocorrect for
Rails/Validationcop. (@neodelf) - #3135: Add new
Rails/OutputSafetycop. (@josh) - #3164: Add Fastlane's Fastfile to the default Includes. (@jules2689)
- #3173: Make
Style/ModuleFunctionconfigurable withmodule_functionandextend_selfstyles. (@tjwp) - #3105: Add new
Rails/RequestReferercop. (@giannileggio) - #3200: Add autocorrect for
Style/EachForSimpleLoopcop. (@tejasbubane) - #3058: Add new
Style/SpaceInsideArrayPercentLiteralcop. (@owst) - #3058: Add new
Style/SpaceInsidePercentLiteralDelimiterscop. (@owst) - #3179: Expose files to support testings Cops using RSpec. (@tjwp)
- #3191: Allow arbitrary comments after cop names in CommentConfig lines (e.g. rubocop:enable). (@owst)
- #3165: Add new
Lint/PercentStringArraycop. (@owst) - #3165: Add new
Lint/PercentSymbolArraycop. (@owst) - #3177: Add new
Style/NumericLiteralPrefixcop. (@tejasbubane) - #1646: Add configuration style
indented_relative_to_receiverforStyle/MultilineMethodCallIndentation. (@jonas054) - New cop
Lint/ShadowedExceptionchecks for the order which exceptions are rescued to avoid rescueing a less specific exception before a more specific exception. (@rrosenblum) - #3127: New cop
Lint/InheritExceptionchecks for error classes inheriting fromException, and instead suggestsRuntimeErrororStandardError. (@drenmi) - Add new
Performance/PushSplatcop. (@segiddins) - #3089: Add new
Rails/Exitcop. (@sgringwe)
Bug fixes
- #3005: Symlink protection prevents use of caching in CI context. (@urbanautomaton)
- #3037:
Style/StringLiteralsunderstands that a bare '#', not '#@variable' or '#{interpolation}', does not require double quotes. (@alexdowad) - #2722:
Style/ExtraSpacingdoes not attempt to align an equals sign in an argument list with one in an assignment statement. (@alexdowad) - #3133:
Style/MultilineMethodCallBraceLayoutdoes not register offenses for single-line calls. (@alexdowad) - #3170:
Style/MutableConstantdoes not infinite-loop when correcting an array with no brackets. (@alexdowad) - #3150: Fix auto-correct for Style/MultilineArrayBraceLayout. (@jspanjers)
- #3192: Fix
Lint/UnusedBlockArgument'sIgnoreEmptyBlocksparameter from being removed from configuration. (@jfelchner) - #3114: Fix alignment
endwhen auto-correctingStyle/EmptyElse. (@rrosenblum) - #3120: Fix
Lint/UselessAccessModifierreporting useless access modifiers inside {Class,Module,Struct}.new blocks. (@owst) - #3125: Fix
Rails/UniqBeforePluckto ignoreuniqwith block. (@tejasbubane) - #3116:
Style/SpaceAroundKeywordallows&.method calls aftersuperandyield. (@segiddins) - #3131: Fix
Style/ZeroLengthPredicateto ignoresizeandlengthvariables. (@tejasbubane) - #3146: Fix
NegatedIfandNegatedWhileto ignore double negations. (@natalzia-paperless) - #3140:
Style/FrozenStringLiteralCommentworks with file doesn't have any tokens. (@pocke) - #3154: Fix handling of
()inStyle/RedundantParentheses. (@lumeet) - #3155: Fix
Style/SpaceAfterNotreporting on thenotkeyword. (@NobodysNightmare) - #3160:
Style/Lambdafix whitespacing when auto-correcting unparenthesized arguments. (@palkan) - #2944: Don't crash on strings that span multiple lines but only have one pair of delimiters in
Style/StringLiterals. (@jonas054) - #3157: Don't let
LineEndConcatenationandUnneededInterpolationmake changes to the same string during auto-correct. (@jonas054) - #3187: Let
Style/BlockDelimitersignore blocks in all method arguments. (@jonas054) - Modify
Style/ParallelAssignmentto use implicit begins when parallel assignment uses arescuemodifier and is the only thing in the method. (@rrosenblum) - #3217: Fix output of ellipses for multi-line offense ranges in HTML formatter. (@jonas054)
- #3207: Auto-correct modifier
while/untilandbegin..end+while/untilinStyle/InfiniteLoop. (@jonas054) - #3202: Fix
Style/EmptyElseregistering wrong offenses and thus making RuboCop crash. (@deivid-rodriguez) - #3183: Ensure
Style/SpaceInsideBlockBracesreports offenses for multi-line blocks. (@owst) - #3017: Fix
Style/StringLiteralsto register offenses on non-ascii strings. (@deivid-rodriguez) - #3056: Fix
Style/StringLiteralsto register offenses on non-ascii strings. (@deivid-rodriguez) - #2986: Fix
RedundantBlockCallto not report calls that pass block arguments, or where the block has been overridden. (@owst) - #3223: Return can take many arguments. (@ptarjan)
- #3239: Fix bug with --auto-gen-config and a file that does not exist. (@meganemura)
- #3138: Fix RuboCop crashing when config file contains utf-8 characters and external encoding is not utf-8. (@deivid-rodriguez)
- #3175: Generate 'Exclude' list for the cops with configurable enforced style to
.rubocop_todo.ymlif different styles are used. (@flexoid) - #3231: Make
Rails/UniqBeforePluckmore conservative. (@tjwp)
Changes
- #3149: Make
Style/HashSyntaxconfigurable to not report hash rocket syntax for symbols ending with ? or ! when using ruby19 style. (@owst) - #1758: Let
Style/ClosingParenthesisIndentationfollowStyle/AlignParametersconfiguration for method calls. (@jonas054) - #3224: Rename
Style/DeprecatedHashMethodstoStyle/PreferredHashMethods. (@tejasbubane)
- Ruby
Published by bbatsov over 9 years ago
https://github.com/rubocop/rubocop - RuboCop 0.40
New features
- #2997:
Performance/CaseWhenSplatcan now identify multiple offenses in the same branch and offenses that do not occur as the first argument. (@rrosenblum) - #2928:
Style/NestedParenthesizedCallscop can auto-correct. (@drenmi) Style/RaiseArgscop can auto-correct. (@drenmi)- #2993:
Style/SpaceAfterColonnow checks optional keyword arguments. (@owst) - #3003: Read command line options from
.rubocopfile andRUBOCOP_OPTSenvironment variable. (@bolshakov) - #2857:
Style/MultilineArrayBraceLayoutenforced style is configurable and supportssymmetricalandnew_lineoptions. (@panthomakos) - #2857:
Style/MultilineHashBraceLayoutenforced style is configurable and supportssymmetricalandnew_lineoptions. (@panthomakos) - #2857:
Style/MultilineMethodCallBraceLayoutenforced style is configurable and supportssymmetricalandnew_lineoptions. (@panthomakos) - #2857:
Style/MultilineMethodDefinitionBraceLayoutenforced style is configurable and supportssymmetricalandnew_lineoptions. (@panthomakos) - #3052:
Style/MultilineArrayBraceLayoutenforced style supportssame_lineoption. (@panthomakos) - #3052:
Style/MultilineHashBraceLayoutenforced style supportssame_lineoption. (@panthomakos) - #3052:
Style/MultilineMethodCallBraceLayoutenforced style supportssame_lineoption. (@panthomakos) - #3052:
Style/MultilineMethodDefinitionBraceLayoutenforced style supportssame_lineoption. (@panthomakos) - #3019: Add new
Style/EmptyCaseConditioncop. (@owst, @rrosenblum) - #3072: Add new
Lint/UselessArraySplatcop. (@owst) - #3022:
Style/Lambdaenforced style supportsliteraloption. (@drenmi) - #2909:
Style/Lambdaenforced style supportslambdaoption. (@drenmi) - #3092: Allow
Style/Encodingto enforce using no encoding comments. (@NobodysNightmare) - New cop
Rails/UniqBeforePluckchecks thatuniqis used beforepluck. (@tjwp)
Bug fixes
- #3112: Fix
Style/ClassAndModuleChildrenfor nested classes with explicit superclass. (@jspanjers) - #3032: Fix autocorrecting parentheses for predicate methods without space before args. (@graemeboy)
- #3000: Fix encoding crash on HTML output. (@gerrywastaken)
- #2983:
Style/AlignParametersmessage was clarified forwith_fixed_indentationstyle. (@dylanahsmith) - #2314: Ignore
UnusedBlockArgumentfor keyword arguments. (@volkert) - #2975: Make comment indentation before
)consistent with comment indentation before}or]. (@jonas054) - #3010: Fix double reporting/correction of spaces after ternary operator colons (now only reported by
Style/SpaceAroundOperators, and notStyle/SpaceAfterColontoo). (@owst) - #3006: Register an offense for calling
merge!on a method on a variable insideeach_with_objectinPerformance/RedundantMerge. (@lumeet, @rrosenblum) - #2886: Custom cop changes now bust the cache. (@ptarjan)
- #3043:
Style/SpaceAfterNotwill now register an offense for a receiver that is wrapped in parentheses. (@rrosenblum) - #3039: Accept
matchwithout a receiver inPerformance/EndWith. (@lumeet) - #3039: Accept
matchwithout a receiver inPerformance/StartWith. (@lumeet) - #3048:
Lint/NestedMethodDefinitionshouldn't flag methods defined on Structs. (@owst) - #2912: Check whether a line is aligned with the following line if the preceding line is not an assignment. (@akihiro17)
- #3036: Don't let
Lint/UnneededDisableinspect files that are excluded for the cop. (@jonas054) - #2874: Fix bug when the closing parenthesis is preceded by a newline in array and hash literals in
Style/RedundantParentheses. (@lumeet) - #3049: Make
Lint/UselessAccessModifierdetect conditionally defined methods and correctly handle dynamically defined methods and singleton class methods. (@owst) - #3004: Don't add
Style/Aliasoffenses for use ofaliasininstance_evalblocks, since object instances don't respond toalias_method. (@magni-) - #3061: Custom cops now show up in --show-cops. (@ptarjan)
- #3088: Ignore offenses that involve conflicting HEREDOCs in the
Style/Multiline*BraceLayoutcops. (@panthomakos) - #3083: Do not register an offense for splat block args in
Style/SymbolProc. (@rrosenblum) - #3063: Don't auto-correct
a + \intoa + \\inStyle/LineEndConcatenation. (@jonas054) - #3034: Report offenses for
RuntimeError.new(msg)inStyle/RedundantException. (@jonas054) - #3016:
Style/SpaceAfterCommanow usesStyle/SpaceInsideHashLiteralBraces's setting. (@ptarjan)
Changes
- #2995: Removed deprecated path matching syntax. (@gerrywastaken)
- #3025: Removed deprecation warnings for
rubocop-todo.yml. (@ptarjan) - #3028: Add
define_methodto the default list ofIgnoredMethodsofStyle/SymbolProc. (@jastkand) - #3064:
Style/SpaceAfterNothighlights the entire expression instead of just the exlamation mark. (@rrosenblum) - #3085: Enable
Style/MultilineArrayBraceLayoutandStyle/MultilineHashBraceLayoutwith thesymmetricalstyle by default. (@panthomakos) - #3091: Enable
Style/MultilineMethodCallBraceLayoutandStyle/MultilineMethodDefinitionBraceLayoutwith thesymmetricalstyle by default. (@panthomakos) - #1830:
Style/PredicateNamenow ignores thespec/directory, since there is a strong convention for usinghave_*andbe_*helper methods in RSpec. (@gylaz)
- Ruby
Published by bbatsov almost 10 years ago
https://github.com/rubocop/rubocop - RuboCop 0.39
New features
Performance/TimesMapcop can auto-correct. (@lumeet)Style/ZeroLengthPredicatecop can auto-correct. (@lumeet)- #2828:
Style/ConditionalAssignmentis now configurable to enforce assignment inside of conditions or to enforce assignment to conditions. (@rrosenblum) - #2862:
Performance/DetectandPerformance/Counthave a new configurationSafeModethat is defaulted totrue. These cops have known issues withRailsand other ORM frameworks. With this default configuration, these cops will not run if theRailscops are enabled. (@rrosenblum) Style/IfUnlessModifierOfIfUnlesscop added. (@amuino)
Bug fixes
- #2948:
Style/SpaceAroundKeywordshould allow yield[n] and super[n]. (@laurelfan) - #2950: Fix auto-correcting cases in which precedence has changed in
Style/OneLineConditional. (@lumeet) - #2947: Fix auto-correcting
if-theninStyle/Next. (@lumeet) - #2904:
Style/RedundantParenthesesdoesn't flag-(1.method)or+(1.method), since removing the parentheses would change the meaning of these expressions. (@alexdowad) - #2958:
Style/MultilineMethodCallIndentationdoesn't fail when inspecting unary ops which span multiple lines. (@alexdowad) - #2959:
Lint/LiteralInInterpolationdoesn't report offenses for iranges and eranges with non-literal endpoints. (@alexdowad) - #2960:
Lint/AssignmentInConditioncatches method assignments (likeobj.attr = val) in a condition. (@alexdowad) - #2871: Second solution for possible encoding incompatibility when outputting an HTML report. (@jonas054)
- #2967: Fix auto-correcting of
===,<=, and>=inStyle/ConditionalAssignment. (@rrosenblum) - #2977: Fix auto-correcting of
"#{$!}"inStyle/SpecialGlobalVars. (@lumeet) - #2935: Make configuration loading work if
SafeYAML.loadis private. (@jonas054)
Changes
require:only does relative includes when it starts with a.. (@ptarjan)Style/IfUnlessModifierdoes not trigger if the body is another conditional. (@amuino)- #2963:
Performance/RedundantMergewill now register an offense inside ofeach_with_object. (@rrosenblum)
- Ruby
Published by bbatsov almost 10 years ago
https://github.com/rubocop/rubocop - RuboCop 0.38
New features
Style/UnlessElsecop can auto-correct. (@lumeet)- #2629: Add a new public API method,
highlighted_areato offense. This method returns the range of the highlighted portion of an offense. (@rrosenblum) Style/OneLineConditionalcop can auto-correct. (@lumeet)- #2905:
Style/ZeroLengthConditionalflags code likearray.length < 1,1 > array.length, and so on. (@alexdowad) - #2892:
Lint/BlockAlignmentcop can be configured to be stricter. (@ptarjan) Style/Notis able to autocorrect in cases where parentheses must be added to preserve the meaning of an expression. (@alexdowad)Style/Notauto-corrects comparison expressions by removingnotand using the opposite comparison. (@alexdowad)
Bug fixes
- Add
require 'time'toremote_config.rbto avoid "undefined method `rfc2822'". (@necojackarc) - Replace
Rake::TaskManager#last_commentwithRake::TaskManager#last_descriptionfor Rake 11 compatibility. (@tbrisker) - Fix false positive in
Style/TrailingCommaInArguments&Style/TrailingCommaInLiteralcops with consistent_comma style. (@meganemura) - #2861: Fix false positive in
Style/SpaceAroundKeywordforrescue(.... (@rrosenblum) - #2832:
Style/MultilineOperationIndentationtreats operations inside blocks inside other operations correctly. (@jonas054) - #2865: Change
require:in config to be relative to the.rubocop.ymlfile itself. (@ptarjan) - #2845: Handle heredocs in
Style/MultilineLiteralBraceLayoutauto-correct. (@jonas054) - #2848: Handle comments inside arrays in
Style/MultilineArrayBraceLayoutauto-correct. (@jonas054) Style/TrivialAccessorsallows predicate methods by default. (@alexdowad)- #2869: Offenses which occur in the body of a
whenclause with multiple arguments will not be missed. (@alexdowad) Lint/UselessAccessModifierrecognizes method defs inside abeginblock. (@alexdowad)- #2870:
Lint/UselessAccessModifierrecognizes method definitions which are passed as an argument to a method call. (@alexdowad) - #2859:
Style/RedundantParenthesesdoesn't consider the parentheses in(!receiver.method arg)to be redundant, since they might change the meaning of an expression, depending on precedence. (@alexdowad) - #2852:
Performance/Casecmpdoesn't flag uses ofdowncase/upcasewhich are not redundant. (@alexdowad) - #2850:
Style/FileNamedoesn't choke on empty files with spaces in their names. (@alexdowad) - #2834: When configured as
ConsistentQuotesInMultiline: true,Style/StringLiteralsdoesn't error out when inspecting a heredoc with differing indentation across multiple lines. (@alexdowad) - #2876:
Style/ConditionalAssignmentbehaves correctly when assignment statement uses a character which has a special meaning in a regex. (@alexdowad) - #2877:
Style/SpaceAroundKeyworddoesn't flag!super.method,!yield.method, and so on. (@alexdowad) - #2631:
Style/Encodingcan remove unneeded encoding comment when autocorrecting withwhen_neededstyle. (@alexdowad) - #2860: Fix false positive in
Rails/Datewhento_timeis chained with safe method. (@palkan) - #2898:
Lint/NestedMethodDefinitionallows methods defined insideClass.new(S)blocks. (@segiddins) - #2894: Fix auto-correct an unless with a comparison operator. (@jweir)
- #2911:
Style/ClassAndModuleChildrendoesn't flag nested class definitions, where the outer class has an explicit superclass (because such definitions can't be converted tocompactstyle). (@alexdowad) - #2871: Don't crash when offense messages are read back from cache with
ASCII-8BITencoding and output as HTML or JSON. (@jonas054) - #2901: Don't crash when
ENV['HOME']is undefined. (@mikegee) - #2627:
Style/BlockDelimitersdoes not flag blocks delimited by{}when a block call is the final value in a hash with implicit braces (one which is the last argument to an outer method call). (@alexdowad)
Changes
- Update Rake to version 11. (@tbrisker)
- #2629: Change the offense range for metrics cops to default to
expressioninstead ofkeyword(the offense now spans the entire method, class, or module). (@rrosenblum) - #2891: Change the caching of remote configs to live alongside the parent file. (@Fryguy)
- #2662: When setting options for Rake task, nested arrays can be used in the
options,formatters, andrequiresarrays. (@alexdowad) - #2925: Bump unicode-display_width dependency to >= 1.0.1. (@jspanjers)
- #2875:
Style/SignalExceptiondoes not flag calls tofailif a custom method namedfailis defined in the same file. (@alexdowad) - #2923:
Style/FileNameconsiders file names which contain a ? or ! character to still be "snake case". (@alexdowad) - #2879: When autocorrecting,
Lint/UnusedMethodArgumentremoves unused block arguments rather than simply prefixing them with an underscore. (@alexdowad)
- Ruby
Published by bbatsov about 10 years ago
https://github.com/rubocop/rubocop - RuboCop 0.37.2
Bug fixes
- Fix auto-correction of array and hash literals in
Lint/LiteralInInterpolation. (@lumeet) - #2815: Fix missing assets for html formatter. (@prsimp)
Style/RedundantParenthesescatches offenses involving the 2nd argument to a method call without parentheses, if the 2nd argument is a hash. (@alexdowad)Style/RedundantParenthesescatches offenses inside an array literal. (@alexdowad)Style/RedundantParenthesesdoesn't flagmethod (:arg) {}, since removing the parentheses would change the meaning of the expression. (@alexdowad)Performance/Detectdoesn't flag code wherefirstorlasttakes an argument, as it cannot be transformed to equivalent code usingdetect. (@alexdowad)Style/SpaceAroundOperatorsignores aref assignments. (@alexdowad)Style/RescueModifierindents code correctly when auto-correcting. (@alexdowad)Style/RedundantMergeindents code correctly when auto-correcting, even if the corrected hash had multiple keys, and even if the corrected code was indented to start with. (@alexdowad)- #2831:
Performance/RedundantMergedoesn't break code by autocorrecting a#merge!call which occurs at tail position in a block. (@alexdowad)
Changes
- Handle auto-correction of nested interpolations in
Lint/LiteralInInterpolation. (@lumeet) - RuboCop results cache uses different directory names when there are many (or long) CLI options, to avoid a very long path which could cause failures on some filesystems. (@alexdowad)
- Ruby
Published by bbatsov about 10 years ago
https://github.com/rubocop/rubocop - RuboCop 0.37.1
New features
- #2798:
Rails/FindEachcop works withwhere.not. (@pocke) Style/MultilineBlockLayoutcan correct offenses which involve argument destructuring. (@alexdowad)Style/SpaceAroundKeywordcheckssupernodes with no args. (@alexdowad)Style/SpaceAroundKeywordchecksdefined?nodes. (@alexdowad)- #2719:
Style/ConditionalAssignmenthandles correcting the alignment ofend. (@rrosenblum)
Bug fixes
- Fix auto-correction of
notwith parentheses inStyle/Not. (@lumeet) - #2784: RuboCop can inspect
super { ... }andsuper(arg) { ... }. (@alexdowad) - #2781:
Performance/RedundantMergedoesn't flag calls to#update, since many classes have methods by this name (not onlyHash). (@alexdowad) - #2780:
Lint/DuplicateMethodsdoes not flag method definitions inside dynamicClass.newblocks. (@alexdowad) - #2775:
Style/SpaceAroundKeyworddoesn't flagyield.method. (@alexdowad) - #2774:
Style/SpaceAroundOperatorsdoesn't flag calls to#[]. (@alexdowad) - #2772: RuboCop doesn't crash when
AllCopssection in configuration file is empty (rather, it displays a warning as intended). (@alexdowad) - #2737:
Style/GuardClausehandleselsifclauses correctly. (@alexdowad) - #2735:
Style/MultilineBlockLayoutdoesn't cause an infinite loop by movingendonto the same line as the block args. (@alexdowad) - #2715:
Performance/RedundantMatchdoesn't flag calls to#matchwhich take a block. (@alexdowad) - #2704:
Lint/NestedMethodDefinitiondoesn't flag singleton defs which define a method on the value of a local variable. (@alexdowad) - #2660:
Style/TrailingUnderscoreVariableshows recommended code in its offense message. (@alexdowad) - #2671:
Style/WordArraydoesn't attempt to inspect strings with invalid encoding, to avoid failing with an encoding error. (@alexdowad)
Changes
- #2739: Change the configuration option
when_neededinStyle/FrozenStringLiteralCommentto add afrozen_string_literalcomment to all files when theTargetRubyVersionis set to 2.3+. (@rrosenblum)
- Ruby
Published by bbatsov about 10 years ago
https://github.com/rubocop/rubocop - RuboCop 0.37
New features
- #2620: New cop
Style/ZeroLengthPredicatechecks forobject.size == 0and variants, and suggests replacing them with an appropriateempty?predicate. (@drenmi) - #2657: Floating headers in HTML output. (@mattparlane)
- Add new
Style/SpaceAroundKeywordcop. (@lumeet) - #2745: New cop
Style/MultilineHashBraceLayoutchecks that the closing brace in a hash literal is symmetrical with respect to the opening brace and the hash elements. (@panthomakos) - #2761: New cop
Style/MultilineMethodDefinitionBraceLayoutchecks that the closing brace in a method definition is symmetrical with respect to the opening brace and the method parameters. (@panthomakos) - #2699:
Performance/Casecmpcan register offenses whenstr.downcaseorstr.upcaseare passed to an equality method. (@rrosenblum) - #2766: New cop
Style/MultilineMethodCallBraceLayoutchecks that the closing brace in a method call is symmetrical with respect to the opening brace and the method arguments. (@panthomakos)
Bug fixes
- #2723: Fix NoMethodError in Style/GuardClause. (@drenmi)
- #2674: Also check for Hash#update alias in
Performance/RedundantMerge. (@drenmi) - #2630: Take frozen string literals into account in
Style/MutableConstant. (@segiddins) - #2642: Support assignment via
||=inStyle/MutableConstant. (@segiddins) - #2646: Fix auto-correcting assignment to a constant in
Style/ConditionalAssignment. (@segiddins) - #2614: Check for zero return value from
casecmpinPerformance/casecmp. (@segiddins) - #2647: Allow
xstrinterpolations inLint/LiteralInInterpolation. (@segiddins) - Report a violation when
freezeis called on a frozen string literal inStyle/RedundantFreeze. (@segiddins) - #2641: Fix crashing on empty methods with block args in
Perfomance/RedundantBlockCall. (@segiddins) Lint/DuplicateMethodsdoesn't crash whenclass_evalis used with an implicit receiver. (@lumeet)- #2654: Fix handling of unary operations in
Style/RedundantParentheses. (@lumeet) - #2661:
Style/Nextdoesn't crash when auto-correcting modifierif/unless. (@lumeet) - #2665: Make specs pass when running on Windows. (@jonas054)
- #2691: Do not register an offense in
Performance/TimesMapfor callingmaporcollecton a variable namedtimes. (@rrosenblum) - #2689: Change
Performance/RedundantBlockCallto respect parentheses usage. (@rrosenblum) - #2694: Fix caching when using a different JSON gem such as Oj. (@stormbreakerbg)
- #2707: Change
Lint/NestedMethodDefinitionto respectClass.newandModule.new. (@owst) - #2701: Do not consider assignments to the same variable as useless if later assignments are within a loop. (@owst)
- #2696:
Style/NestedModifieradds parentheses around a condition when needed. (@lumeet) - #2666: Fix bug when auto-correcting symbol literals in
Lint/LiteralInInterpolation. (@lumeet) - #2664:
Performance/Casecmpcan auto-correct case comparison to variables and method calls without error. (@rrosenblum) - #2729: Fix handling of hash literal as the first argument in
Style/RedundantParentheses. (@lumeet) - #2703: Handle byte order mark in
Style/IndentationWidth,Style/ElseAlignment,Lint/EndAlignment, andLint/DefEndAlignment. (@jonas054) - #2710: Fix handling of fullwidth characters in some cops. (@seikichi)
- #2690: Fix alignment of operands that are part of an assignment in
Style/MultilineOperationIndentation. (@jonas054) - #2228: Use the config of a related cop whether it's enabled or not. (@madwort)
- #2721: Do not register an offense for constants wrapped in parentheses passed to
rescueinStyle/RedundantParentheses. (@rrosenblum) - #2742: Fix
Style/TrailingCommaInArguments&Style/TrailingCommaInLiteralfor inline single element arrays. (@annih) - #2768: Allow parentheses after keyword
notinStyle/MethodCallParentheses. (@lumeet) - #2758: Allow leading underscores in camel case variable names.(@mmcguinn)
Changes
- Remove
Style/SpaceAfterControlKeywordandStyle/SpaceBeforeModifierKeywordas the more genericStyle/SpaceAroundKeywordhandles the same cases. (@lumeet) - Handle comparisons with
!=inPerformance/casecmp. (@segiddins) - #2684: Do not base
Style/FrozenStringLiteralCommenton the version of Ruby that is running. (@rrosenblum) - #2732: Change the default style of
Style/SignalExceptiontoonly_raise. (@bbatsov)
- Ruby
Published by bbatsov about 10 years ago
https://github.com/rubocop/rubocop - RuboCop 0.36.0
An epic release - the one which contains the most new features and
bugfixes since the inception of the project! A huge thanks to the
amazing contributors who helped make it a reality!
Notably, this release adds support for Ruby 2.3 and introduces the
important concept of a target Ruby version - meaning RuboCop will no
longer try to parse the code with a parser matching the interpreter
you're using, but a parser matching the target Ruby version you
specified in .rubocop.yml. This way you won't introduce accidentally
syntax from a newer Ruby when you want to maintain
compatibility with certain older Rubies.
Enjoy!
New features
- #2598: New cop
Lint/RandOnechecks forrand(1),Kernel.rand(1.0)and similar calls. Such call are most likely a mistake because they always return0. (@DNNX) - #2590: New cop
Performance/DoubleStartEndWithchecks for twostart_with?(orend_with?) calls joined by||with the same receiver, likestr.start_with?('x') || str.start_with?('y')and suggests using one call instead:str.start_with?('x', 'y'). (@DNNX) - #2583: New cop
Performance/TimesMapchecks forx.times.map{}and suggests replacing them withArray.new(x){}. (@DNNX) - #2529: Add EnforcedStyle config parameter to IndentArray. (@jawshooah)
- #2479: Add option
AllowHeredoctoMetrics/LineLength. (@fphilipe) - #2416: New cop
Style/ConditionalAssignmentchecks for assignment of the same variable in all branches of conditionals and replaces them with a single assignment to the return of the conditional. (@rrosenblum) - #2410: New cop
Style/IndentAssignmentchecks the indentation of the first line of the right-hand-side of a multi-line assignment. (@panthomakos) - #2431: Add
IgnoreExecutableScriptsoption toStyle/FileName. (@sometimesfood) - #2460: New cop
Style/UnneededInterpolationchecks for strings that are just an interpolated expression. (@cgriego) - #2361:
Style/MultilineAssignmentLayoutcop checks for a newline after the assignment operator in a multi-line assignment. (@panthomakos) - #2462:
Lint/UselessAccessModifiercan catch more types of useless access modifiers. (@alexdowad) - #1677: Add new
Performance/Casecmpcop. (@alexdowad) - #1677: Add new
Performance/RangeIncludecop. (@alexdowad) - #1677: Add new
Performance/RedundantSortBycop. (@alexdowad) - #1677: Add new
Performance/LstripRstripcop. (@alexdowad) - #1677: Add new
Performance/StartWithcop. (@alexdowad) - #1677: Add new
Performance/EndWithcop. (@alexdowad) - #1677: Add new
Performance/RedundantMergecop. (@alexdowad) Lint/Debuggercop can now auto-correct offenses. (@alexdowad)- #1677: Add new
Performance/RedundantMatchcop. (@alexdowad) - #1677: Add new
Performance/RedundantBlockCallcop. (@alexdowad) - #1954:
Lint/UnneededDisablecan now autocorrect. (@alexdowad) - #2501: Add new
Lint/ImplicitStringConcatenationcop. (@alexdowad) - Add new
Style/RedundantParenthesescop. (@lumeet) - #1346:
Style/SpecialGlobalVarscan be configured to use eitheruse_english_namesoruse_perl_namesstyles. (@alexdowad) - #2426: New
Style/NestedParenthesizedCallscop checks for non-parenthesized method calls nested inside a parenthesized call, likemethod1(method2 arg). (@alexdowad) - #2502: The
--stdinand--auto-correctCLI options can be combined, and if you do so, corrected code is printed to stdout. (@alexdowad) Style/ConditionalAssignmentworks on conditionals with a common aref assignment (likearray[index] = val) or attribute assignment (likeself.attribute = val). (@alexdowad)- #2476:
Style/GuardClausecatches if..else nodes with one branch which terminates the execution of the current scope. (@alexdowad) - New
Style/IdenticalConditionalBranchesflagsif..elseandcase..when..elseconstructs with an identical line at the end of each branch. (@alexdowad) - #207: Add new
Lint/FloatOutOfRangecop which catches floating-point literals which are too large or too small for Ruby to represent. (@alexdowad) Style/GuardClausedoesn't report offenses in places where correction would make a line too long. (@alexdowad)Lint/DuplicateMethodscan find duplicate method definitions in many more circumstances, even across multiple files; however, it ignores definitions insideifor something which could be a DSL method. (@alexdowad)- A warning is printed if an invalid
EnforcedStyleis configured. (@alexdowad) - #1367: New
Lint/IneffectiveAccessModifierchecks for access modifiers which are erroneously applied to a singleton method, where they have no effect. (@alexdowad) - #1614:
Lint/BlockAlignmentaligns block end with splat operator when applied to a splatted method call. (@alexdowad) - #2263: Warn if
task.options = %w(--format ...)is used when configuringRuboCop::RakeTask; this should betask.formatters = ...instead. (@alexdowad) - #2511:
--no-offense-countsCLI option suppresses the inclusion of offense count lines in auto-generated config. (@alexdowad) - #2504: New
AllowForAlignmentconfig parameter forStyle/SingleSpaceBeforeFirstArgallows the insertion of extra spaces before the first argument if it aligns it with something on the preceding or following line. (@alexdowad) - #2478:
Style/ExtraSpacinghas newForceEqualSignAlignmentconfig parameter which forces = signs on consecutive lines to be aligned, and it can auto-correct. (@alexdowad) Lint/BlockAlignmentaligns block end with unary operators like ~, -, or ! when such operators are applied to the method call taking the block. (@alexdowad)- #1460:
Style/Aliassupports bothprefer_aliasandprefer_alias_methodstyles. (@alexdowad) - #1569: New
ExpectMatchingDefinitionconfig parameter forStyle/FileNamemakes it check for a class or module definition in each file which corresponds to the file name and path. (@alexdowad) - #2480: Add a configuration to
Style/ConditionalAssignmentto check and correct conditionals that contain multiple assignments. (@rrosenblum) - #2480: Allow
Style/ConditionalAssignmentto correct assignment in ternary operations. (@rrosenblum) - #2480: Allow
Style/ConditionalAssignmentto correct comparable methods. (@rrosenblum) - #1633: New cop
Style/MultilineMethodCallIndentationtakes over the responsibility for checking alignment of methods from theStyle/MultilineOperationIndentationcop. (@jonas054) - #2472: New cop
Style/MultilineArrayBraceLayoutchecks that the closing brace in an array literal is symmetrical with respect to the opening brace and the array elements. (@panthomakos) - #1543:
Style/WordArrayhas bothpercentandbrackets(which enforces the use of bracketed arrays for strings) styles. (@alexdowad) Style/SpaceAroundOperatorshasAllowForAlignmentconfig parameter which allows extra spaces on the left if they serve to align the operator with another. (@alexdowad)Style/SymbolArrayhas bothpercentandbrackets(which enforces the user of bracketed arrays for symbols) styles. (@alexdowad)- #2343: Entire cop types (or "departments") can be disabled using in .rubocop.yml using config like
Style: Enabled: false. (@alexdowad) - #2399: New
start_of_linestyle forLint/EndAlignmentaligns a closingendkeyword with the start of the line where the opening keyword appears. (@alexdowad) - #1545: New
Regexconfig parameter forStyle/FileNameallows user to provide their own regex for validating file names. (@alexdowad) - #2253: New
DefaultFormatterconfig parameter can be used to set formatter from within .rubocop.yml. (@alexdowad) - #2481: New
WorstOffendersFormatterprints a list of files with offenses (and offense counts), showing the files with the most offenses first. (@alexdowad) - New
IfInsideElsecop catchesif..endnodes which can be converted into anelsifinstead, reducing the nesting level. (@alexdowad) - #1725: --color CLI option forces color output, even when not printing to a TTY. (@alexdowad)
- #2549: New
ConsistentQuotesInMultilineconfig param forStyle/StringLiteralsforces all literals which are concatenated using \ to use the same quote style. (@alexdowad) - #2560:
Style/AccessModifierIndentation,Style/CaseIndentation,Style/FirstParameterIndentation,Style/IndentArray,Style/IndentAssignment,Style/IndentHash,Style/MultilineMethodCallIndentation, andStyle/MultilineOperationIndentationall have a newIndentationWidthparameter which can be used to override the indentation width fromStyle/IndentationWidth. (@alexdowad) - Add new
Performance/HashEachMethodscop. (@ojab) - New cop
Style/FrozenStringLiteralCommentwill check for and add the comment# frozen_string_literal: trueto the top of files. This will help with upgrading to Ruby 3.0. (@rrosenblum)
Bug Fixes
- #2594:
Style/EmptyLiteralautocorrector respectsStyle/StringLiterals:EnforcedStyleconfig. (@DNNX) - #2411: Make local inherited configuration override configuration loaded from gems. (@jonas054)
- #2413: Allow
%Qfor dynamic strings with double quotes inside them. (@jonas054) - #2404:
Style/Nextdoes not remove comments when auto-correcting. (@lumeet) Style/Nexthandles auto-correction of nested offenses. (@lumeet)Style/VariableInterpolationnow detects non-numeric regex back references. (@cgriego)ProgressFormatterfully respects the--no-colorswitch. (@savef)- Replace
Time.zone.currentwithTime.currentonRails::TimeZonecop message. (@volmer) - #2451:
Style/StabbyLambdaParenthesesdoes not treat method calls namedlambdaas lambdas. (@domcleal) - #2463: Allow comments before an access modifier. (@codebeige)
- #2471:
Style/MethodNamedoesn't choke on methods which are defined inside methods. (@alexdowad) - #2449:
Style/StabbyLambdaParenthesesonly checks lambdas in the arrow form. (@lumeet) - #2456:
Lint/NestedMethodDefinitiondoesn't register offenses for method definitions inside an eval block (eitherinstance_eval,class_eval, ormodule_eval). (@alexdowad) - #2464:
Style/ParallelAssignmentunderstands aref and attribute assignments, and doesn't warn if they can't be correctly rearranged into a series of single assignments. (@alexdowad) - #2482:
Style/AndOrdoesn't raise an exception when trying to autocorrect!variable or .... (@alexdowad) - #2446:
Style/Tabdoesn't register errors for leading tabs which occur inside a string literal (including heredoc). (@alexdowad) - #2452:
Style/TrailingCommaincorrectly categorizes single-line hashes in methods calls. (@panthomakos) - #2441:
Style/AlignParametersdoesn't crash if it finds nested offenses. (@alexdowad) - #2436:
Style/SpaceInsideHashLiteralBracesdoesn't mangle a hash literal which is not surrounded by curly braces, but has another hash literal which does as its first key. (@alexdowad) - #2483:
Style/Attrdifferentiate between attr_accessor and attr_reader. (@weh) Style/ConditionalAssignmentdoesn't crash if it finds acasewith an empty branch. (@lumeet)- #2506:
Lint/FormatParameterMismatchunderstands %{} and %<> interpolations. (@alexdowad) - #2145:
Lint/ParenthesesAsGroupedExpressionignores calls with multiple arguments, since they are not ambiguous. (@alexdowad) - #2484: Remove two vulnerabilities in cache handling. (@jonas054)
- #2517:
Lint/UselessAccessModifierdoesn't think that an access modifier applied toattr_writeris useless. (@alexdowad) - #2518:
Style/ConditionalAssignmentdoesn't think that branches using<<and[]=should be combined. (@alexdowad) CharacterLiteralauto-corrector now properly corrects?'. (@bfontaine)- #2313:
Rails/FindEachdoesn't break code which usesorder(...).each,limit(...).each, and so on. (@alexdowad) - #1938:
Rails/FindBydoesn't autocorrectwhere(...).firsttofind_by, since the returned record is often different. (@alexdowad) - #1801:
EmacsFormatterstrips newlines out of error messages, if there are any. (@alexdowad) - #2534:
Style/RescueEnsureAlignmentworks onrescuenested inside aclassormoduleblock. (@alexdowad) Lint/BlockAlignmentdoes not refer to a block terminator asendwhen it is actually}. (@alexdowad)- #2540:
Lint/FormatParameterMismatchunderstands format specifiers with multiple flags. (@alexdowad) - #2538:
Style/SpaceAroundOperatorsdoesn't eat newlines. (@alexdowad) - #2531:
Style/AndOrautocorrects in cases where parentheses must be added, even inside a nested begin node. (@alexdowad) - #2450:
Style/Nextadjusts indentation when auto-correcting, to avoid introducing new offenses. (@alexdowad) - #2066:
Style/TrivialAccessorsdoesn't flag what appear to be trivial accessor method definitions, if they are nested inside a call toinstance_eval. (@alexdowad) Style/SymbolArraydoesn't flag arrays of symbols if a symbol contains a space character. (@alexdowad)Style/SymbolArraycan auto-correct offenses. (@alexdowad)- #2546: Report when two
rubocop:disablecomments (not the single line kind) for a given cop apppear in a file with norubocop:enablein between. (@jonas054) - #2552:
Style/Encodingcan auto-correct files with a blank first line. (@alexdowad) - #2556:
Style/SpecialGlobalVariablesgenerates auto-config correctly. (@alexdowad) - #2565: Let
Style/SpaceAroundOperatorsleave spacing around=>toStyle/AlignHash. (@jonas054) - #2569:
Style/MethodCallParenthesesdoesn't register warnings forobject.()syntax, since it is handled byStyle/LambdaCall. (@alexdowad) - #2570:
Performance/RedundantMergedoesn't break code with a modifierifwhen autocorrecting. (@alexdowad) Performance/RedundantMergedoesn't break code with a modifierwhileoruntilwhen autocorrecting. (@alexdowad)- #2574:
variablestyle forLint/EndAlignmentis working again. (@alexdowad) Lint/EndAlignmentcan autocorrect offenses on the RHS of an assignment to an instance variable, class variable, constant, and so on; previously, it only worked if the LHS was a local variable. (@alexdowad)- #2580:
Style/StringReplacementdoesn't break code when autocorrection involves a regex with embedded escapes (like /\n/). (@alexdowad) - #2582:
Style/AlignHashdoesn't move a key so far left that it goes onto the previous line (in an attempt to align). (@alexdowad) - #2588:
Style/SymbolProcdoesn't break code when autocorrecting a method call with a trailing comma in the argument list. (@alexdowad) - #2448:
Style/TrailingCommaInArgumentsandStyle/TrailingCommaInLiteraldon't special-case single-item lists in a way which contradicts the documentation. (@alexdowad) - Fix for remote config files to only load from on http and https URLs. (@ptrippett)
- #2604:
Style/FileNamedoesn't fail on empty files whenExpectMatchingDefinitionis true. (@alexdowad) Style/RedundantFreezeregisters offences for frozen dynamic symbols. (@segiddins)- #2609: All cops which rely on the
AutocorrectUnlessChangingASTmodule can now autocorrect files which contain__FILE__. (@alexdowad) - #2608:
Style/ConditionalAssignmentcan autocorrect=~within a ternary expression. (@alexdowad)
Changes
- #2427: Allow non-snake-case file names (e.g.
some-random-script) for Ruby scripts that have a shebang. (@sometimesfood) - #2430:
Lint/UnneededDisablenow adds "unknown cop" to messages if cop names inrubocop:disablecomments are unrecognized, or "did you mean ..." if they are misspelled names of existing cops. (@jonas054) - #947:
Style/Documentationconsiders classes and modules which only define constants to be "namespaces", and doesn't flag them for lack of a documentation comment. (@alexdowad) - #2467: Explicitly inheriting configuration from the rubocop gem in .rubocop.yml is not allowed. (@alexdowad)
- #2322: Output of --auto-gen-config shows content of default config parameters which are Arrays; this is especially useful for SupportedStyles. (@alexdowad)
- #1566: When autocorrecting on Windows, line endings are not converted to "\r\n" in untouched portions of the source files; corrected portions may use "\n" rather than "\r\n". (@alexdowad)
- New
rake repltask can be used for experimentation when working on RuboCop. (@alexdowad) Lint/SpaceBeforeFirstArgcop has been removed, since it just duplicatesStyle/SingleSpaceBeforeFirstArg. (@alexdowad)Style/SingleSpaceBeforeFirstArgcop has been renamed toStyle/SpaceBeforeFirstArg, which more accurately reflects what it now does. (@alexdowad)Style/UnneededPercentQreports%q()strings with what only appears to be an escape, but is not really (there are no escapes in%q()strings). (@alexdowad)Performance/StringReplacement,Performance\StartWith, andPerformance\EndWithmore accurately identify code which can be improved. (@alexdowad)- The
MultiSpaceAllowedForOperatorsconfig parameter forStyle/SpaceAroundOperatorshas been removed, as it is made redundant byAllowForAlignment. If someone attempts to use it, config validation will fail with a helpful message. (@alexdowad) - The
RunRailsCopsconfig parameter in .rubocop.yml is now obsolete. If someone attempts to use it, config validation will fail with a helpful message. (@alexdowad) - If .rubocop.yml contains configuration for a custom cop, no warning regarding "unknown cop" will be printed. The custom cop must inherit from RuboCop::Cop::Cop, and must be loaded into memory for this to work. (@alexdowad)
- #2102: If .rubocop.yml exists in the working directory when running --auto-gen-config, any
Excludeconfig parameters in .rubocop.yml will be merged into the generated .rubocop_todo.yml. (@alexdowad) - #1895: Remove
Rails/DefaultScopecop. (@alexdowad) - #2550: New
TargetRubyVersionconfiguration parameter can be used to specify which version of the Ruby interpreter the inspected code is intended to run on. (@alexdowad) - #2557:
Style/GuardClausedoes not warn aboutifnodes whose condition spans multiple lines. (@alexdowad) Style/EmptyLinesAroundClassBody,Style/EmptyLinesAroundModuleBody, andStyle/EmptyLinesAroundBlockBodyaccept an empty body with no blank line, even if configured toempty_linesstyle. This is because the empty lines only serve to provide a break between the header, body, and footer, and are redundant if there is no body. (@alexdowad)- #2554:
Style/FirstMethodArgumentLineBreakhandles implicit hash arguments without braces;Style/FirstHashElementLineBreakstill handles those with braces. (@alexdowad) Style/TrailingCommahas been split intoStyle/TrailingCommaInArgumentsandStyle/TrailingCommaInLiteral. (@alexdowad)- RuboCop returns process exit code 2 if it fails due to bad configuration, bad CLI options, or an internal error. If it runs successfully but finds one or more offenses, it still exits with code 1, as was previously the case. This is helpful when invoking RuboCop programmatically, perhaps from a script. (@alexdowad)
- Ruby
Published by bbatsov about 10 years ago
https://github.com/rubocop/rubocop - RuboCop 0.35.0
Special thanks to Alex Dowad who
contributed an amazing number of bug fixes and improvements for this
release! Much appreciated!
And happy birthday to my beloved granny Vasilka, who turns today 78 years!
This release is dedicated to her!
New features
- #2028: New config
ExtraDetailssupports addition ofDetailsparam to all cops to allow extra details on offense to be displayed. (@tansaku) - #2036: New cop
Style/StabbyLambdaParentheseswill find and correct cases where a stabby lambda's paramaters are not wrapped in parentheses. (@hmadison) - #2246:
Style/TrailingUnderscoreVariablewill now register an offense for*_. (@rrosenblum) - #2246:
Style/TrailingUnderscoreVariablenow has a configuration to remove named underscore variables (Defaulted to false). (@rrosenblum) - #2276: New cop
Performance/FixedSizewill register an offense when callinglength,size, orcounton statically sized objected (strings, symbols, arrays, and hashes). (@rrosenblum) - New cop
Style/NestedModifierchecks for nestedif,unless,whileanduntilmodifier statements. (@lumeet) - #2270: Add a new
inherit_gemconfiguration to inherit a config file from an installed gem (originally requested in #290). (@jhansche) - Allow
StyleGuideparameters in local configuration for all cops, so users can add references to custom style guide documents. (@cornelius) UnusedMethodArgumentcop allows configuration to skip keyword arguments. (@apiology)- #2318:
Lint/Debuggercop now checks forPry.rescue. (@rrosenblum) - #2277: New cop
Style/FirstArrayElementLineBreakchecks for a line break before the first element in a multi-line array. (@panthomakos) - #2277: New cop
Style/FirstHashElementLineBreakchecks for a line break before the first element in a multi-line hash. (@panthomakos) - #2277: New cop
Style/FirstMethodArgumentLineBreakchecks for a line break before the first argument in a multi-line method call. (@panthomakos) - #2277: New cop
Style/FirstMethodParameterLineBreakchecks for a line break before the first parameter in a multi-line method parameter definition. (@panthomakos) - Add
Rails/PluralizationGrammarcop, checks for incorrect grammar when using methods like3.day.ago, when you should write3.days.ago. (@maxjacobson) - #2347:
Lint/Evalcop does not warn about "security risk" when eval argument is a string literal without interpolations. (@alexdowad) - #2335:
Style/VariableNamecop checks naming style of method parameters. (@alexdowad) - #2329: New style
braces_for_chainingforStyle/BlockDelimiterscop enforces braces on a multi-line block if its return value is being chained with another method. (@panthomakos) Lint/LiteralInConditionwarns if a symbol or dynamic symbol is used as a condition. (@alexdowad)- #2369:
Style/TrailingCommadoesn't add a trailing comma to a multiline method chain which is the only arg to a method call. (@alexdowad) CircularArgumentReferencecop updated to lint for ordinal circular argument references on top of optional keyword arguments. (@maxjacobson)- Added ability to download shared rubocop config files from remote urls. (@ptrippett)
- #1601: Add
IgnoreEmptyMethodsconfig parameter forLint/UnusedMethodArgumentandIgnoreEmptyBlocksconfig parameter forLint/UnusedBlockArgumentcops. (@alexdowad) - #1729:
Style/MethodDefParenthesessupports new 'require_no_parentheses_except_multiline' style. (@alexdowad) - #2173:
Style/AlignParametersalso checks parameter alignment for method definitions. (@alexdowad) - #1825: New
NameWhitelistconfiguration parameter forStyle/PredicateNamecan be used to suppress errors on known-good predicate names. (@alexdowad) Style/Documentationrecognizes 'Constant = Class.new' as a class definition. (@alexdowad)- #1608: Add new 'align_braces' style for
Style/IndentHash. (@alexdowad) Style/Nextcan autocorrect. (@alexdowad)
Bug Fixes
- #2265: Handle unary
+inExtraSpacingcop. (@jonas054) - #2275: Copy default
ExcludeintoExcludelists in.rubocop_todo.yml. (@jonas054) Style/IfUnlessModifieraccepts blocks followed by a chained call. (@lumeet)- #2261: Make relative
Excludepaths in$HOME/.rubocop_todo.ymlbe relative to current directory. (@jonas054) - #2286: Handle auto-correction of empty method when
AllowIfMethodIsEmptyisfalseinStyle/SingleLineMethods. (@jonas054) - #2246: Do not register an offense for
Style/TrailingUnderscoreVariablewhen the underscore variable is preceeded by a splat variable. (@rrosenblum) - #2292: Results should not be stored in the cache if affected by errors (crashes). (@jonas054)
- #2280: Avoid reporting space between hash literal keys and values in
Style/ExtraSpacing. (@jonas054) - #2284: Fix result cache being shared between ruby versions. (@miquella)
- #2285: Fix
ConfigurableNaming#class_emitter_method?error when handling singleton class methods. (@palkan) - #2295: Fix Performance/Detect autocorrect to handle rogue newlines. (@palkan)
- #2294: Do not register an offense in
Performance/StringReplacementfor regex with options. (@rrosenblum) - Fix
Style/UnneededPercentQcondition for single-quoted literal containing interpolation-like string. (@eagletmt) - #2324: Handle
--only Lint/Syntaxand--except Lint/Syntaxcorrectly. (@jonas054) - #2317: Handle
caseas an argument correctly inLint/EndAlignment. (@lumeet) - #2287: Fix auto-correct of lines with only whitespace in
Style/IndentationWidth. (@lumeet) - #2331: Do not register an offense in
Performance/Sizeforcountwith an argument. (@rrosenblum) - Handle a backslash at the end of a line in
Style/SpaceAroundOperators. (@lumeet) - Don't warn about lack of "leading space" in a =begin/=end comment. (@alexdowad)
- #2307: In
Lint/FormatParameterMismatch, don't register an offense if either argument to % is not a literal. (@alexdowad) - #2356:
Style/Encodingwill now place the encoding comment on the second line if the first line is a shebang. (@rrosenblum) Style/InitialIndentationcop doesn't error out when a line begins with an integer literal. (@alexdowad)- #2296: In
Style/DotPosition, don't "correct" (and break) a method call which has a line comment (or blank line) between the dot and the selector. (@alexdowad) - #2272:
Lint/NonLocalExitFromIteratordoes not warn aboutreturnin a block which is passed toModule#define_method. (@alexdowad) - #2262: Replace
Rainbowreference withColorizable#yellow. (@minustehbare) - #2068: Display warning if
Style/Copyrightis misconfigured. (@alexdowad) - #2321: In
Style/EachWithObject, don't replace reduce with each_with_object if the accumulator parameter is assigned to in the block. (@alexdowad) - #1981:
Lint/UselessAssignmentdoesn't erroneously identify assignments in identical if branches as useless. (@alexdowad) - #2323:
Style/IfUnlessModifiercop parenthesizes autocorrected code when necessary due to operator precedence, to avoid changing its meaning. (@alexdowad) - #2003: Make
Lint/UnneededDisablework with--auto-correct. (@jonas054) - Default RuboCop cache dir moved to per-user folders. (@br3nda)
- #2393:
Style/MethodCallParenthesesdoesn't fail onobj.method ||= func(). (@alexdowad) - #2344: When autocorrecting,
Style/ParallelAssignmentreorders assignment statements, if necessary, to avoid breaking code. (@alexdowad) Style/MultilineOperationAlignmentdoes not try to align the receiver and selector of a method call if both are on the LHS of an assignment. (@alexdowad)
Changes
- Ruby
Published by bbatsov over 10 years ago
https://github.com/rubocop/rubocop - RuboCop 0.34.2
Bug Fixes
- #2232: Fix false positive in
Lint/FormatParameterMismatchfor argument with splat operator. (@dreyks) - #2237: Allow
Lint/FormatParameterMismatchto be called usingKernel.formatandKernel.sprintf. (@rrosenblum) - #2234: Do not register an offense for
Lint/FormatParameterMismatchwhen the format string is a variable. (@rrosenblum) - #2240:
Lint/UnneededDisableshould not report non-Lintrubocop:disablecomments when runningrubocop --lint. (@jonas054) - #2121: Allow space before values in hash literals in
Style/ExtraSpacingto avoid correction conflict. (@jonas054) - #2241: Read cache in binary format. (@jonas054)
- #2247: Fix auto-correct of
Performance/CaseWhenSplatfor percent arrays (%w,%W,%i, and%I). (@rrosenblum) - #2244: Disregard annotation keywords in
Style/CommentAnnotationif they don't start a comment. (@jonas054) - #2257: Fix bug where
Style/RescueEnsureAlignmentwill register an offense forrescueandensureon the same line. (@rrosenblum) - #2255: Refine the offense highlighting for
Style/SymbolProc. (@bbatsov) - #2260: Make
Excludein.rubocop_todo.ymlwork when running from a subdirectory. (@jonas054)
Changes
- #2248: Allow block-pass in
Style/AutoResourceCleanup. (@lumeet) - #2258:
Style/Documentationwill exclude test directories by default. (@rrosenblum) - #2260: Disable
Style/StringMethodsby default. (@bbatsov)
- Ruby
Published by bbatsov over 10 years ago
https://github.com/rubocop/rubocop - RuboCop 0.34.1
Bug Fixes
- #2212: Handle methods without parentheses in auto-correct. (@karreiro)
- #2214: Fix
File name too long errorwhenSTDINoption is provided. (@mrfoto) - #2217: Allow block arguments in
Style/SymbolProc. (@lumeet) - #2213: Write to cache with binary encoding to avoid transcoding exceptions in some locales. (@jonas054)
- #2218: Fix loading config error when safe yaml is only partially loaded. (@maxjacobson)
- #2161: Allow an explicit receiver (except
Kernel) inStyle/SignalException. (@lumeet)
- Ruby
Published by bbatsov over 10 years ago
https://github.com/rubocop/rubocop - RuboCop 0.34
Apart from the usual myriad of bugfixes, improvements and new cops,
this version introduces a results caching functionality. This
functionality will speed up tremendously consecutive RuboCop runs on
the same codebase.
Another news to share with you - the project now has a crowdfunding
campaign here. If you like RuboCop
you might consider supporting its development.
Enjoy!
New features
- #2143: New cop
Performance/CaseWhenSplatwill identify and rearangecasewhenstatements that contain awhencondition with a splat. (@rrosenblum) - New cop
Lint/DuplicatedKeychecks for duplicated keys in hashes, which Ruby 2.2 warns against. (@sliuu) - #2106: Add
SuspiciousParamNamesoption toStyle/OptionHash. (@wli) - #2193:
Style/Nextsupports moreEnumerablemethods. (@rrosenblum) - #2179: Add
--list-target-filesoption to CLI, which prints the files which will be inspected. (@maxjacobson) - New cop
Style/MutableConstantchecks for assignment of mutable objects to constants. (@bbatsov) - New cop
Style/RedudantFreezechecks for usages ofObject#freezeon immutable objects. (@bbatsov) - #1924: New option
--cacheand configuration parameterAllCops: UseCacheturn result caching on (default) or off. (@jonas054) - #2204: New cop
Style/StringMethodswill check for preferred methodto_symoverintern. (@imtayadeway)
Changes
- #1351: Allow class emitter methods in
Style/MethodName. (@jonas054) - #2126:
Style/RescueModifiercan now auto-correct. (@rrosenblum) - #2109: Allow alignment with a token on the nearest line with same indentation in
Style/ExtraSpacing. (@jonas054) Lint/EndAlignmenthandles thecasekeyword. (@lumeet)- #2146: Add STDIN support. (@caseywebdev)
- #2175: Files that are excluded from a cop (e.g. using the
Exclude:config option) are no longer being processed by that cop. (@bquorning) Rails/ActionFilternow handles complete list of methods found in the Rails 4.2 release notes. (@MGerrior)- *2138: Change the offense in
Style/Nextto highlight the condition instead of the iteration. (@rrosenblum) Style/EmptyLineBetweenDefsnow handles class methods as well. (@unmanbearpig)- Improve handling of
superinStyle/SymbolProc. (@lumeet) Style/SymbolProcis applied to methods receiving arguments. (@lumeet)- #1839: Remove Rainbow monkey patching of String which conflicts with other gems like colorize. (@daviddavis)
Style/HashSyntaxis now a bit faster when checking Ruby 1.9 syntax hash keys. (@bquorning)Lint/DeprecatedClassMethodsis now a whole lot faster. (@bquorning)Lint/BlockAlignment,Style/IndentationWidth, andStyle/MultilineOperationIndentationare now quite a bit faster. (@bquorning)
Bug Fixes
- #2123: Fix handing of dynamic widths
Lint/FormatParameterMismatch. (@edmz) - #2116: Fix named params (using hash)
Lint/FormatParameterMismatch. (@edmz) - #2135: Ignore
superandzsupernodes inStyle/SymbolProc. (@bbatsov) - #2165: Fix a NPE in
Style/Alias. (@bbatsov) - #2168: Fix a NPE in
Rails/TimeZone. (@bbatsov) - #2169: Fix a NPE in
Rails/Date. (@bbatsov) - #2105: Fix a warning that was thrown when enabling
Style/OptionHash. (@wli) - #2107: Fix auto-correct of
Style/ParallelAssignmentfor nested expressions. (@rrosenblum) - #2111: Deal with byte order mark in
Style/InitialIndentation. (@jonas054) - #2113: Handle non-string tokens in
Style/ExtraSpacing. (@jonas054) - #2129: Handle empty interpolations in
Style/SpaceInsideStringInterpolation. (@lumeet) - #2119: Do not raise an error in
Style/RescueEnsureAlignmentandStyle/RescueModifierwhen processing an excluded file. (@rrosenblum) - #2149: Do not register an offense in
Rails/DatewhenDate#to_timeis called with a time zone argument. (@maxjacobson) - Do not register a
Rails/TimeZoneoffense when using Time.new safely. (@maxjacobson) - #2124: Fix bug in
Style/EmptyLineBetweenDefswhen there are only comments between method definitions. (@lumeet) - #2154:
Performance/StringReplacementcan auto-correct replacements with backslash in them. (@rrosenblum) - #2009: Fix bug in
RuboCop::ConfigLoader.load_filewhensafe_yamlis required. (@eitoball) - #2155: Configuration
EndAlignment: AlignWith: variableonly applies when the operands of=are on the same line. (@jonas054) - Fix bug in
Style/IndentationWidthwhenrescueorensureis preceded by an empty body. (@lumeet) - #2183: Fix bug in
Style/BlockDelimiterswhen auto-correcting adjacent braces. (@lumeet) - #2199: Make
rubocopexit with error when there are onlyLint/UnneededDisableoffenses. (@jonas054) - Fix handling of empty parentheses when auto-correcting in
Style/SymbolProc. (@lumeet)
- Ruby
Published by bbatsov over 10 years ago
https://github.com/rubocop/rubocop - RuboCop 0.33.0
New features
- #2081: New cop
Style/Sendchecks for the use ofsendand instead encourages changing it toBasicObject#__send__orObject#public_send(disabled by default). (@syndbg) - #2057: New cop
Lint/FormatParameterMismatchchecks for a mismatch between the number of fields expected in format/sprintf/% and what was pased to it. (@edmz) - #2010: Add
spacestyle for SpaceInsideStringInterpolation. (@gotrevor) - #2007: Allow any modifier before
def, not only visibility modifiers. (@fphilipe) - #1980:
--auto-gen-confignow outputs an excluded files list for failed cops (up to a maxiumum of 15 files). (@bmorrall) - #2004: Introduced
--exclude-limit COUNTto configure how many files--auto-gen-configwill exclude. (@awwaiid, @jonas054) - #1918: New configuration parameter
AllCops:DisabledByDefaultwhen set totruemakes only cops found in user configuration enabled, which makes cop selection opt-in. (@jonas054) - New cop
Performance/StringReplacementchecks for usages ofgsubthat can be replaced withtrordelete. (@rrosenblum) - #2001: New cop
Style/InitialIndentationchecks for indentation of the first non-blank non-comment line in a file. (@jonas054) - #2060: New cop
Style/RescueEnsureAlignmentchecks for bad alignment ofrescueandensurekeywords. (@lumeet) - New cop
Style/OptionalArgumentschecks for optional arguments that do not appear at the end of an argument list. (@rrosenblum) - New cop
Lint/CircularArgumentReferencechecks for "circular argument references" in keyword arguments, which Ruby 2.2 warns against. (@maxjacobson, @sliuu) - #2030: New cop
Lint/OptionHashchecks for option hashes and encourages changing them to keyword arguments (disabled by default). (@maxjacobson)
Changes
- #2052:
Style/RescueModifieruses token stream to identify offenses. (@urbanautomaton) - Rename
Rails/DateandRails/TimeZonestyle names to "strict" and "flexible" and make "flexible" to be default. (@palkan) - #2035:
Style/ExtraSpacingis now enabled by default and has a configuration parameterAllowForAlignmentthat istrueby default, making it allow extra spacing if it's used for alignment purposes. (@jonas054)
Bugs fixed
- #2014: Fix
Style/TrivialAccessorsto support AllowPredicates: false. (@gotrevor) - #1988: Fix bug in
Style/ParallelAssignmentwhen assigning fromModule::CONSTANT. (@rrosenblum) - #1995: Improve message for
Rails/TimeZone. (@palkan) - #1977: Fix bugs in
Rails/DateandRails/TimeZonewhen using namespaced Time/Date. (@palkan) - #1973: Do not register an offense in
Performance/Detectwhenselectis called onEnumerable::Lazy. (@palkan) - #2015: Fix bug occurring for auto-correction of a misaligned
endin a file with only one method. (@jonas054) - Allow string interpolation segments inside single quoted string literals when double quotes are preferred. (@segiddins)
- #2026: Allow
Time.currentwhen style is "acceptable".(@palkan) - #2029: Fix bug where
Style/RedundantReturnauto-corrects returning implicit hashes to invalid syntax. (@rrosenblum) - #2021: Fix bug in
Style/BlockDelimiterswhen asemanticexpression is used in an array or a range. (@lumeet) - #1992: Allow parentheses in assignment to a variable with the same name as the method's in
Style/MethodCallParentheses. (@lumeet) - #2045: Fix crash in
Style/IndentationWidthwhen usingprivate_class_method def self.foosyntax. (@unmanbearpig) - #2006: Fix crash in
Style/FirstParameterIndentationin case of nested offenses. (@unmanbearpig) - #2059: Don't check for trivial accessors in modules. (@bbatsov)
- Add proper punctuation to the end of offense messages, where it is missing. (@lumeet)
- #2071: Keep line breaks in place on WordArray autocorrect.(@unmanbearpig)
- #2075: Properly correct
Style/PercentLiteralDelimiterswith escape characters in them. (@rrosenblum) - #2023: Avoid auto-correction corruption in
IndentationWidth. (@jonas054) - #2080: Properly parse code in
Performance/Countwhen callingselect..countin a class that extends an enumerable. (@rrosenblum) - #2093: Fix bug in
Style/OneLineConditionalwhich should not raise an offense with an 'if/then/end' statement. (@sliuu)
- Ruby
Published by bbatsov over 10 years ago
https://github.com/rubocop/rubocop - RuboCop 0.32.1
New features
Debuggercop now checks catches methods called with arguments. (@crazydog115)
Bugs fixed
- Make it possible to disable
Lint/UnneededDisable. (@jonas054) - #1958: Show name of
Lint/UnneededDisablewhen-D/--display-cop-namesis given. (@jonas054) - Do not show
Style/NonNilCheckoffenses as corrected when the source code is not modified. (@rrosenblum) - Fix auto-correct in
Style/RedundantReturnwhenreturnhas no arguments. (@lumeet) - #1955: Fix false positive for
Style/TrailingCommacop. (@mattjmcnaughton) - #1928: Avoid auto-correcting two alignment offenses in the same area at the same time. (@jonas054)
- #1964: Fix
RedundantBeginauto-correct issue with comments by doing a smaller correction. (@jonas054) - #1978: Don't count disabled offences if fail-level is autocorrect. (@sch1zo)
- #1986: Fix Date false positives on variables. (@palkan)
Changes
- #1708: Improve message for
FirstParameterIndentation. (@tejasbubane) - #1959: Allow
Lint/UnneededDisableto be inline disabled. (@rrosenblum)
- Ruby
Published by bbatsov over 10 years ago
https://github.com/rubocop/rubocop -
New features
- Adjust behavior of
TrailingCommacop to account for multi-line hashes nested within method calls. (@panthomakos) - #1719: Display an error and abort the program if input file can't be found. (@matugm)
- New cop
SpaceInsideStringInterpolationchecks for spaces within string interpolations. (@glasnt) - New cop
NestedMethodDefinitionchecks for method definitions inside other methods. (@ojab) LiteralInInterpolationcop does auto-correction. (@tmr08c)- #1865: New cop
Lint/UnneededDisablechecks forrubocop:disablecomments that can be removed. (@jonas054) EmptyElsecop does auto-correction. (@lumeet)- Show reference links when displaying style guide links. (@rrosenblum)
Debuggercop now checks for the Capybara debug methodsave_screenshot. (@crazydog115)- #1282:
CaseIndentationcop does auto-correction. (@lumeet) - #1928: Do auto-correction one offense at a time (rather than one cop at a time) if there are tabs in the code. (@jonas054)
Changes
- Prefer
SpaceInsideBlockBracestoSpaceBeforeSemicolonandSpaceAfterSemicolonto avoid an infinite loop when auto-correcting. (@lumeet) - #1873: Move
ParallelAssignmentcop from Performance to Style. (@rrosenblum) - Add
getlocalto acceptable methods ofRails/TimeZone. (@ojab) - #1851, #1948: Change offense message for
ClassLengthandModuleLengthto match that ofMethodLength. (@bquorning)
Bugs fixed
- Don't count required keyword args when specifying
CountKeywordArgs: falseforParameterLists. (@sumeet) - #1879: Avoid auto-correcting hash with trailing comma into invalid code in
BracesAroundHashParameters. (@jonas054) - #1868: Do not register an offense in
Performance/Countwhenselectis called with symbols or strings as the parameters. (@rrosenblum) Samplerewritten to properly handle shuffle randomness source, first/last params and non-literal ranges. (@chastell)- #1873: Modify
ParallelAssignmentto properly autocorrect when the assignment is protected by a modifier statement. (@rrosenblum) - Configure
ParallelAssignmentto work with non-standardIndentationWidths. (@rrosenblum) - #1899: Be careful about comments when auto-correcting in
BracesAroundHashParameters. (@jonas054) - #1897: Don't report that semicolon separated statements can be converted to modifier form in
IfUnlessModifier(and don't auto-correct them). (@jonas054) - #1644: Don't search the entire file system when a folder is named
,(fix for jruby and rbx). (@rrosenblum) - #1803: Don't warn for
returnfromlambdablock inNonLocalExitFromIterator. (@ypresto) - #1905: Ignore sparse and trailing comments in
Style/Documentation. (@RGBD) - #1923: Handle properly
forwithout body inStyle/Next. (@bbatsov) - #1901: Do not auto correct comments that are missing a note. (@rrosenblum)
- #1926: Fix crash in
Style/AlignHashwhen correcting a hash with a splat in it. (@rrosenblum) - #1935: Allow
Symbol#to_procblocks in Performance/Size. (@m1foley)
- Ruby
Published by bbatsov almost 11 years ago
https://github.com/rubocop/rubocop - RuboCop 0.31
New features
Rails/TimeZoneemits acceptable methods on a violation whenEnforcedStyleis:acceptable. (@l8nite)- Recognize rackup file (config.ru) out of the box. (@carhartl)
- #1788: New cop
ModuleLengthchecks for overly long module definitions. (@sdeframond) - New cop
Performance/Countto convertEnumerable#select...size,Enumerable#reject...size,Enumerable#select...count,Enumerable#reject...countEnumerable#select...length, andEnumerable#reject...lengthtoEnumerable#count. (@rrosenblum) CommentAnnotationcop does auto-correction. (@dylandavidson)- New cop
Style/TrailingUnderscoreVariableto remove trailing underscore variables from mass assignment. (@rrosenblum) - #1136: New cop
Performance/ParallelAssignmentto avoid usages of unnessary parallel assignment. (@rrosenblum) - #1278:
DefEndAlignmentandEndAlignmentcops do auto-correction. (@lumeet) IndentationWidthcop follows theAlignWithoption of theDefEndAlignmentcop. (@lumeet)- #1837: New cop
EachWithObjectArgumentchecks thateach_with_objectisn't called with an immutable object as argument. (@jonas054) ArrayJoincop does auto-correction. (@tmr08c)
Bugs fixed
- #1816: Fix bug in
Samplewhen calling#shufflewith something other than an element selector. (@rrosenblum) - #1768:
DefEndAlignmentrecognizes precedingprivate_class_methodorpublic_class_methodbeforedef. (@til) - #1820: Correct the logic in
AlignHashfor when to ignore a key because it's not on its own line. (@jonas054) - #1829: Fix bug in
SampleandFlatMapthat would cause them to report having been auto-corrected when they were not. (@rrosenblum) - #1832: Fix bug in
UnusedMethodArgumentthat would cause them to report having been auto-corrected when they were not. (@jonas054) - #1834: Support only boolean values for
AutoCorrectconfiguration parameter, and remove warning for unknown parameter. (@jonas054) - #1843: Fix crash in
TrailingBlankLineswhen a file ends with a block comment without final newline. (@jonas054) - #1849: Fix bug where you can not have nested arrays in the Rake task configuration. (@rrosenblum)
- Fix bug in
MultilineTernaryOperatorwhere it will not register an offense when only the false branch is on a separate line. (@rrosenblum) - Fix crash in
MultilineBlockLayoutwhen using new lambda literal syntax without parentheses. (@hbd225) - #1859: Fix bugs in
IfUnlessModifierconcerning comments and empty lines. (@jonas054) - Fix handling of trailing comma in
SpaceAroundBlockParametersandSpaceAfterComma. (@lumeet)
- Ruby
Published by bbatsov almost 11 years ago
https://github.com/rubocop/rubocop - RuboCop 0.30.1
Enjoy all those bug-fixes!
Bugs fixed
- #1691: For assignments with line break after
=, usekeywordalignment inEndAlignmentregardless of configured style. (@jonas054) - #1769: Fix bug where
LiteralInInterpolationregisters an offense for interpolation of__LINE__. (@rrosenblum) - #1773: Fix typo ('strptime' -> 'strftime') in
Rails/TimeZone. (@palkan) - #1777: Fix offense message from Rails/TimeZone. (@mzp)
- #1784: Add an explicit error message when config contains an empty section. (@bankair)
- #1791: Fix autocorrection of
PercentLiteralDelimiterswith no content. (@cshaffer) - Fix handling of
whileanduntilwith assignment inIndentationWidth. (@lumeet) - #1793: Fix bug in
TrailingCommathat caused,in comment to count as a trailing comma. (@jonas054) - #1765: Update 1.9 hash to stop triggering when the symbol is not valid in the 1.9 hash syntax. (@crimsonknave)
- #1806: Require a newer version of
parserand use its corrected solution for comment association inStyle/Documentation. (@jonas054) - #1792: Fix bugs in
Samplethat did not account for array selectors with a range and passing random to shuffle. (@rrosenblum) - #1770: Add more acceptable methods to
Rails/TimeZone(utc,localtime,to_i,iso8601etc). (@palkan) - #1795: Fix bug in
TrailingBlankLinesthat caused a crash for files containing only newlines. (@renuo)
- Ruby
Published by bbatsov almost 11 years ago
https://github.com/rubocop/rubocop - RuboCop 0.30.0
Nothing ground-breaking this time around, but the release is pretty exciting non-the-less.
It packs a whole new category of cops (Performance) and a bunch of new Rails cops.
A lot of the existing cops got new customization options and we squashed a ton of bugs.
Thanks to everyone who contributed to this release!
New features
- #1600: Add
line_count_basedandsemanticstyles to theBlockDelimiters(formerlyBlocks) cop. (@clowder, @mudge) - #1712: Set
Offense#corrected?totrue,false, ornilwhen it was, wasn't, or can't be auto-corrected, respectively. (@vassilevsky) - #1669: Add command-line switch
--display-style-guide. (@marxarelli) - #1405: Add Rails TimeZone and Date cops. (@palkan)
- #1641: Add ruby19_no_mixed_keys style to
HashStylecop. (@iainbeeston) - #1604: Add
IgnoreClassMethodsoption toTrivialAccessorscop. (@bbatsov) - #1651: The
Style/SpaceAroundOperatorscop now also detects extra spaces around operators. A list of operators that may be surrounded by multiple spaces is configurable. (@bquorning) - Add auto-correct to
Encodingcop. (@rrosenblum) - #1621:
TrailingCommahas a new styleconsistent_comma. (@tamird) - #1611: Add
empty,nil, andbothSupportedStylestoEmptyElsecop. Default isboth. (@rrosenblum) - #1611: Add new
MissingElsecop. Default is to have this cop be disabled. (@rrosenblum) - #1602: Add support for
# :nodocinDocumentation. (@lumeet) - #1437: Modify
HashSyntaxcop to allow the use of hash rockets for hashes that have symbol values when using ruby19 syntax. (@rrosenblum) - New cop
Style/SymbolLiteralmakes sure you're not using the string within symbol syntax unless it's needed. (@bbatsov) - #1657: Autocorrect can be turned off on a specific cop via the configuration. (@jdoconnor)
- New cop
Style/AutoResourceCleanupsuggests the use of block taking versions of methods that do resource cleanup. (@bbatsov) - #1275:
WhileUntilModifiercop does auto-correction. (@lumeet) - New cop
Performance/ReverseEachto convertreverse.eachtoreverse_each. (@rrosenblum) - #1281:
IfUnlessModifiercop does auto-correction. (@lumeet) - New cop
Performance/Detectto detect usage ofselect.first,select.last,find_all.first, andfind_all.lastand convert them to usedetectinstead. (@palkan, @rrosenblum) - #1728: New cop
NonLocalExitFromIteratorchecks for misusedreturnin block. (@ypresto) - New cop
Performance/Sizeto convert calls tocountonArrayandHashtosize. (@rrosenblum) - New cop
Performance/Sampleto convert usages ofshuffle.first,shuffle.last, andshuffle[Fixnum]tosample. (@rrosenblum) - New cop
Performance/FlatMapto convertEnumerable#map...Array#flattenandEnumerable#collect...Array#flattentoEnumerable#flat_map. (@rrosenblum) - #1144: New cop
ClosingParenthesisIndentationchecks the indentation of hanging closing parentheses. (@jonas054) - New Rails cop
FindByidentifies usages ofwhere.firstandwhere.take. (@bbatsov) - New Rails cop
FindEachidentifies usages ofall.each. (@bbatsov) - #1342:
IndentationConsistencyis now configurable with the stylesnormalandrails. (@jonas054)
Bugs fixed
- #1705: Fix crash when reporting offenses of
MissingElsecop. (@gerry3) - #1659: Fix stack overflow with JRuby and Windows 8, during initial config validation. (@pimterry)
- #1694: Ignore methods with a
blockarginTrivialAccessors. (@bbatsov) - #1617: Always read the html output template using utf-8. (@bbatsov)
- #1684: Ignore symbol keys like
:"string"inHashSyntax. (@bbatsov) - Handle explicit
beginblocks inLint/Void. (@bbatsov) - Handle symbols in
Lint/Void. (@bbatsov) - #1695: Fix bug with
--auto-gen-configandSpaceInsideBlockBraces. (@meganemura) - Correct issues with whitespace around multi-line lambda arguments. (@zvkemp)
- #1579: Fix handling of similar-looking blocks in
BlockAlignment. (@lumeet) - #1676: Fix auto-correct in
Lambdawhen a new multi-line lambda is used as an argument. (@lumeet) - #1656: Fix bug that would include hidden directories implicitly. (@jonas054)
- #1728: Fix bug in
LiteralInInterpolationandAssignmentInCondition. (@ypresto) - #1735: Handle trailing space in
LineEndConcatenationautocorrect. (@jonas054) - #1750: Escape offending code lines output by the HTML formatter in case they contain markup. (@jonas054)
- #1541: No inspection of text that follows
__END__. (@jonas054) - Fix comment detection in
Style/Documentation. (@lumeet) - #1637: Fix handling of
bindingcalls inUnusedBlockArgumentandUnusedMethodArgument. (@lumeet)
Changes
- #1397:
UnneededPercentXrenamed toCommandLiteral. The cop can be configured to enforce using either%xor backticks around command literals, or using%xaround multi-line commands and backticks around single-line commands. The cop ignores heredoc commands. (@bquorning) - #1020: Removed the
MaxSlashesconfiguration option forRegexpLiteral. Instead, the cop can be configured to enforce using either%ror slashes around regular expressions, or using%raround multi-line regexes and slashes around single-line regexes. (@bquorning) - #1734: The default exclusion of hidden directories has been optimized for speed. (@jonas054)
- #1673:
Style/TrivialAccessorsnow requires matching names by default. (@bbatsov)
- Ruby
Published by bbatsov almost 11 years ago
https://github.com/rubocop/rubocop - RuboCop 0.29.1
Bugs fixed
- #1638: Use Parser functionality rather than regular expressions for matching comments in
FirstParameterIndentation. (@jonas054) - #1642: Raise the correct exception if the configuration file is malformed. (@bquorning)
- #1647: Skip
SpaceAroundBlockParameterswhen lambda has no argument. (@eitoball) - #1649: Handle exception assignments in
UselessSetterCall. (@bbatsov) - #1644: Don't search the entire file system when a folder is named
,. (@bquorning)
- Ruby
Published by bbatsov about 11 years ago
https://github.com/rubocop/rubocop - RuboCop 0.29.0
New features
- #1430: Add
--exceptoption for disabling cops on the command line. (@jonas054) - #1506: Add auto-correct from
EvenOddcop. (@blainesch) - #1507:
Debuggercop now checks for the Capybara debug methodssave_and_open_pageandsave_and_open_screenshot. (@rrosenblum) - #1539: Implement autocorrection for Rails/ReadWriteAttribute cop. (@huerlisi)
- #1324: Add
AllCops/DisplayCopNamesconfiguration option for showing cop names in reports, like--display-cop-names. (@jonas054) - #1271:
Lambdacop does auto-correction. (@lumeet) - #1284: Support namespaces, e.g.
Lint, in the arguments to--onlyand--except. (@jonas054) - #1276:
SelfAssignmentcop does auto-correction. (@lumeet) - Add autocorrect to
RedundantException. (@mattjmcnaughton) - #1571: New cop
StructInheritancechecks for inheritance from Struct.new. (@mmozuras) - #1575: New cop
DuplicateMethodspoints out duplicate method name in class and module. (@d4rk5eed) - #1144: New cop
FirstParameterIndentationchecks the indentation of the first parameter in a method call. (@jonas054) - #1627: New cop
SpaceAroundBlockParameterschecks the spacing inside and after block parameters pipes. (@jonas054)
Changes
- #1492: Abort when auto-correct causes an infinite loop. (@dblock)
- Options
-e/--emacsand-s/--silentare no longer recognized. Using them will now raise an error. (@bquorning) - #1565: Let
--fail-level Acause exit with error if all offenses are auto-corrected. (@jonas054) - #1309: Add argument handling to
MultilineBlockLayout. (@lumeet)
Bugs fixed
- #1634: Fix
PerlBackrefsCop Autocorrections to Not Raise. (@cshaffer) - #1553: Fix bug where
Style/EmptyLinesAroundAccessModifierinterfered withStyle/EmptyLinesAroundBlockBodywhen there is and access modifier at the beginning of a block. (@volkert) - Handle element assignment in
Lint/AssignmentInCondition. (@jonas054) - #1484: Fix
EmptyLinesAroundAccessModifierincorrectly finding a violation inside method calls with names identical to an access modifier. (@dblock) - Fix bug concerning
Excludeproperties inherited from a higher directory level. (@jonas054) - #1500: Fix crashing
--auto-correct --only IndentationWidth. (@jonas054) - #1512: Fix false negative for typical string formatting examples. (@kakutani, @jonas054)
- #1504: Fail with a meaningful error if the configuration file is malformed. (@bquorning)
- Fix bug where
auto_correctRake tasks does not take in the options specified in its parent task. (@rrosenblum) - #1054: Handle comments within concatenated strings in
LineEndConcatenation. (@yujinakayama, @jonas054) - #1527: Make autocorrect
BracesAroundHashParameterleave the correct number of spaces. (@mattjmcnaughton) - #1547: Don't print
[Corrected]when auto-correction was avoided inStyle/Semicolon. (@jonas054) - #1573: Fix assignment-related auto-correction for
BlockAlignment. (@lumeet) - #1587: Exit with exit code 1 if there were errors ("crashing" cops). (@jonas054)
- #1574: Avoid auto-correcting
Hash.newto{}when braces would be interpreted as a block. (@jonas054) - #1591: Don't check parameters inside
[]inMultilineOperationIndentation. (@jonas054) - #1509: Ignore class methods in
Rails/Delegate. (@bbatsov) - #1594: Fix
@examplewarnings in Yard Doc documentation generation. (@mattjmcnaughton) - #1598: Fix bug in file inclusion when running from another directory. (@jonas054)
- #1580: Don't print
[Corrected]when auto-correction was avoided inTrivialAccessors. (@lumeet) - #1612: Allow
expand_pathoninherit_fromin.rubocop.yml. (@mattjmcnaughton) - #1610: Check that class method names actually match the name of the containing class/module in
Style/ClassMethods. (@bbatsov)
- Ruby
Published by bbatsov about 11 years ago
https://github.com/rubocop/rubocop - RuboCop 0.28
New features
- New cop
ExtraSpacingpoints out unnecessary spacing in files. (@blainesch) - New cop
EmptyLinesAroundBlockBodyprovides same functionality as the EmptyLinesAround(Class|Method|Module)Body but for blocks. (@jcarbo) - New cop
Style/EmptyElsechecks for emptyelse-clauses. (@Koronen) - #1454: New
--only-guide-copsandAllCops/StyleGuideCopsOnlyoptions that will only enforce cops that link to a style guide. (@marxarelli)
Changes
- #801: New style
context_dependentforStyle/BracesAroundHashParameterslooks at preceding parameter to determine if braces should be used for final parameter. (@jonas054) - #1427: Excluding directories on the top level is now done earlier, so that these file trees are not searched, thus saving time when inspecting projects with many excluded files. (@jonas054)
- #1325: When running with
--auto-correct, only offenses that can not be corrected will result in a non-zero exit code. (@jonas054) - #1445: Allow sprockets directive comments (starting with
#=) inStyle/LeadingCommentSpace. (@bbatsov)
Bugs fixed
- Fix
%W[]auto corrected to%w(]. (@toy) - Fix Style/ElseAlignment Cop to find the right parent on def/rescue/else/ensure/end. (@oneamtu)
- #1181: (fix again)
Style/StringLiteralscop stays away from strings inside interpolated expressions. (@jonas054) - #1441: Correct the logic used by
Style/Blocksand other cops to determine if an auto-correction would alter the meaning of the code. (@jonas054) - #1449: Handle the case in
MultilineOperationIndentationwhere instances of both correct style and unrecognized (plain wrong) style are detected during an--auto-gen-configrun. (@jonas054) - #1456: Fix autocorrect in
SymbolProcwhen there are multiple offenses on the same line. (@jcarbo) - #1459: Handle parenthesis around the condition in
--auto-correctforNegatedWhile. (@jonas054) - #1465: Fix autocorrect of code like
#$1inPerlBackrefs. (@bbatsov) - Fix autocorrect of code like
#$:inSpecialGlobalVars. (@bbatsov) - #1466: Allow leading underscore for unused parameters in
SingleLineBlockParams. (@jonas054) - #1470: Handle
elsif+elseinElseAlignment. (@jonas054) - #1474: Multiline string with both
<<and\caught byStyle/LineEndConcatenationcop. (@katieschilling) - #1485: Ignore procs in
SymbolProc. (@bbatsov) - #1473:
Style/MultilineOperationIndentationdoesn't recognize assignment to array/hash element. (@jonas054)
- Ruby
Published by bbatsov about 11 years ago
https://github.com/rubocop/rubocop - RuboCop 0.27.1
Changes
- #1343: Remove auto-correct from
RescueExceptioncop. (@bbatsov) - #1425:
AllCops/Includeconfiguration parameters are only taken from the project.rubocop.ymland files it inherits from, not from.rubocop.ymlfiles in subdirectories. (@jonas054)
Bugs fixed
- #1411: Handle lambda calls without a selector in
MultilineOperationIndentation. (@bbatsov) - #1401: Files in hidden directories, i.e. ones beginning with dot, can now be selected through configuration, but are still not included by default. (@jonas054)
- #1415: String literals concatenated with backslashes are now handled correctly by
StringLiteralsInInterpolation. (@jonas054) - #1416: Fix handling of
begin/rescue/else/endinElseAlignment. (@jonas054) - #1413: Support empty elsif branches in
MultilineIfThen. (@janraasch, @jonas054) - #1406: Allow a newline in
SpaceInsideRangeLiteral. (@bbatsov)
- Ruby
Published by bbatsov over 11 years ago
https://github.com/rubocop/rubocop - RuboCop 0.27.0
New features
- #1348: New cop
ElseAlignmentchecks alignment ofelseandelsifkeywords. (@jonas054) - #1321: New cop
MultilineOperationIndentationchecks indentation/alignment of binary operations if they span more than one line. (@jonas054) - #1077: New cop
Metrics/AbcSizechecks the ABC metric, based on assignments, branches, and conditions. (@jonas054, @jfelchner) - #1352:
WordArrayis now configurable with theWordRegexoption. (@bquorning) - #1181: New cop
Style/StringLiteralsInInterpolationchecks quotes inside interpolated expressions in strings. (@jonas054) - #872:
Style/IndentationWidthis now configurable with theWidthoption. (@jonas054) - #1396: Include
.opalfiles by default. (@bbatsov) - #771: Three new
Stylecops,EmptyLinesAroundMethodBody,EmptyLinesAroundClassBody, andEmptyLinesAroundModuleBodyreplace theEmptyLinesAroundBodycop. (@jonas054)
Changes
Bugs fixed
AlignHashno longer skips multiline hashes that contain some elements on the same line. (@mvz)- #1349:
BracesAroundHashParametersno longer cleans up whitespace in autocorrect, as these extra corrections are likely to interfere with other cops' corrections. (@jonas054) - #1350: Guard against
Blockscop introducing syntax errors in auto-correct. (@jonas054) - #1374: To eliminate interference, auto-correction is now done by one cop at a time, with saving and re-parsing inbetween. (@jonas054)
- #1388: Fix a false positive in
FormatString. (@bbatsov) - #1389: Make
--outto create parent directories. (@yous) - Refine HTML formatter. (@yujinakayama)
- #1410: Handle specially Java primitive type references in
ColonMethodCall. (@bbatsov)
- Ruby
Published by bbatsov over 11 years ago
https://github.com/rubocop/rubocop - RuboCop 0.26.1
RuboCop 0.26.1 is a bugfix-only release. Below is a list of the bugs we've fixed since 0.26.0:
Bugs fixed
- #1326: Fix problem in
SpaceInsideParenswith detecting space inside parentheses used for grouping expressions. (@jonas054) - #1335: Restrict URI schemes permitted by
LineLengthwhenAllowURIis enabled. (@smangelsdorf) - #1339: Handle
eql?andequal?inOpMethod. (@bbatsov) - #1340: Fix crash in
Style/SymbolProccop when the block calls a method with no explicit receiver. (@smangelsdorf)
- Ruby
Published by bbatsov over 11 years ago
https://github.com/rubocop/rubocop - RuboCop 0.26.0
Nothing particularly exciting this time around. The new release comes
with lots of bug fixes, more auto-corrections and several new cops.
Note that the Style/Encoding cop is now disabled by default. See
#1304 for the rationale behind this change.
Below is the list of all the gory details. Enjoy!
New features
- New formatter
HTMLFormattergenerates a html file with a list of files with offences in them. (@SkuliOskarsson) - New cop
SpaceInsideRangeLiteralchecks for spaces around..and...in range literals. (@bbatsov) - New cop
InfiniteLoopchecks for places whereKernel#loopshould have been used. (@bbatsov) - New cop
SymbolProcchecks for places where a symbol can be used as proc instead of a block. (@bbatsov) UselessAssignmentcop now suggests a variable name for possible typos if there's a variable-ish identifier similar to the unused variable name in the same scope. (@yujinakayama)PredicateNamecop now has separate configurations for prefices that denote predicate method names and predicate prefices that should be removed. (@bbatsov)- #1272:
Tabcop does auto-correction. (@yous) - #1274:
MultilineIfThencop does auto-correction. (@bbatsov) - #1279:
DotPositioncop does auto-correction. (@yous) - #1277:
SpaceBeforeFirstArgcop does auto-correction. (@yous) - #1310: Handle
module_functioninStyle/AccessModifierIndentationandStyle/EmptyLinesAroundAccessModifier. (@bbatsov)
Changes
- #1289: Use utf-8 as default encoding for inspected files. (@jonas054)
- #1304:
Style/Encodingis no longer a no-op on Ruby 2.x. It's also disabled by default, as projects not supporting 1.9 don't need to run it. (@bbatsov)
Bugs fixed
- #1263: Do not report
%Wliterals with special escaped characters inUnneededCapitalW. (@jonas054) - #1286: Fix a false positive in
VariableName. (@bbatsov) - #1211: Fix false negative in
UselessAssignmentwhen there's a reference for the variable in an exclusive branch. (@yujinakayama) - #1307: Fix auto-correction of
RedundantBegincop deletes new line. (@yous) - #1283: Fix auto-correction of indented expressions in
PercentLiteralDelimiters. (@jonas054) - #1315:
BracesAroundHashParametersauto-correction removes whitespace around content inside braces. (@jspanjers) - #1313: Fix a false positive in
AndOrwhen enforced style isconditionals. (@bbatsov) - Handle post-conditional
whileanduntilinAndOrwhen enforced style isconditionals. (@yujinakayama) - #1319: Fix a false positive in
FormatString. (@bbatsov) - #1287: Allow missing blank line for EmptyLinesAroundAccessModifier if next line closes a block. (@sch1zo)
- Ruby
Published by bbatsov over 11 years ago
https://github.com/rubocop/rubocop - RuboCop 0.25.0
This release comes with lots of bug fixes and several new cops (that will likely need bugfixes in the next release :-)).
The most notable change in 0.25 is the addition of the Metrics namespace. Several Style cops have been moved there
(e.g. ClassLength, MethodLength, etc).
This release also marks the end of us supporting Ruby 1.9.2 - now Ruby 1.9.3+ is required.
Below is the list of all the gory details. Enjoy!
New features
- #1259: Allow AndOr cop to autocorrect by adding method call parenthesis. (@vrthra)
- #1232: Add EnforcedStyle option to cop
AndOrto restrict it to conditionals. (@vrthra) - #835: New cop
PercentQLiteralschecks if use of%Qand%qmatches configuration. (@jonas054) - #835: New cop
BarePercentLiteralschecks if usage of%()or%Q()matches configuration. (@jonas054) - #1079: New cop
MultilineBlockLayoutchecks if a multiline block has an extpression on the same line as the start of the block. (@barunio) - #1217:
Style::EmptyLinesAroundAccessModifiercop does auto-correction. (@tamird) - #1220: New cop
PerceivedComplexityis similar toCyclomaticComplexity, but reports when methods have a high complexity for a human reader. (@jonas054) Debuggercop now checks forbinding.pry_remote. (@yous)- #1238: Add
MinBodyLengthoption toNextcop. (@bbatsov) - #1241:
TrailingCommacop does auto-correction. (@yous) - #1078: New cop
BlockEndNewlinechecks if the end statement of a multiline block is on its own line. (@barunio) - #1078:
BlockAlignmentcop does auto-correction. (@barunio)
Changes
- #1220: New namespace
Metricscreated and someStylecops moved there. (@jonas054) - Drop support for Ruby 1.9.2 in accordance with the end of the security maintenance extension. (@yujinakayama)
Bugs fixed
- #1251: Fix
PercentLiteralDelimitersauto-correct indentation error. (@hannestyden) - #1197: Fix false positive for new lambda syntax in
SpaceInsideBlockBraces. (@jonas054) - #1201: Fix error at anonymous keyword splat arguments in some variable cops. (@yujinakayama)
- Fix false positive in
UnneededPercentQfor/%Q(something)/. (@jonas054) - Fix
SpacesInsideBracketsforHash#[]calls with spaces after left bracket. (@mcls) - #1210: Fix false positive in
UnneededPercentQfor%Q(\t"). (@jonas054) - Fix false positive in
UnneededPercentQfor heredoc strings with%q/%Q. (@jonas054) - #1214: Don't destroy code in
AlignHashautocorrect. (@jonas054) - #1219: Don't report bad alignment for
endor}inBlockAlignmentif it doesn't begin its line. (@jonas054) - #1227: Don't permanently change yamler as it can affect other apps. (@jonas054)
- #1184: Fix a false positive in
Outputcop. (@bbatsov) - #1256: Ignore block-pass in
TrailingComma. (@tamird) - #1255: Compare without context in
AutocorrectUnlessChangingAST. (@jonas054) - #1262: Handle regexp and backtick literals in
VariableInterpolation. (@bbatsov)
- Ruby
Published by bbatsov over 11 years ago
https://github.com/rubocop/rubocop - RuboCop 0.24.1
RuboCop 0.24.1 is a bugfix-only release. Below is a list of the bugs we've fixed since 0.24.0:
Bugs fixed
- #1174: Fix
--auto-correctcrash inAlignParameters. (@jonas054) - #1176: Fix
--auto-correctcrash inIndentationWidth. (@jonas054) - #1177: Avoid suggesting underscore-prefixed name for unused keyword arguments and auto-correcting in that way. (@yujinakayama)
- #1157: Validate
--onlyarguments later when all cop names are known. (@jonas054) - #1188, #1190: Fix crash in
LineLengthcop whenAllowURIoption is enabled. (@yujinakayama) - #1191: Fix crash on empty body branches in a loop in
Nextcop. (@yujinakayama)
- Ruby
Published by yujinakayama over 11 years ago
https://github.com/rubocop/rubocop - RuboCop 0.24.0
This release is mostly about fixing bugs, but it also features a few new cops.
Below is the list of all the gory details. Enjoy!
New features
- #639: Support square bracket setters in
UselessSetterCall. (@yujinakayama) - #835:
UnneededCapitalWcop does auto-correction. (@sfeldon) - #1092: New cop
DefEndAlignmenttakes over responsibility for checkng alignment of method definitionends fromEndAlignment, and is configurable. (@jonas054) - #1145: New cop
ClassCheckenforces consistent use ofis_a?orkind_of?. (@bbatsov) - #1161: New cop
SpaceBeforeCommadetects spaces before a comma. (@agrimm) - #1161: New cop
SpaceBeforeSemicolondetects spaces before a semicolon. (@agrimm) - #835: New cop
UnneededPercentQchecks for usage of the%q/%Qsyntax when''or""would do. (@jonas054) - #977: Add
AllowURIoption (enabled by default) toLineLengthcop. (@yujinakayama)
Changes
- Unused block local variables (
obj.each { |arg; this| }) are now handled byUnusedBlockArgumentcop instead ofUselessAssignmentcop. (@yujinakayama) - #1141: Clarify in the message from
TrailingCommathat a trailing comma is never allowed for lists where some items share a line. (@jonas054)
Bugs fixed
- #1133: Handle
reduce/injectwith no arguments inEachWithObject. (@bbatsov) - #1152: Handle
while/untilwith no body inNext. (@tamird) - Fix a false positive in
UselessSetterCallfor setter call on a local variable that contains a non-local object. (@yujinakayama) - #1158: Fix auto-correction of floating-point numbers. (@bbatsov)
- #1159: Fix checking of
begin..endstructures, blocks, and parenthesized expressions inIndentationWidth. (@jonas054) - #1159: More rigid conditions for when
attris considered an offense. (@jonas054) - #1167: Fix handling of parameters spanning multiple lines in
TrailingComma. (@jonas054) - #1169: Fix handling of ternary op conditions in
ParenthesesAroundCondition. (@bbatsov) - #1147: WordArray checks arrays with special characters. (@camilleldn)
- Fix a false positive against
returnin a loop inNextcop. (@yujinakayama) - #1165: Support
rescue/else/ensurebodies inIndentationWidth. (@jonas054) - Fix false positive for aligned list of values after
wheninIndentationWidth. (@jonas054)
- Ruby
Published by bbatsov over 11 years ago
https://github.com/rubocop/rubocop - RuboCop 0.23.0
This release is mostly about fixing bugs, but it also features a few prominent changes:
- Cops are now namespace aware, which would it make it simpler to write RuboCop extensions without
worrying about name collisions (e.g. you can now haveStyle/FilenameandRSpec/Filenamecops). - There's now logic which prevents auto-corrections from generated invalid Ruby code.
- The
Rubocopmodule was renamed toRuboCop, which will affect packages relying on RuboCop's public API.
Below is the list of all the gory details. Enjoy!
New features
- #1117:
BlockCommentscop does auto-correction. (@jonas054) - #1124:
TrivialAccessorscop auto-corrects class-level accessors. (@ggilder) - #1062: New cop
InlineCommentchecks for inline comments. (@salbertson) - #1118: Add checking and auto-correction of right brackets in
IndentArrayandIndentHash. (@jonas054)
Changes
- #1097: Add optional namespace prefix to cop names:
Style/LineLengthinstead ofLineLengthin config files,--onlyargument,--show-copsoutput, and# rubocop:disable. (@jonas054) - #1075: More strict limits on when to require trailing comma. (@jonas054)
- Renamed
Rubocopmodule toRuboCop. (@bbatsov)
Bugs fixed
- #1126: Fix
--auto-gen-configbug withRegexpLiteralwhere only the last file's results would be used. (@ggilder) - #1104: Fix
EachWithObjectwith modifier if as body. (@geniou) - #1106: Fix
EachWithObjectwith single method call as body. (@geniou) - Avoid the warning about ignoring syck YAML engine from JRuby. (@jonas054)
- #1111: Fix problem in
EndOfLinewith reading non-UTF-8 encoded files. (@jonas054) - #1115: Fix
Nextto ignore super nodes. (@geniou) - #1117: Don't auto-correct indentation in scopes that contain block comments (
=begin..=end). (@jonas054) - #1123: Support setter calls in safe assignment in
ParenthesesAroundCondition. (@jonas054) - #1090: Correct handling of documentation vs annotation comment. (@jonas054)
- #1118: Never write invalid ruby to a file in auto-correct. (@jonas054)
- #1120: Don't change indentation of heredoc strings in auto-correct. (@jonas054)
- #1109: Handle conditions with modifier ops in them in
ParenthesesAroundCondition. (@bbatsov)
- Ruby
Published by bbatsov almost 12 years ago
https://github.com/rubocop/rubocop - RuboCop 0.22.0
This release brings a few new cops, extended auto-correction support and plenty of bug fixes.
Below is the list of all the gory details. Enjoy!
New features
- #974: New cop
CommentIndentationchecks indentation of comments. (@jonas054) - Add new cop
EachWithObjectto prefereach_with_objectoverinjectorreduce. (@geniou) - #1010: New Cop
Nextcheck for conditions at the end of an interation and propose to usenextinstead. (@geniou) - The
GuardClausecop now also looks for unless and it is configurable how many lines the body of an if / unless needs to have to not be ignored. (@geniou) - #835: New cop
UnneededPercentXchecks for%xwhen backquotes would do. (@jonas054) - Add auto-correct to
UnusedBlockArgumentandUnusedMethodArgumentcops. (@hannestyden) - #1074: New cop
SpaceBeforeCommentchecks for missing space between code and a comment on the same line. (@jonas054) - #1089: New option
-F/--fail-fastinspects files in modification time order and stop after the first file with offenses. (@jonas054)
Changes
NonNilCheckoffense reporting and autocorrect are configurable to include semantic changes. (@hannestyden)- The parameters
AllCops/ExcludesandAllCops/Includeswith finalsonly give a warning and don't haltrubocopexecution. (@jonas054) - The
GuardClausecop is no longer irgnoring a one-line body by default - see configuration. (@geniou) - #1050: Rename
rubocop-todo.ymlfile to.rubocop_todo.yml. (@geniou) - #1064: Adjust default max line length to 80. (@bbatsov)
Bugs fixed
- Allow assignment in
AlignParameterscop. (@tommeier) - Fix
VoidandSpaceAroundOperatorsfor short call syntaxlambda.(). (@biinari) - Fix
Delegatefor delegation with assignment or constant. (@geniou) - #1032: Avoid duplicate reporting when code moves around due to
--auto-correct. (@jonas054) - #1036: Handle strings like
__FILE__inLineEndConcatenation. (@bbatsov) - #1006: Fix LineEndConcatenation to handle chained concatenations. (@barunio)
- #1066: Fix auto-correct for
NegatedIfwhen the condition has parentheses around it. (@jonas054) - Fix
AlignParameterswith_fixed_indentationfor multi-line method calls. (@molawson) - Fix problem that appears in some installations when reading empty YAML files. (@jonas054)
- #1022: A Cop will no longer auto-correct a file that's excluded through an
Excludesetting in the cop's configuration. (@jonas054) - Fix paths in
Excludeconfig section not being recognized on Windows. (@wndhydrnt) - #1094: Fix ClassAndModuleChildren for classes with a single method. (@geniou)
- Ruby
Published by bbatsov almost 12 years ago
https://github.com/rubocop/rubocop - RuboCop 0.21.0
This release brings a few new cops and extended auto-correction support. The most significant
change is that we've changed the syntax for excluding/including to be closer to that of shell globbing.
Below is the list of all the gory details. Enjoy!
New features
- #835: New cop
UnneededCapitalWchecks for%Wwhen interpolation not necessary and%wwould do. (@sfeldon) - #934: New cop
UnderscorePrefixedVariableNamechecks for_-prefixed variables that are actually used. (@yujinakayama) - #934: New cop
UnusedMethodArgumentchecks for unused method arguments. (@yujinakayama) - #934: New cop
UnusedBlockArgumentchecks for unused block arguments. (@yujinakayama) - #964:
RedundantBegincop does auto-correction. (@tamird) - #966:
RescueExceptioncop does auto-correction. (@tamird) - #967:
TrivialAccessorscop does auto-correction. (@tamird) - #963: Add
AllowDSLWritersoptions toTrivialAccessors. (@tamird) - #969: Let the
Debuggercop check for forgotten calls to byebug. (@bquorning) - #971: Configuration format deprecation warnings include the path to the problematic config file. (@bcobb)
- #490: Add EnforcedStyle config option to TrailingBlankLines. (@jonas054)
- Add
auto_correcttask to Rake integration. (@irrationalfab) - #986: The
--onlyoption can take a comma-separated list of cops. (@jonas054) - New Rails cop
Delegatethat checks for delegations that could be replaced by thedelegatemethod. (@geniou) - Add configuration to
Encodingcop to only enforce encoding comment if there are non ASCII characters. (@geniou)
Changes
- Removed
FinalNewlinecop as its check is now performed byTrailingBlankLines. (@jonas054) - #1011: Pattern matching with
Dir#[]for config parameters added. (@jonas054)
Bugs fixed
- Update description on
LineEndConcatenationcop. (@mockdeep) - #978: Fix regression in
IndentationWidthhandling method calls. (@tamird) - #976: Fix
EndAlignmentnot handling element assignment correctly. (@tamird) - #976: Fix
IndentationWidthnot handling element assignment correctly. (@tamird) - #800: Do not report
[Corrected]in--auto-correctmode if correction wasn't done. (@jonas054) - #968: Fix bug when running Rubocop with
-c .rubocop.yml. (@bquorning) - #975: Fix infinite correction in
IndentationWidth. (@jonas054) - #986: When
--lintis used together with--only, all lint cops are run in addition to the given cops. (@jonas054) - #997: Fix handling of file paths for matching against
Excludeproperty whenrubocop .is called. (@jonas054) - #1000: Support modifier (e.g.,
private) anddefon the same line (Ruby >= 2.1) inIndentationWidth. (@jonas054) - #1001: Fix
--auto-gen-configlogic forRegexpLiteral. (@jonas054) - #993: Do not report any offenses for the contents of an empty file. (@jonas054)
- #1016: Fix a false positive in
ConditionPositionregarding statement modifiers. (@bbatsov) - #1014: Fix handling of strings nested in
dstrnodes. (@bbatsov)
- Ruby
Published by bbatsov almost 12 years ago
https://github.com/rubocop/rubocop - RuboCop 0.20.1
RuboCop 0.20.1 is a bugfix-only release. Below is a list of the bugs we've fixed since 0.20.0:
0.20.1 (05/04/2014)
Bugs fixed
- #940: Fixed
UselessAccessModifiernot handlingattr_*correctly. (@fshowalter) NegatedIfproperly handles negatedunlesscondition. (@bbatsov)NegatedWhileproperly handles negateduntilcondition. (@bbatsov)- #925: Do not disable the
Syntaxcop in output from--auto-gen-config. (@jonas054) - #943: Fix auto-correction interference problem between
SpaceAfterCommaand other cops. (@jonas054) - #954: Fix auto-correction bug in
NilComparison. (@bbatsov) - #953: Fix auto-correction bug in
NonNilCheck. (@bbatsov) - #952: Handle implicit receiver in
StringConversionInInterpolation. (@bbatsov) - #956: Apply
ClassMethodscheck only onclass/modulebodies. (@bbatsov) - #945: Fix SpaceBeforeFirstArg cop for multiline argument and exclude assignments. (@cschramm)
- #948:
Blockscop avoids auto-correction if it would introduce a semantic change. (@jonas054) - #946: Allow non-nil checks that are the final expressions of predicate method definitions in
NonNilCheck. (@bbatsov) - #957: Allow space + comment inside parentheses, braces, and square brackets. (@jonas054)
- Ruby
Published by bbatsov almost 12 years ago
https://github.com/rubocop/rubocop - RuboCop 0.20.0
There aren't many exciting new features this time around - our focus in 0.20 has been fixing most of the problems we introduced in 0.19. Apart from that we've added a few new cops and implemented auto-correct for a bunch of the existing cops.
You'll also notice that the messages produced by most formatters a bit more colorful (and hopefully more readable as well).
You should also note that AllCops/Includes and AllCops/Excludes have been renamed, so you'll have to update your config files accordingly.
Below is the list of all the gory details. Enjoy!
New features
- New cop
GuardClausechecks for conditionals that can be replaced by guard clauses. (@bbatsov) - New cop
EmptyInterpolationchecks for empty interpolation in double-quoted strings. (@bbatsov) - #899: Make
LineEndConcatenationcop<<aware. (@mockdeep) - #896: New option
--fail-levelchanges minimum severity for exit with error code. (@hiroponz) - #893: New option
--force-exclusionforces excluding files specified in the configurationExcludeeven if they are explicitly passed as arguments. (@yujinakayama) VariableInterpolationcop does auto-correction. (@bbatsov)Notcop does auto-correction. (@bbatsov)ClassMethodscop does auto-correction. (@bbatsov)StringConversionInInterpolationcop does auto-correction. (@bbatsov)NilComparisoncop does auto-correction. (@bbatsov)NonNilComparisoncop does auto-correction. (@bbatsov)NegatedIfcop does auto-correction. (@bbatsov)NegatedWhilecop does auto-correction. (@bbatsov)- New lint cop
SpaceBeforeFirstArgchecks for space between the method name and the first argument in method calls without parentheses. (@jonas054) - New style cop
SingleSpaceBeforeFirstArgchecks that no more than one space is used between the method name and the first argument in method calls without parentheses. (@jonas054) - New formatter
disabled_linesdisplays cops and line ranges disabled by inline comments. (@fshowalter) - New cop
UselessAccessModifierschecks for access modifiers that have no effect. (@fshowalter)
Changes
- #913:
FileNameaccepts multiple extensions. (@tamird) AllCops/ExcludesandAllCops/Includeswere renamed toAllCops/ExcludeandAllCops/Includefor consistency with standard cop params. (@bbatsov)- Extract
NonNilCheckcop fromNilComparison. (@bbatsov) - Renamed
FavorJointoArrayJoin. (@bbatsov) - Renamed
FavorUnlessOverNegatedIftoNegatedIf. (@bbatsov) - Renamed
FavorUntilOverNegatedWhiletoNegatedWhile. (@bbatsov) - Renamed
HashMethodstoDeprecatedHashMethods. (@bbatsov) - Renamed
ReadAttributetoReadWriteAttributeand extended it to check for uses ofwrite_attribute. (@bbatsov) - Add experimental support for Ruby 2.2 (development version) by falling back to Ruby 2.1 parser. (@yujinakayama)
Bugs fixed
- #926: Fixed
BlockNestingnot auto-generating correctly. (@tmorris-fiksu) - #904: Fixed a NPE in
LiteralInInterpolation. (@bbatsov) - #904: Fixed a NPE in
StringConversionInInterpolation. (@bbatsov) - #892: Make sure
IncludeandExcludepaths in a.rubocop.ymlare interpreted as relative to the directory of that file. (@jonas054) - #906: Fixed a false positive in
LiteralInInterpolation. (@bbatsov) - #909: Handle properly multiple
rescueclauses inSignalException. (@bbatsov) - #876: Do a deep merge of hashes when overriding default configuration in a
.rubocop.ymlfile. (@jonas054) - #912: Fix a false positive in
LineEndConcatenationfor%string literals. (@bbatsov) - #912: Handle top-level constant resolution in
DeprecatedClassMethods(e.g.::File.exists?). (@bbatsov) - #914: Fixed rdoc error during gem installation. (@bbatsov)
- The
--onlyoption now enables the given cop in case it is disabled in configuration. (@jonas054) - Fix path resolution so that the default exclusion of
vendordirectories works. (@jonas054) - #908: Fixed hanging while auto correct for
SpaceAfterCommaandSpaceInsideBrackets. (@hiroponz) - #919: Don't avoid auto-correction in
HashSyntaxwhen there is missing space around operator. (@jonas054) - Fixed handling of floats in
NumericLiterals. (@bbatsov) - #927: Let
--auto-gen-configoverwrite an existingrubocop-todo.ymlfile instead of asking the user to remove it. (@jonas054) - #936: Allow
_otheras well asotherinOpMethod. (@bbatsov)
- Ruby
Published by bbatsov almost 12 years ago
https://github.com/rubocop/rubocop - RuboCop 0.19.1
RuboCop 0.19.1 is a bugfix-only release. Below is a list of the bugs we've fixed since 0.19.0:
Bugs fixed
- #884: Fix --auto-gen-config for
NumericLiteralsso MinDigits is correct. (@tmorris-fiksu) - #879: Fix --auto-gen-config for
RegexpLiteralso we don't generate illegal values forMaxSlashes. (@jonas054) - Fix the name of the
Includeparam in the default config of the Rails cops. (@bbatsov) - #878: Blacklist
Rakefile,GemfileandCapfileby default in theFileNamecop. (@bbatsov) - #875: Handle
separatorstyle hashes inIndentHash. (@jonas054) - Fix a bug where multiple cli options that result in exit can be specified at once (e.g.
-vV,-v --show-cops). (@jkogara) - #889: Fix a false positive for
LiteralInConditionwhen the condition is non-primitive array. (@bbatsov)
- Ruby
Published by bbatsov almost 12 years ago
https://github.com/rubocop/rubocop - RuboCop 0.19.0
This is the biggest RuboCop release we've done in a while. The highlights include
about a dozen new cops, more cop configuration options, improved auto-correct and so many bugfixes.
You'll might note that we changed the use of offence with offense. This was done to keep the spelling
in our code consistent. Hopefully this won't cause anyone problems, but we're obliged to mention it as
the Offence class itself got renamed.
Below is the list of all the gory details. Enjoy!
RuboCop 0.19.0
New features
- New cop
FileNamemakes sure that source files have snake_case names. (@bbatsov) - New cop
DeprecatedClassMethodschecks for deprecated class methods. (@bbatsov) - New cop
StringConversionInInterpolationchecks for redundantObject#to_sin string interpolation. (@bbatsov) - New cop
LiteralInInterpolationchecks for interpolated string literals. (@bbatsov) - New cop
SelfAssignmentchecks for places where the self-assignment shorthand should have been used. (@bbatsov) - New cop
DoubleNegationchecks for uses of!!. (@bbatsov) - New cop
PercentLiteralDelimitersenforces consistent usage of%-literal delimiters. (@hannestyden) - New Rails cop
ActionFilterenforces the use of_filteror_actionaction filter methods. (@bbatsov) - New Rails cop
ScopeArgsmakes sure you invoke thescopemethod properly. (@bbatsov) - Add
with_fixed_indentationstyle toAlignParameterscop. (@hannestyden) - Add
IgnoreLastArgumentHashoption toAlignHashcop. (@hannestyden) - #743:
SingleLineMethodscop does auto-correction. (@jonas054) - #743:
Semicoloncop does auto-correction. (@jonas054) - #743:
EmptyLineBetweenDefscop does auto-correction. (@jonas054) - #743:
IndentationWidthcop does auto-correction. (@jonas054) - #743:
IndentationConsistencycop does auto-correction. (@jonas054) - #809: New formatter
fuubardisplays a progress bar and shows details of offenses as soon as they are detected. (@yujinakayama) - #797: New cop
IndentHashchecks the indentation of the first key in multi-line hash literals. (@jonas054) - #797: New cop
IndentArraychecks the indentation of the first element in multi-line array literals. (@jonas054) - #806: Now excludes files in
vendor/**by default. (@jeremyolliver) - #795:
IfUnlessModifierandWhileUntilModifiersupportsMaxLineLength, which is independent ofLineLengthparameterMax. (@agrimm) - #868: New cop
ClassAndModuleChildrenchecks the style of children definitions at classes and modules: nested / compact. (@geniou)
Changes
- #793: Add printing total count when
rubocop --format offences. (@ma2gedev) - Remove
Ignoreparam from the RailsOutputcop. The standardExclude/Includeshould be used instead. (@bbatsov) - Renamed
FavorSprintftoFormatStringand made it configurable. (@bbatsov) - Renamed
OffencetoOffense. (@bbatsov) - Use
offensein all messages instead ofoffence. (@bbatsov) - For indentation of
if/unless/while/untilbodies when the result is assigned to a variable, instead of supporting two styles simultaneously,IndentationWidthnow supports one style of indentation at a time, specified byEndAlignment/AlignWith. (@jonas054) - Renamed
Styleparam ofDotPositioncop toEnforcedStyle. (@bbatsov) - Add
lengthvalue to locations of offense in JSON formatter. (@yujinakayama) SpaceAroundBlockBracescop replaced bySpaceBeforeBlockBracesandSpaceInsideBlockBraces. (@jonas054)SpaceAroundEqualsInParameterDefaultcop is now configurable with theEnforcedStyleoption. (@jonas054)
Bugs fixed
- #790: Fix auto-correction interference problem between
MethodDefParenthesesand other cops. (@jonas054) - #794: Fix handling of modifier keywords with required parentheses in
ParenthesesAroundCondition. (@bbatsov) - #804: Fix a false positive with operator assignments in a loop (including
begin..rescue..endwithretry) inUselessAssignment. (@yujinakayama) - #815: Fix a false positive for heredocs with blank lines in them in
EmptyLines. (@bbatsov) - Auto-correction is now more robust and less likely to die because of
RangeErroror "clobbering". (@jonas054) - Offenses always reported in order of position in file, also during
--auto-correctruns. (@jonas054) - Fix problem with
[Corrected]tag sometimes missing in output from--auto-correctruns. (@jonas054) - Fix message from
EndAlignmentcop whenAlignWithiskeyword. (@jonas054) - Handle
caseconditions inLiteralInCondition. (@bbatsov) - #822: Fix a false positive in
DotPositionwhen enforced style is set totrailing. (@bbatsov) - Handle properly dynamic strings in
LineEndConcatenation. (@bbatsov) - #832: Fix auto-correction interference problem between
BracesAroundHashParametersandSpaceInsideHashLiteralBraces. (@jonas054) - Fix bug in auto-correction of alignment so that only space can be removed. (@jonas054)
- Fix bug in
IndentationWidthauto-correction so it doesn't correct things thatIndentationConsistencyshould correct. (@jonas054) - #847: Fix bug in
RegexpLiteralconcerning--auto-gen-config. (@jonas054) - #848: Fix bug in
--show-copsthat made it print the default configuration rather than the current configuration. (@jonas054) - #862: Fix a bug where single line
rubocop:disablecomments with indentations were treated as multiline cop disabling comments. (@yujinakayama) - Fix a bug where
rubocop:disablecomments with a cop name includingall(e.g.MethodCallParentheses) were disabling all cops. (@yujinakayama) - Fix a bug where string and regexp literals including
# rubocop:disablewere confused with real comments. (@yujinakayama)
- Ruby
Published by bbatsov almost 12 years ago