rubocop 1.7.0 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +4 -3
- data/config/default.yml +137 -31
- data/config/obsoletion.yml +4 -0
- data/lib/rubocop.rb +14 -1
- data/lib/rubocop/cli/command/auto_genenerate_config.rb +5 -4
- data/lib/rubocop/comment_config.rb +6 -6
- data/lib/rubocop/config.rb +5 -2
- data/lib/rubocop/config_loader.rb +7 -14
- data/lib/rubocop/config_store.rb +12 -1
- data/lib/rubocop/cop/base.rb +2 -1
- data/lib/rubocop/cop/exclude_limit.rb +26 -0
- data/lib/rubocop/cop/gemspec/date_assignment.rb +56 -0
- data/lib/rubocop/cop/generator.rb +1 -3
- data/lib/rubocop/cop/internal_affairs.rb +5 -1
- data/lib/rubocop/cop/internal_affairs/empty_line_between_expect_offense_and_correction.rb +68 -0
- data/lib/rubocop/cop/internal_affairs/example_description.rb +89 -0
- data/lib/rubocop/cop/internal_affairs/redundant_described_class_as_subject.rb +61 -0
- data/lib/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new.rb +64 -0
- data/lib/rubocop/cop/layout/class_structure.rb +7 -2
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +38 -18
- data/lib/rubocop/cop/layout/first_argument_indentation.rb +16 -2
- data/lib/rubocop/cop/layout/line_length.rb +2 -1
- data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +26 -0
- data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +2 -2
- data/lib/rubocop/cop/layout/space_before_brackets.rb +19 -16
- data/lib/rubocop/cop/lint/debugger.rb +58 -14
- data/lib/rubocop/cop/lint/deprecated_constants.rb +80 -0
- data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +13 -4
- data/lib/rubocop/cop/lint/duplicate_require.rb +2 -2
- data/lib/rubocop/cop/lint/else_layout.rb +1 -1
- data/lib/rubocop/cop/lint/lambda_without_literal_block.rb +44 -0
- data/lib/rubocop/cop/lint/multiple_comparison.rb +4 -4
- data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +10 -6
- data/lib/rubocop/cop/lint/number_conversion.rb +41 -6
- data/lib/rubocop/cop/lint/numbered_parameter_assignment.rb +47 -0
- data/lib/rubocop/cop/lint/or_assignment_to_constant.rb +39 -0
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +2 -1
- data/lib/rubocop/cop/lint/redundant_dir_glob_sort.rb +50 -0
- data/lib/rubocop/cop/lint/redundant_splat_expansion.rb +5 -3
- data/lib/rubocop/cop/lint/symbol_conversion.rb +103 -0
- data/lib/rubocop/cop/lint/triple_quotes.rb +71 -0
- data/lib/rubocop/cop/message_annotator.rb +4 -1
- data/lib/rubocop/cop/metrics/block_nesting.rb +2 -2
- data/lib/rubocop/cop/metrics/parameter_lists.rb +5 -2
- data/lib/rubocop/cop/mixin/allowed_identifiers.rb +18 -0
- data/lib/rubocop/cop/mixin/check_line_breakable.rb +5 -0
- data/lib/rubocop/cop/mixin/code_length.rb +3 -1
- data/lib/rubocop/cop/mixin/comments_help.rb +1 -11
- data/lib/rubocop/cop/mixin/configurable_max.rb +1 -0
- data/lib/rubocop/cop/mixin/first_element_line_break.rb +1 -1
- data/lib/rubocop/cop/mixin/method_complexity.rb +3 -1
- data/lib/rubocop/cop/mixin/preferred_delimiters.rb +2 -2
- data/lib/rubocop/cop/mixin/uncommunicative_name.rb +5 -1
- data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +38 -5
- data/lib/rubocop/cop/naming/variable_name.rb +2 -0
- data/lib/rubocop/cop/naming/variable_number.rb +2 -9
- data/lib/rubocop/cop/registry.rb +1 -1
- data/lib/rubocop/cop/severity.rb +3 -3
- data/lib/rubocop/cop/style/ascii_comments.rb +1 -1
- data/lib/rubocop/cop/style/constant_visibility.rb +27 -0
- data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +49 -9
- data/lib/rubocop/cop/style/double_negation.rb +2 -2
- data/lib/rubocop/cop/style/empty_literal.rb +6 -2
- data/lib/rubocop/cop/style/endless_method.rb +102 -0
- data/lib/rubocop/cop/style/eval_with_location.rb +138 -49
- data/lib/rubocop/cop/style/explicit_block_argument.rb +11 -1
- data/lib/rubocop/cop/style/exponential_notation.rb +6 -7
- data/lib/rubocop/cop/style/float_division.rb +3 -0
- data/lib/rubocop/cop/style/format_string_token.rb +18 -2
- data/lib/rubocop/cop/style/hash_conversion.rb +81 -0
- data/lib/rubocop/cop/style/hash_like_case.rb +2 -1
- data/lib/rubocop/cop/style/if_inside_else.rb +22 -10
- data/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb +120 -0
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +4 -0
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +4 -0
- data/lib/rubocop/cop/style/nil_comparison.rb +3 -0
- data/lib/rubocop/cop/style/non_nil_check.rb +23 -13
- data/lib/rubocop/cop/style/numeric_literals.rb +6 -9
- data/lib/rubocop/cop/style/numeric_predicate.rb +1 -1
- data/lib/rubocop/cop/style/raise_args.rb +3 -2
- data/lib/rubocop/cop/style/redundant_return.rb +1 -1
- data/lib/rubocop/cop/style/single_line_methods.rb +32 -2
- data/lib/rubocop/cop/style/sole_nested_conditional.rb +29 -5
- data/lib/rubocop/cop/style/special_global_vars.rb +3 -3
- data/lib/rubocop/cop/style/string_concatenation.rb +1 -1
- data/lib/rubocop/cop/style/ternary_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/while_until_modifier.rb +2 -4
- data/lib/rubocop/formatter/git_hub_actions_formatter.rb +1 -0
- data/lib/rubocop/formatter/offense_count_formatter.rb +1 -1
- data/lib/rubocop/formatter/simple_text_formatter.rb +2 -1
- data/lib/rubocop/formatter/worst_offenders_formatter.rb +1 -1
- data/lib/rubocop/magic_comment.rb +30 -1
- data/lib/rubocop/options.rb +1 -1
- data/lib/rubocop/rspec/expect_offense.rb +5 -2
- data/lib/rubocop/runner.rb +1 -0
- data/lib/rubocop/target_ruby.rb +47 -11
- data/lib/rubocop/version.rb +2 -2
- metadata +24 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d690ba94b53010f458962d3c50bae5ec6198e0b54565422b1bce58351429618a
|
4
|
+
data.tar.gz: 4b0a3f5d69b88b1db292620328a02c26f8315b37fc49b066e4aa24c317c22f86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3655b57caafb4704d05658ef53f39e09f30e0f32d2def6908cfc6ecefcf7a0b67aeeafe862bc4ad76f96fb2c6b17b00a60997ad4af31fc0727e16c20ce1141da
|
7
|
+
data.tar.gz: 69f5289513c39feb34bf4df834e45b3288b76eda570d860ab0aab3a4742283cbaa5f9bebae9663fc6e7f3d00ae18bd8638bdc4d40b4c13516966fb349496aec4
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -45,13 +45,13 @@ gem 'rubocop', require: false
|
|
45
45
|
```
|
46
46
|
|
47
47
|
RuboCop is stable between major versions, both in terms of API and cop configuration.
|
48
|
-
We aim
|
48
|
+
We aim to ease the maintenance of RuboCop extensions and the upgrades between RuboCop
|
49
49
|
releases. All big changes are reserved for major releases.
|
50
50
|
To prevent an unwanted RuboCop update you might want to use a conservative version lock
|
51
51
|
in your `Gemfile`:
|
52
52
|
|
53
53
|
```rb
|
54
|
-
gem 'rubocop', '~> 1.
|
54
|
+
gem 'rubocop', '~> 1.10', require: false
|
55
55
|
```
|
56
56
|
|
57
57
|
See [versioning](https://docs.rubocop.org/rubocop/1.0/versioning.html) for further details.
|
@@ -109,6 +109,7 @@ Here's a list of RuboCop's core developers:
|
|
109
109
|
* [Maxim Krizhanovski](https://github.com/darhazer)
|
110
110
|
* [Benjamin Quorning](https://github.com/bquorning)
|
111
111
|
* [Marc-André Lafortune](https://github.com/marcandre)
|
112
|
+
* [Daniel Vandersluis](https://github.com/dvandersluis)
|
112
113
|
|
113
114
|
See the [team page](https://docs.rubocop.org/rubocop/about/team.html) for more details.
|
114
115
|
|
@@ -241,5 +242,5 @@ RuboCop's changelog is available [here](CHANGELOG.md).
|
|
241
242
|
|
242
243
|
## Copyright
|
243
244
|
|
244
|
-
Copyright (c) 2012-
|
245
|
+
Copyright (c) 2012-2021 Bozhidar Batsov. See [LICENSE.txt](LICENSE.txt) for
|
245
246
|
further details.
|
data/config/default.yml
CHANGED
@@ -132,12 +132,13 @@ AllCops:
|
|
132
132
|
# If a value is specified for TargetRubyVersion then it is used. Acceptable
|
133
133
|
# values are specificed as a float (i.e. 2.5); the teeny version of Ruby
|
134
134
|
# should not be included. If the project specifies a Ruby version in the
|
135
|
-
# .ruby-version
|
136
|
-
# the desired version of Ruby by inspecting the
|
137
|
-
#
|
138
|
-
#
|
139
|
-
# from the lock file.) If the
|
140
|
-
#
|
135
|
+
# .tool-versions or .ruby-version files, Gemfile or gems.rb file, RuboCop will
|
136
|
+
# try to determine the desired version of Ruby by inspecting the
|
137
|
+
# .tool-versions file first, then .ruby-version, followed by the Gemfile.lock
|
138
|
+
# or gems.locked file. (Although the Ruby version is specified in the Gemfile
|
139
|
+
# or gems.rb file, RuboCop reads the final value from the lock file.) If the
|
140
|
+
# Ruby version is still unresolved, RuboCop will use the oldest officially
|
141
|
+
# supported Ruby version (currently Ruby 2.4).
|
141
142
|
TargetRubyVersion: ~
|
142
143
|
# Determines if a notification for extension libraries should be shown when
|
143
144
|
# rubocop is run. Keys are the name of the extension, and values are an array
|
@@ -202,6 +203,13 @@ Bundler/OrderedGems:
|
|
202
203
|
|
203
204
|
#################### Gemspec ###############################
|
204
205
|
|
206
|
+
Gemspec/DateAssignment:
|
207
|
+
Description: 'Checks that `date =` is not used in gemspec file, it is set automatically when the gem is packaged.'
|
208
|
+
Enabled: pending
|
209
|
+
VersionAdded: '1.10'
|
210
|
+
Include:
|
211
|
+
- '**/*.gemspec'
|
212
|
+
|
205
213
|
Gemspec/DuplicatedAssignment:
|
206
214
|
Description: 'An attribute assignment method calls should be listed only once in a gemspec.'
|
207
215
|
Enabled: true
|
@@ -1197,7 +1205,6 @@ Layout/SpaceBeforeBrackets:
|
|
1197
1205
|
StyleGuide: '#space-in-brackets-access'
|
1198
1206
|
Enabled: pending
|
1199
1207
|
VersionAdded: '1.7'
|
1200
|
-
Safe: false
|
1201
1208
|
|
1202
1209
|
Layout/SpaceBeforeComma:
|
1203
1210
|
Description: 'No spaces before commas.'
|
@@ -1446,29 +1453,65 @@ Lint/Debugger:
|
|
1446
1453
|
Description: 'Check for debugger calls.'
|
1447
1454
|
Enabled: true
|
1448
1455
|
VersionAdded: '0.14'
|
1449
|
-
VersionChanged: '
|
1450
|
-
DebuggerReceivers:
|
1451
|
-
- binding
|
1452
|
-
- Kernel
|
1453
|
-
- Pry
|
1456
|
+
VersionChanged: '1.10'
|
1457
|
+
DebuggerReceivers: [] # deprecated
|
1454
1458
|
DebuggerMethods:
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1459
|
+
# Groups are available so that a specific group can be disabled in
|
1460
|
+
# a user's configuration, but are otherwise not significant.
|
1461
|
+
Kernel:
|
1462
|
+
- binding.irb
|
1463
|
+
Byebug:
|
1464
|
+
- byebug
|
1465
|
+
- remote_byebug
|
1466
|
+
- Kernel.byebug
|
1467
|
+
- Kernel.remote_byebug
|
1468
|
+
Capybara:
|
1469
|
+
- save_and_open_page
|
1470
|
+
- save_and_open_screenshot
|
1471
|
+
Pry:
|
1472
|
+
- binding.pry
|
1473
|
+
- binding.remote_pry
|
1474
|
+
- binding.pry_remote
|
1475
|
+
- Pry.rescue
|
1476
|
+
Rails:
|
1477
|
+
- debugger
|
1478
|
+
- Kernel.debugger
|
1479
|
+
WebConsole:
|
1480
|
+
- binding.console
|
1466
1481
|
|
1467
1482
|
Lint/DeprecatedClassMethods:
|
1468
1483
|
Description: 'Check for deprecated class method calls.'
|
1469
1484
|
Enabled: true
|
1470
1485
|
VersionAdded: '0.19'
|
1471
1486
|
|
1487
|
+
Lint/DeprecatedConstants:
|
1488
|
+
Description: 'Checks for deprecated constants.'
|
1489
|
+
Enabled: pending
|
1490
|
+
VersionAdded: '1.8'
|
1491
|
+
# You can configure deprecated constants.
|
1492
|
+
# If there is an alternative method, you can set alternative value as `Alternative`.
|
1493
|
+
# And you can set the deprecated version as `DeprecatedVersion`.
|
1494
|
+
# These options can be omitted if they are not needed.
|
1495
|
+
#
|
1496
|
+
# DeprecatedConstants:
|
1497
|
+
# 'DEPRECATED_CONSTANT':
|
1498
|
+
# Alternative: 'alternative_value'
|
1499
|
+
# DeprecatedVersion: 'deprecated_version'
|
1500
|
+
#
|
1501
|
+
DeprecatedConstants:
|
1502
|
+
'NIL':
|
1503
|
+
Alternative: 'nil'
|
1504
|
+
DeprecatedVersion: '2.4'
|
1505
|
+
'TRUE':
|
1506
|
+
Alternative: 'true'
|
1507
|
+
DeprecatedVersion: '2.4'
|
1508
|
+
'FALSE':
|
1509
|
+
Alternative: 'false'
|
1510
|
+
DeprecatedVersion: '2.4'
|
1511
|
+
'Random::DEFAULT':
|
1512
|
+
Alternative: 'Random.new'
|
1513
|
+
DeprecatedVersion: '3.0'
|
1514
|
+
|
1472
1515
|
Lint/DeprecatedOpenSSLConstant:
|
1473
1516
|
Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
|
1474
1517
|
Enabled: true
|
@@ -1674,6 +1717,11 @@ Lint/InterpolationCheck:
|
|
1674
1717
|
VersionAdded: '0.50'
|
1675
1718
|
VersionChanged: '0.87'
|
1676
1719
|
|
1720
|
+
Lint/LambdaWithoutLiteralBlock:
|
1721
|
+
Description: 'Checks uses of lambda without a literal block.'
|
1722
|
+
Enabled: pending
|
1723
|
+
VersionAdded: '1.8'
|
1724
|
+
|
1677
1725
|
Lint/LiteralAsCondition:
|
1678
1726
|
Description: 'Checks of literals used in conditions.'
|
1679
1727
|
Enabled: true
|
@@ -1773,6 +1821,17 @@ Lint/NumberConversion:
|
|
1773
1821
|
- Time
|
1774
1822
|
- DateTime
|
1775
1823
|
|
1824
|
+
Lint/NumberedParameterAssignment:
|
1825
|
+
Description: 'Checks for uses of numbered parameter assignment.'
|
1826
|
+
Enabled: pending
|
1827
|
+
VersionAdded: '1.9'
|
1828
|
+
|
1829
|
+
Lint/OrAssignmentToConstant:
|
1830
|
+
Description: 'Checks unintended or-assignment to constant.'
|
1831
|
+
Enabled: pending
|
1832
|
+
Safe: false
|
1833
|
+
VersionAdded: '1.9'
|
1834
|
+
|
1776
1835
|
Lint/OrderedMagicComments:
|
1777
1836
|
Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
|
1778
1837
|
Enabled: true
|
@@ -1836,6 +1895,11 @@ Lint/RedundantCopEnableDirective:
|
|
1836
1895
|
Enabled: true
|
1837
1896
|
VersionAdded: '0.76'
|
1838
1897
|
|
1898
|
+
Lint/RedundantDirGlobSort:
|
1899
|
+
Description: 'Checks for redundant `sort` method to `Dir.glob` and `Dir[]`.'
|
1900
|
+
Enabled: pending
|
1901
|
+
VersionAdded: '1.8'
|
1902
|
+
|
1839
1903
|
Lint/RedundantRequireStatement:
|
1840
1904
|
Description: 'Checks for unnecessary `require` statement.'
|
1841
1905
|
Enabled: true
|
@@ -1994,12 +2058,16 @@ Lint/SuppressedException:
|
|
1994
2058
|
VersionAdded: '0.9'
|
1995
2059
|
VersionChanged: '0.81'
|
1996
2060
|
|
2061
|
+
Lint/SymbolConversion:
|
2062
|
+
Description: 'Checks for unnecessary symbol conversions.'
|
2063
|
+
Enabled: pending
|
2064
|
+
VersionAdded: '1.9'
|
2065
|
+
|
1997
2066
|
Lint/Syntax:
|
1998
|
-
Description: 'Checks syntax
|
2067
|
+
Description: 'Checks for syntax errors.'
|
1999
2068
|
Enabled: true
|
2000
2069
|
VersionAdded: '0.9'
|
2001
2070
|
|
2002
|
-
|
2003
2071
|
Lint/ToEnumArguments:
|
2004
2072
|
Description: 'This cop ensures that `to_enum`/`enum_for`, called for the current method, has correct arguments.'
|
2005
2073
|
Enabled: pending
|
@@ -2020,6 +2088,11 @@ Lint/TrailingCommaInAttributeDeclaration:
|
|
2020
2088
|
Enabled: true
|
2021
2089
|
VersionAdded: '0.90'
|
2022
2090
|
|
2091
|
+
Lint/TripleQuotes:
|
2092
|
+
Description: 'Checks for useless triple quote constructs.'
|
2093
|
+
Enabled: pending
|
2094
|
+
VersionAdded: '1.9'
|
2095
|
+
|
2023
2096
|
Lint/UnderscorePrefixedVariableName:
|
2024
2097
|
Description: 'Do not use prefix `_` for a variable that is used.'
|
2025
2098
|
Enabled: true
|
@@ -2502,10 +2575,12 @@ Naming/VariableName:
|
|
2502
2575
|
StyleGuide: '#snake-case-symbols-methods-vars'
|
2503
2576
|
Enabled: true
|
2504
2577
|
VersionAdded: '0.50'
|
2578
|
+
VersionChanged: '1.8'
|
2505
2579
|
EnforcedStyle: snake_case
|
2506
2580
|
SupportedStyles:
|
2507
2581
|
- snake_case
|
2508
2582
|
- camelCase
|
2583
|
+
AllowedIdentifiers: []
|
2509
2584
|
|
2510
2585
|
Naming/VariableNumber:
|
2511
2586
|
Description: 'Use the configured style when numbering symbols, methods and variables.'
|
@@ -2649,7 +2724,8 @@ Style/AsciiComments:
|
|
2649
2724
|
Enabled: true
|
2650
2725
|
VersionAdded: '0.9'
|
2651
2726
|
VersionChanged: '0.52'
|
2652
|
-
AllowedChars:
|
2727
|
+
AllowedChars:
|
2728
|
+
- ©
|
2653
2729
|
|
2654
2730
|
Style/Attr:
|
2655
2731
|
Description: 'Checks for uses of Module#attr.'
|
@@ -3026,6 +3102,8 @@ Style/ConstantVisibility:
|
|
3026
3102
|
visibility declarations.
|
3027
3103
|
Enabled: false
|
3028
3104
|
VersionAdded: '0.66'
|
3105
|
+
VersionChanged: '1.10'
|
3106
|
+
IgnoreModules: false
|
3029
3107
|
|
3030
3108
|
# Checks that you have put a copyright in a comment before any code.
|
3031
3109
|
#
|
@@ -3080,6 +3158,8 @@ Style/DisableCopsWithinSourceCodeDirective:
|
|
3080
3158
|
Forbids disabling/enabling cops within source code.
|
3081
3159
|
Enabled: false
|
3082
3160
|
VersionAdded: '0.82'
|
3161
|
+
VersionChanged: '1.9'
|
3162
|
+
AllowedCops: []
|
3083
3163
|
|
3084
3164
|
Style/DocumentDynamicEvalDefinition:
|
3085
3165
|
Description: >-
|
@@ -3197,6 +3277,17 @@ Style/EndBlock:
|
|
3197
3277
|
VersionAdded: '0.9'
|
3198
3278
|
VersionChanged: '0.81'
|
3199
3279
|
|
3280
|
+
Style/EndlessMethod:
|
3281
|
+
Description: 'Avoid the use of multi-lined endless method definitions.'
|
3282
|
+
StyleGuide: '#endless-methods'
|
3283
|
+
Enabled: pending
|
3284
|
+
VersionAdded: '1.8'
|
3285
|
+
EnforcedStyle: allow_single_line
|
3286
|
+
SupportedStyles:
|
3287
|
+
- allow_single_line
|
3288
|
+
- allow_always
|
3289
|
+
- disallow
|
3290
|
+
|
3200
3291
|
Style/EvalWithLocation:
|
3201
3292
|
Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
|
3202
3293
|
Enabled: true
|
@@ -3220,9 +3311,8 @@ Style/ExplicitBlockArgument:
|
|
3220
3311
|
that just passes its arguments to another block.
|
3221
3312
|
StyleGuide: '#block-argument'
|
3222
3313
|
Enabled: true
|
3223
|
-
# May change the yielding arity.
|
3224
|
-
Safe: false
|
3225
3314
|
VersionAdded: '0.89'
|
3315
|
+
VersionChanged: '1.8'
|
3226
3316
|
|
3227
3317
|
Style/ExponentialNotation:
|
3228
3318
|
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
@@ -3241,7 +3331,8 @@ Style/FloatDivision:
|
|
3241
3331
|
Reference: 'https://blog.rubystyle.guide/ruby/2019/06/21/float-division.html'
|
3242
3332
|
Enabled: true
|
3243
3333
|
VersionAdded: '0.72'
|
3244
|
-
VersionChanged: '1.
|
3334
|
+
VersionChanged: '1.9'
|
3335
|
+
Safe: false
|
3245
3336
|
EnforcedStyle: single_coerce
|
3246
3337
|
SupportedStyles:
|
3247
3338
|
- left_coerce
|
@@ -3289,6 +3380,7 @@ Style/FormatStringToken:
|
|
3289
3380
|
MaxUnannotatedPlaceholdersAllowed: 1
|
3290
3381
|
VersionAdded: '0.49'
|
3291
3382
|
VersionChanged: '1.0'
|
3383
|
+
IgnoredMethods: []
|
3292
3384
|
|
3293
3385
|
Style/FrozenStringLiteralComment:
|
3294
3386
|
Description: >-
|
@@ -3350,6 +3442,11 @@ Style/HashAsLastArrayItem:
|
|
3350
3442
|
- braces
|
3351
3443
|
- no_braces
|
3352
3444
|
|
3445
|
+
Style/HashConversion:
|
3446
|
+
Description: 'Avoid Hash[] in favor of ary.to_h or literal hashes.'
|
3447
|
+
Enabled: pending
|
3448
|
+
VersionAdded: '1.10'
|
3449
|
+
|
3353
3450
|
Style/HashEachMethods:
|
3354
3451
|
Description: 'Use Hash#each_key and Hash#each_value.'
|
3355
3452
|
StyleGuide: '#hash-each'
|
@@ -3442,6 +3539,14 @@ Style/IfUnlessModifierOfIfUnless:
|
|
3442
3539
|
VersionAdded: '0.39'
|
3443
3540
|
VersionChanged: '0.87'
|
3444
3541
|
|
3542
|
+
Style/IfWithBooleanLiteralBranches:
|
3543
|
+
Description: 'Checks for redundant `if` with boolean literal branches.'
|
3544
|
+
Enabled: pending
|
3545
|
+
VersionAdded: '1.9'
|
3546
|
+
SafeAutoCorrect: false
|
3547
|
+
AllowedMethods:
|
3548
|
+
- nonzero?
|
3549
|
+
|
3445
3550
|
Style/IfWithSemicolon:
|
3446
3551
|
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
3447
3552
|
StyleGuide: '#no-semicolon-ifs'
|
@@ -3726,7 +3831,8 @@ Style/MutableConstant:
|
|
3726
3831
|
Description: 'Do not assign mutable objects to constants.'
|
3727
3832
|
Enabled: true
|
3728
3833
|
VersionAdded: '0.34'
|
3729
|
-
VersionChanged: '
|
3834
|
+
VersionChanged: '1.8'
|
3835
|
+
SafeAutoCorrect: false
|
3730
3836
|
EnforcedStyle: literals
|
3731
3837
|
SupportedStyles:
|
3732
3838
|
# literals: freeze literals assigned to constants
|
@@ -4330,7 +4436,7 @@ Style/SingleLineMethods:
|
|
4330
4436
|
StyleGuide: '#no-single-line-methods'
|
4331
4437
|
Enabled: true
|
4332
4438
|
VersionAdded: '0.9'
|
4333
|
-
VersionChanged: '1.
|
4439
|
+
VersionChanged: '1.8'
|
4334
4440
|
AllowIfMethodIsEmpty: true
|
4335
4441
|
|
4336
4442
|
Style/SlicingWithRange:
|
data/config/obsoletion.yml
CHANGED
@@ -187,6 +187,10 @@ changed_parameters:
|
|
187
187
|
parameters: ExcludedMethods
|
188
188
|
alternative: IgnoredMethods
|
189
189
|
severity: warning
|
190
|
+
- cops: Lint/Debugger
|
191
|
+
parameters: DebuggerReceivers
|
192
|
+
reason: "`DebuggerReceivers` is no longer necessary, method receivers should be specified in `DebuggerMethods` instead."
|
193
|
+
severity: warning
|
190
194
|
|
191
195
|
# Enforced styles that have been removed or replaced
|
192
196
|
changed_enforced_styles:
|
data/lib/rubocop.rb
CHANGED
@@ -7,7 +7,7 @@ require 'rainbow'
|
|
7
7
|
require 'set'
|
8
8
|
require 'forwardable'
|
9
9
|
require 'regexp_parser'
|
10
|
-
require 'unicode/display_width
|
10
|
+
require 'unicode/display_width'
|
11
11
|
|
12
12
|
# we have to require RuboCop's version, before rubocop-ast's
|
13
13
|
require_relative 'rubocop/version'
|
@@ -35,6 +35,7 @@ require_relative 'rubocop/cop/offense'
|
|
35
35
|
require_relative 'rubocop/cop/message_annotator'
|
36
36
|
require_relative 'rubocop/cop/ignored_node'
|
37
37
|
require_relative 'rubocop/cop/autocorrect_logic'
|
38
|
+
require_relative 'rubocop/cop/exclude_limit'
|
38
39
|
require_relative 'rubocop/cop/badge'
|
39
40
|
require_relative 'rubocop/cop/registry'
|
40
41
|
require_relative 'rubocop/cop/base'
|
@@ -61,6 +62,7 @@ require_relative 'rubocop/cop/mixin/annotation_comment'
|
|
61
62
|
require_relative 'rubocop/cop/mixin/array_min_size'
|
62
63
|
require_relative 'rubocop/cop/mixin/array_syntax'
|
63
64
|
require_relative 'rubocop/cop/mixin/alignment'
|
65
|
+
require_relative 'rubocop/cop/mixin/allowed_identifiers'
|
64
66
|
require_relative 'rubocop/cop/mixin/allowed_methods'
|
65
67
|
require_relative 'rubocop/cop/mixin/auto_corrector'
|
66
68
|
require_relative 'rubocop/cop/mixin/check_assignment'
|
@@ -150,6 +152,7 @@ require_relative 'rubocop/cop/bundler/gem_comment'
|
|
150
152
|
require_relative 'rubocop/cop/bundler/insecure_protocol_source'
|
151
153
|
require_relative 'rubocop/cop/bundler/ordered_gems'
|
152
154
|
|
155
|
+
require_relative 'rubocop/cop/gemspec/date_assignment'
|
153
156
|
require_relative 'rubocop/cop/gemspec/duplicated_assignment'
|
154
157
|
require_relative 'rubocop/cop/gemspec/ordered_dependencies'
|
155
158
|
require_relative 'rubocop/cop/gemspec/required_ruby_version'
|
@@ -262,6 +265,7 @@ require_relative 'rubocop/cop/lint/constant_definition_in_block'
|
|
262
265
|
require_relative 'rubocop/cop/lint/constant_resolution'
|
263
266
|
require_relative 'rubocop/cop/lint/debugger'
|
264
267
|
require_relative 'rubocop/cop/lint/deprecated_class_methods'
|
268
|
+
require_relative 'rubocop/cop/lint/deprecated_constants'
|
265
269
|
require_relative 'rubocop/cop/lint/deprecated_open_ssl_constant'
|
266
270
|
require_relative 'rubocop/cop/lint/disjunctive_assignment_in_constructor'
|
267
271
|
require_relative 'rubocop/cop/lint/duplicate_branch'
|
@@ -295,6 +299,7 @@ require_relative 'rubocop/cop/lint/implicit_string_concatenation'
|
|
295
299
|
require_relative 'rubocop/cop/lint/inherit_exception'
|
296
300
|
require_relative 'rubocop/cop/lint/ineffective_access_modifier'
|
297
301
|
require_relative 'rubocop/cop/lint/interpolation_check'
|
302
|
+
require_relative 'rubocop/cop/lint/lambda_without_literal_block'
|
298
303
|
require_relative 'rubocop/cop/lint/literal_as_condition'
|
299
304
|
require_relative 'rubocop/cop/lint/literal_in_interpolation'
|
300
305
|
require_relative 'rubocop/cop/lint/loop'
|
@@ -309,6 +314,8 @@ require_relative 'rubocop/cop/lint/no_return_in_begin_end_blocks'
|
|
309
314
|
require_relative 'rubocop/cop/lint/non_deterministic_require_order'
|
310
315
|
require_relative 'rubocop/cop/lint/non_local_exit_from_iterator'
|
311
316
|
require_relative 'rubocop/cop/lint/number_conversion'
|
317
|
+
require_relative 'rubocop/cop/lint/numbered_parameter_assignment'
|
318
|
+
require_relative 'rubocop/cop/lint/or_assignment_to_constant'
|
312
319
|
require_relative 'rubocop/cop/lint/ordered_magic_comments'
|
313
320
|
require_relative 'rubocop/cop/lint/out_of_range_regexp_ref'
|
314
321
|
require_relative 'rubocop/cop/lint/parentheses_as_grouped_expression'
|
@@ -318,6 +325,7 @@ require_relative 'rubocop/cop/lint/raise_exception'
|
|
318
325
|
require_relative 'rubocop/cop/lint/rand_one'
|
319
326
|
require_relative 'rubocop/cop/lint/redundant_cop_disable_directive'
|
320
327
|
require_relative 'rubocop/cop/lint/redundant_cop_enable_directive'
|
328
|
+
require_relative 'rubocop/cop/lint/redundant_dir_glob_sort'
|
321
329
|
require_relative 'rubocop/cop/lint/redundant_require_statement'
|
322
330
|
require_relative 'rubocop/cop/lint/redundant_safe_navigation'
|
323
331
|
require_relative 'rubocop/cop/lint/redundant_splat_expansion'
|
@@ -340,11 +348,13 @@ require_relative 'rubocop/cop/lint/shadowed_exception'
|
|
340
348
|
require_relative 'rubocop/cop/lint/shadowing_outer_local_variable'
|
341
349
|
require_relative 'rubocop/cop/lint/struct_new_override'
|
342
350
|
require_relative 'rubocop/cop/lint/suppressed_exception'
|
351
|
+
require_relative 'rubocop/cop/lint/symbol_conversion'
|
343
352
|
require_relative 'rubocop/cop/lint/syntax'
|
344
353
|
require_relative 'rubocop/cop/lint/to_enum_arguments'
|
345
354
|
require_relative 'rubocop/cop/lint/to_json'
|
346
355
|
require_relative 'rubocop/cop/lint/top_level_return_with_argument'
|
347
356
|
require_relative 'rubocop/cop/lint/trailing_comma_in_attribute_declaration'
|
357
|
+
require_relative 'rubocop/cop/lint/triple_quotes'
|
348
358
|
require_relative 'rubocop/cop/lint/underscore_prefixed_variable_name'
|
349
359
|
require_relative 'rubocop/cop/lint/unexpected_block_arity'
|
350
360
|
require_relative 'rubocop/cop/lint/unified_integer'
|
@@ -446,6 +456,7 @@ require_relative 'rubocop/cop/style/empty_else'
|
|
446
456
|
require_relative 'rubocop/cop/style/empty_lambda_parameter'
|
447
457
|
require_relative 'rubocop/cop/style/empty_literal'
|
448
458
|
require_relative 'rubocop/cop/style/empty_method'
|
459
|
+
require_relative 'rubocop/cop/style/endless_method'
|
449
460
|
require_relative 'rubocop/cop/style/encoding'
|
450
461
|
require_relative 'rubocop/cop/style/end_block'
|
451
462
|
require_relative 'rubocop/cop/style/eval_with_location'
|
@@ -462,6 +473,7 @@ require_relative 'rubocop/cop/style/global_std_stream'
|
|
462
473
|
require_relative 'rubocop/cop/style/global_vars'
|
463
474
|
require_relative 'rubocop/cop/style/guard_clause'
|
464
475
|
require_relative 'rubocop/cop/style/hash_as_last_array_item'
|
476
|
+
require_relative 'rubocop/cop/style/hash_conversion'
|
465
477
|
require_relative 'rubocop/cop/style/hash_each_methods'
|
466
478
|
require_relative 'rubocop/cop/style/hash_except'
|
467
479
|
require_relative 'rubocop/cop/style/hash_like_case'
|
@@ -472,6 +484,7 @@ require_relative 'rubocop/cop/style/identical_conditional_branches'
|
|
472
484
|
require_relative 'rubocop/cop/style/if_inside_else'
|
473
485
|
require_relative 'rubocop/cop/style/if_unless_modifier'
|
474
486
|
require_relative 'rubocop/cop/style/if_unless_modifier_of_if_unless'
|
487
|
+
require_relative 'rubocop/cop/style/if_with_boolean_literal_branches'
|
475
488
|
require_relative 'rubocop/cop/style/if_with_semicolon'
|
476
489
|
require_relative 'rubocop/cop/style/implicit_runtime_error'
|
477
490
|
require_relative 'rubocop/cop/style/infinite_loop'
|