rubocop 0.75.0 → 0.79.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/config/default.yml +341 -316
- data/lib/rubocop.rb +48 -31
- data/lib/rubocop/ast/builder.rb +43 -41
- data/lib/rubocop/ast/node.rb +5 -1
- data/lib/rubocop/ast/node/block_node.rb +2 -0
- data/lib/rubocop/ast/node/def_node.rb +11 -0
- data/lib/rubocop/ast/node/forward_args_node.rb +18 -0
- data/lib/rubocop/ast/node/return_node.rb +24 -0
- data/lib/rubocop/ast/traversal.rb +11 -3
- data/lib/rubocop/cli.rb +11 -227
- data/lib/rubocop/cli/command.rb +21 -0
- data/lib/rubocop/cli/command/auto_genenerate_config.rb +105 -0
- data/lib/rubocop/cli/command/base.rb +33 -0
- data/lib/rubocop/cli/command/execute_runner.rb +76 -0
- data/lib/rubocop/cli/command/init_dotfile.rb +45 -0
- data/lib/rubocop/cli/command/show_cops.rb +80 -0
- data/lib/rubocop/cli/command/version.rb +17 -0
- data/lib/rubocop/cli/environment.rb +21 -0
- data/lib/rubocop/comment_config.rb +2 -2
- data/lib/rubocop/config.rb +8 -1
- data/lib/rubocop/config_loader.rb +20 -20
- data/lib/rubocop/config_loader_resolver.rb +2 -1
- data/lib/rubocop/config_obsoletion.rb +73 -11
- data/lib/rubocop/config_validator.rb +77 -110
- data/lib/rubocop/cop/autocorrect_logic.rb +7 -4
- data/lib/rubocop/cop/bundler/gem_comment.rb +4 -4
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +2 -2
- data/lib/rubocop/cop/commissioner.rb +15 -7
- data/lib/rubocop/cop/cop.rb +31 -6
- data/lib/rubocop/cop/corrector.rb +8 -7
- data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/space_corrector.rb +1 -2
- data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +1 -1
- data/lib/rubocop/cop/generator.rb +3 -4
- data/lib/rubocop/cop/generator/configuration_injector.rb +2 -2
- data/lib/rubocop/cop/internal_affairs.rb +1 -0
- data/lib/rubocop/cop/internal_affairs/method_name_equal.rb +59 -0
- data/lib/rubocop/cop/layout/{align_arguments.rb → argument_alignment.rb} +1 -1
- data/lib/rubocop/cop/layout/{align_array.rb → array_alignment.rb} +1 -1
- data/lib/rubocop/cop/layout/{indent_assignment.rb → assignment_indentation.rb} +3 -2
- data/lib/rubocop/cop/layout/comment_indentation.rb +10 -13
- data/lib/rubocop/cop/layout/empty_comment.rb +7 -16
- data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +22 -7
- data/lib/rubocop/cop/layout/empty_line_after_magic_comment.rb +2 -2
- data/lib/rubocop/cop/layout/empty_lines_around_class_body.rb +2 -2
- data/lib/rubocop/cop/layout/end_of_line.rb +8 -3
- data/lib/rubocop/cop/layout/extra_spacing.rb +1 -1
- data/lib/rubocop/cop/layout/{indent_first_argument.rb → first_argument_indentation.rb} +14 -12
- data/lib/rubocop/cop/layout/{indent_first_array_element.rb → first_array_element_indentation.rb} +4 -4
- data/lib/rubocop/cop/layout/{indent_first_hash_element.rb → first_hash_element_indentation.rb} +4 -4
- data/lib/rubocop/cop/layout/{indent_first_parameter.rb → first_parameter_indentation.rb} +3 -3
- data/lib/rubocop/cop/layout/{align_hash.rb → hash_alignment.rb} +16 -8
- data/lib/rubocop/cop/layout/{indent_heredoc.rb → heredoc_indentation.rb} +5 -5
- data/lib/rubocop/cop/layout/{leading_blank_lines.rb → leading_empty_lines.rb} +1 -1
- data/lib/rubocop/cop/{metrics → layout}/line_length.rb +41 -114
- data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +14 -5
- data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +1 -1
- data/lib/rubocop/cop/layout/{align_parameters.rb → parameter_alignment.rb} +1 -1
- data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +2 -0
- data/lib/rubocop/cop/layout/space_around_keyword.rb +12 -0
- data/lib/rubocop/cop/layout/space_around_operators.rb +32 -7
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +17 -0
- data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +9 -7
- data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +7 -4
- data/lib/rubocop/cop/layout/space_inside_parens.rb +6 -6
- data/lib/rubocop/cop/layout/{trailing_blank_lines.rb → trailing_empty_lines.rb} +1 -1
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +18 -2
- data/lib/rubocop/cop/lint/debugger.rb +2 -2
- data/lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb +1 -1
- data/lib/rubocop/cop/lint/{duplicated_key.rb → duplicate_hash_key.rb} +1 -1
- data/lib/rubocop/cop/lint/each_with_object_argument.rb +1 -1
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +9 -8
- data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +1 -1
- data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +2 -2
- data/lib/rubocop/cop/lint/{multiple_compare.rb → multiple_comparison.rb} +1 -1
- data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +89 -0
- data/lib/rubocop/cop/lint/{unneeded_cop_disable_directive.rb → redundant_cop_disable_directive.rb} +26 -26
- data/lib/rubocop/cop/lint/{unneeded_cop_enable_directive.rb → redundant_cop_enable_directive.rb} +10 -12
- data/lib/rubocop/cop/lint/{unneeded_require_statement.rb → redundant_require_statement.rb} +1 -1
- data/lib/rubocop/cop/lint/{unneeded_splat_expansion.rb → redundant_splat_expansion.rb} +6 -6
- data/lib/rubocop/cop/lint/{string_conversion_in_interpolation.rb → redundant_string_coercion.rb} +1 -1
- data/lib/rubocop/cop/lint/redundant_with_index.rb +2 -2
- data/lib/rubocop/cop/lint/redundant_with_object.rb +2 -2
- data/lib/rubocop/cop/lint/safe_navigation_chain.rb +5 -6
- data/lib/rubocop/cop/lint/{handle_exceptions.rb → suppressed_exception.rb} +1 -1
- data/lib/rubocop/cop/lint/unused_block_argument.rb +22 -6
- data/lib/rubocop/cop/lint/unused_method_argument.rb +23 -5
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +57 -23
- data/lib/rubocop/cop/lint/useless_setter_call.rb +1 -1
- data/lib/rubocop/cop/lint/void.rb +7 -26
- data/lib/rubocop/cop/metrics/abc_size.rb +1 -1
- data/lib/rubocop/cop/metrics/method_length.rb +1 -1
- data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +23 -6
- data/lib/rubocop/cop/migration/department_name.rb +16 -1
- data/lib/rubocop/cop/mixin/alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/frozen_string_literal.rb +1 -7
- data/lib/rubocop/cop/mixin/{hash_alignment.rb → hash_alignment_styles.rb} +1 -1
- data/lib/rubocop/cop/mixin/line_length_help.rb +88 -0
- data/lib/rubocop/cop/mixin/method_complexity.rb +2 -1
- data/lib/rubocop/cop/mixin/nil_methods.rb +4 -4
- data/lib/rubocop/cop/mixin/rational_literal.rb +18 -0
- data/lib/rubocop/cop/mixin/statement_modifier.rb +7 -4
- data/lib/rubocop/cop/mixin/trailing_comma.rb +14 -9
- data/lib/rubocop/cop/naming/{uncommunicative_block_param_name.rb → block_parameter_name.rb} +3 -3
- data/lib/rubocop/cop/naming/file_name.rb +12 -5
- data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +5 -5
- data/lib/rubocop/cop/naming/{uncommunicative_method_param_name.rb → method_parameter_name.rb} +4 -4
- data/lib/rubocop/cop/naming/predicate_name.rb +6 -6
- data/lib/rubocop/cop/offense.rb +11 -0
- data/lib/rubocop/cop/registry.rb +8 -3
- data/lib/rubocop/cop/style/alias.rb +1 -1
- data/lib/rubocop/cop/style/array_join.rb +1 -1
- data/lib/rubocop/cop/style/attr.rb +10 -2
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +6 -6
- data/lib/rubocop/cop/style/comment_annotation.rb +5 -5
- data/lib/rubocop/cop/style/conditional_assignment.rb +2 -2
- data/lib/rubocop/cop/style/copyright.rb +11 -7
- data/lib/rubocop/cop/style/documentation_method.rb +44 -0
- data/lib/rubocop/cop/style/double_cop_disable_directive.rb +2 -2
- data/lib/rubocop/cop/style/empty_case_condition.rb +2 -2
- data/lib/rubocop/cop/style/empty_literal.rb +2 -2
- data/lib/rubocop/cop/style/empty_method.rb +5 -5
- data/lib/rubocop/cop/style/eval_with_location.rb +1 -1
- data/lib/rubocop/cop/style/even_odd.rb +1 -1
- data/lib/rubocop/cop/style/expand_path_arguments.rb +1 -1
- data/lib/rubocop/cop/style/format_string.rb +10 -7
- data/lib/rubocop/cop/style/format_string_token.rb +15 -34
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +10 -0
- data/lib/rubocop/cop/style/guard_clause.rb +3 -2
- data/lib/rubocop/cop/style/hash_syntax.rb +2 -2
- data/lib/rubocop/cop/style/if_unless_modifier.rb +45 -3
- data/lib/rubocop/cop/style/infinite_loop.rb +5 -4
- data/lib/rubocop/cop/style/inverse_methods.rb +19 -13
- data/lib/rubocop/cop/style/ip_addresses.rb +4 -4
- data/lib/rubocop/cop/style/line_end_concatenation.rb +14 -10
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +24 -227
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +168 -0
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb +54 -0
- data/lib/rubocop/cop/style/method_def_parentheses.rb +17 -9
- data/lib/rubocop/cop/style/mixin_grouping.rb +1 -1
- data/lib/rubocop/cop/style/multiline_method_signature.rb +1 -1
- data/lib/rubocop/cop/style/multiline_when_then.rb +6 -2
- data/lib/rubocop/cop/style/nested_modifier.rb +4 -2
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +5 -5
- data/lib/rubocop/cop/style/next.rb +5 -5
- data/lib/rubocop/cop/style/non_nil_check.rb +21 -9
- data/lib/rubocop/cop/style/numeric_literals.rb +7 -3
- data/lib/rubocop/cop/style/numeric_predicate.rb +4 -3
- data/lib/rubocop/cop/style/option_hash.rb +3 -3
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +7 -7
- data/lib/rubocop/cop/style/{unneeded_capital_w.rb → redundant_capital_w.rb} +1 -1
- data/lib/rubocop/cop/style/{unneeded_condition.rb → redundant_condition.rb} +3 -3
- data/lib/rubocop/cop/style/{unneeded_interpolation.rb → redundant_interpolation.rb} +1 -1
- data/lib/rubocop/cop/style/redundant_parentheses.rb +3 -3
- data/lib/rubocop/cop/style/{unneeded_percent_q.rb → redundant_percent_q.rb} +1 -1
- data/lib/rubocop/cop/style/redundant_return.rb +39 -29
- data/lib/rubocop/cop/style/{unneeded_sort.rb → redundant_sort.rb} +5 -5
- data/lib/rubocop/cop/style/safe_navigation.rb +19 -8
- data/lib/rubocop/cop/style/semicolon.rb +13 -2
- data/lib/rubocop/cop/style/special_global_vars.rb +5 -7
- data/lib/rubocop/cop/style/trailing_underscore_variable.rb +7 -1
- data/lib/rubocop/cop/style/trivial_accessors.rb +5 -5
- data/lib/rubocop/cop/style/while_until_modifier.rb +1 -1
- data/lib/rubocop/cop/style/yoda_condition.rb +16 -1
- data/lib/rubocop/cop/team.rb +5 -0
- data/lib/rubocop/cop/util.rb +1 -1
- data/lib/rubocop/cop/utils/format_string.rb +10 -18
- data/lib/rubocop/cop/variable_force.rb +7 -5
- data/lib/rubocop/formatter/base_formatter.rb +2 -2
- data/lib/rubocop/formatter/clang_style_formatter.rb +9 -6
- data/lib/rubocop/formatter/emacs_style_formatter.rb +22 -12
- data/lib/rubocop/formatter/file_list_formatter.rb +1 -1
- data/lib/rubocop/formatter/formatter_set.rb +16 -16
- data/lib/rubocop/formatter/json_formatter.rb +6 -5
- data/lib/rubocop/formatter/pacman_formatter.rb +3 -3
- data/lib/rubocop/formatter/simple_text_formatter.rb +7 -3
- data/lib/rubocop/formatter/tap_formatter.rb +9 -6
- data/lib/rubocop/node_pattern.rb +4 -2
- data/lib/rubocop/options.rb +20 -26
- data/lib/rubocop/processed_source.rb +1 -1
- data/lib/rubocop/rake_task.rb +1 -0
- data/lib/rubocop/result_cache.rb +24 -8
- data/lib/rubocop/rspec/shared_contexts.rb +5 -0
- data/lib/rubocop/runner.rb +50 -29
- data/lib/rubocop/target_finder.rb +12 -6
- data/lib/rubocop/target_ruby.rb +151 -0
- data/lib/rubocop/version.rb +1 -1
- metadata +50 -34
- data/lib/rubocop/cop/mixin/safe_mode.rb +0 -24
@@ -163,7 +163,7 @@ module RuboCop
|
|
163
163
|
ast, comments, tokens = parser.tokenize(@buffer)
|
164
164
|
|
165
165
|
ast.respond_to?(:complete!) && ast.complete!
|
166
|
-
rescue Parser::SyntaxError # rubocop:disable Lint/
|
166
|
+
rescue Parser::SyntaxError # rubocop:disable Lint/SuppressedException
|
167
167
|
# All errors are in diagnostics. No need to handle exception.
|
168
168
|
end
|
169
169
|
|
data/lib/rubocop/rake_task.rb
CHANGED
data/lib/rubocop/result_cache.rb
CHANGED
@@ -77,12 +77,13 @@ module RuboCop
|
|
77
77
|
config_store.for('.').for_all_cops['AllowSymlinksInCacheRootDirectory']
|
78
78
|
end
|
79
79
|
|
80
|
-
def initialize(file, options, config_store, cache_root = nil)
|
80
|
+
def initialize(file, team, options, config_store, cache_root = nil)
|
81
81
|
cache_root ||= ResultCache.cache_root(config_store)
|
82
82
|
@allow_symlinks_in_cache_location =
|
83
83
|
ResultCache.allow_symlinks_in_cache_location?(config_store)
|
84
|
-
@path = File.join(cache_root,
|
85
|
-
|
84
|
+
@path = File.join(cache_root,
|
85
|
+
rubocop_checksum,
|
86
|
+
context_checksum(team, options),
|
86
87
|
file_checksum(file, config_store))
|
87
88
|
@cached_data = CachedData.new(file)
|
88
89
|
end
|
@@ -100,7 +101,7 @@ module RuboCop
|
|
100
101
|
|
101
102
|
begin
|
102
103
|
FileUtils.mkdir_p(dir)
|
103
|
-
rescue Errno::EACCES => e
|
104
|
+
rescue Errno::EACCES, Errno::EROFS => e
|
104
105
|
warn "Couldn't create cache directory. Continuing without cache."\
|
105
106
|
"\n #{e.message}"
|
106
107
|
return
|
@@ -182,10 +183,25 @@ module RuboCop
|
|
182
183
|
# don't affect caching.
|
183
184
|
def relevant_options_digest(options)
|
184
185
|
options = options.reject { |key, _| NON_CHANGING.include?(key) }
|
185
|
-
options
|
186
|
-
|
187
|
-
|
188
|
-
|
186
|
+
options.to_s.gsub(/[^a-z]+/i, '_')
|
187
|
+
end
|
188
|
+
|
189
|
+
# The external dependency checksums are cached per RuboCop team so that
|
190
|
+
# the checksums don't need to be recomputed for each file.
|
191
|
+
def team_checksum(team)
|
192
|
+
@checksum_by_team ||= {}
|
193
|
+
@checksum_by_team[team.object_id] ||= team.external_dependency_checksum
|
194
|
+
end
|
195
|
+
|
196
|
+
# We combine team and options into a single "context" checksum to avoid
|
197
|
+
# making file names that are too long for some filesystems to handle.
|
198
|
+
# This context is for anything that's not (1) the RuboCop executable
|
199
|
+
# checksum or (2) the inspected file checksum.
|
200
|
+
def context_checksum(team, options)
|
201
|
+
Digest::SHA1.hexdigest([
|
202
|
+
team_checksum(team),
|
203
|
+
relevant_options_digest(options)
|
204
|
+
].join)
|
189
205
|
end
|
190
206
|
end
|
191
207
|
end
|
@@ -52,6 +52,7 @@ RSpec.shared_context 'config', :config do
|
|
52
52
|
cop_name = described_class.cop_name
|
53
53
|
hash[cop_name] = RuboCop::ConfigLoader
|
54
54
|
.default_configuration[cop_name]
|
55
|
+
.merge('Enabled' => true) # in case it is 'pending'
|
55
56
|
.merge(cop_config)
|
56
57
|
end
|
57
58
|
|
@@ -88,3 +89,7 @@ end
|
|
88
89
|
RSpec.shared_context 'ruby 2.6', :ruby26 do
|
89
90
|
let(:ruby_version) { 2.6 }
|
90
91
|
end
|
92
|
+
|
93
|
+
RSpec.shared_context 'ruby 2.7', :ruby27 do
|
94
|
+
let(:ruby_version) { 2.7 }
|
95
|
+
end
|
data/lib/rubocop/runner.rb
CHANGED
@@ -104,30 +104,31 @@ module RuboCop
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def process_file(file)
|
107
|
-
puts "Scanning #{file}" if @options[:debug]
|
108
107
|
file_started(file)
|
109
|
-
|
110
108
|
offenses = file_offenses(file)
|
111
|
-
if @options[:display_only_fail_level_offenses]
|
112
|
-
offenses = offenses.select { |o| considered_failure?(o) }
|
113
|
-
end
|
114
|
-
formatter_set.file_finished(file, offenses)
|
115
|
-
offenses
|
116
109
|
rescue InfiniteCorrectionLoop => e
|
117
|
-
|
110
|
+
offenses = e.offenses.compact.sort.freeze
|
118
111
|
raise
|
112
|
+
ensure
|
113
|
+
file_finished(file, offenses || [])
|
119
114
|
end
|
120
115
|
|
121
116
|
def file_offenses(file)
|
122
117
|
file_offense_cache(file) do
|
123
118
|
source = get_processed_source(file)
|
124
119
|
source, offenses = do_inspection_loop(file, source)
|
125
|
-
|
120
|
+
add_redundant_disables(file, offenses.compact.sort, source)
|
126
121
|
end
|
127
122
|
end
|
128
123
|
|
124
|
+
def cached_result(file, team)
|
125
|
+
ResultCache.new(file, team, @options, @config_store)
|
126
|
+
end
|
127
|
+
|
129
128
|
def file_offense_cache(file)
|
130
|
-
|
129
|
+
config = @config_store.for(file)
|
130
|
+
cache = cached_result(file, standby_team(config)) if cached_run?
|
131
|
+
|
131
132
|
if cache&.valid?
|
132
133
|
offenses = cache.load
|
133
134
|
# If we're running --auto-correct and the cache says there are
|
@@ -146,33 +147,37 @@ module RuboCop
|
|
146
147
|
offenses
|
147
148
|
end
|
148
149
|
|
149
|
-
def
|
150
|
-
if
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
cop.check(offenses, source.disabled_line_ranges, source.comments)
|
157
|
-
offenses += cop.offenses
|
158
|
-
offenses += autocorrect_unneeded_disables(file, source, cop,
|
159
|
-
offenses)
|
160
|
-
end
|
150
|
+
def add_redundant_disables(file, offenses, source)
|
151
|
+
if check_for_redundant_disables?(source)
|
152
|
+
redundant_cop_disable_directive(file) do |cop|
|
153
|
+
cop.check(offenses, source.disabled_line_ranges, source.comments)
|
154
|
+
offenses += cop.offenses
|
155
|
+
offenses += autocorrect_redundant_disables(file, source, cop,
|
156
|
+
offenses)
|
161
157
|
end
|
162
158
|
end
|
163
159
|
|
164
160
|
offenses.sort.reject(&:disabled?).freeze
|
165
161
|
end
|
166
162
|
|
167
|
-
def
|
163
|
+
def check_for_redundant_disables?(source)
|
168
164
|
!source.disabled_line_ranges.empty? && !filtered_run?
|
169
165
|
end
|
170
166
|
|
167
|
+
def redundant_cop_disable_directive(file)
|
168
|
+
config = @config_store.for(file)
|
169
|
+
if config.for_cop(Cop::Lint::RedundantCopDisableDirective)
|
170
|
+
.fetch('Enabled')
|
171
|
+
cop = Cop::Lint::RedundantCopDisableDirective.new(config, @options)
|
172
|
+
yield cop if cop.relevant_file?(file)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
171
176
|
def filtered_run?
|
172
177
|
@options[:except] || @options[:only]
|
173
178
|
end
|
174
179
|
|
175
|
-
def
|
180
|
+
def autocorrect_redundant_disables(file, source, cop, offenses)
|
176
181
|
cop.processed_source = source
|
177
182
|
|
178
183
|
team = Cop::Team.new(RuboCop::Cop::Registry.new, nil, @options)
|
@@ -180,7 +185,7 @@ module RuboCop
|
|
180
185
|
|
181
186
|
return [] unless team.updated_source_file?
|
182
187
|
|
183
|
-
# Do one extra inspection loop if any
|
188
|
+
# Do one extra inspection loop if any redundant disables were
|
184
189
|
# removed. This is done in order to find rubocop:enable directives that
|
185
190
|
# have now become useless.
|
186
191
|
_source, new_offenses = do_inspection_loop(file,
|
@@ -189,11 +194,19 @@ module RuboCop
|
|
189
194
|
end
|
190
195
|
|
191
196
|
def file_started(file)
|
197
|
+
puts "Scanning #{file}" if @options[:debug]
|
192
198
|
formatter_set.file_started(file,
|
193
199
|
cli_options: @options,
|
194
200
|
config_store: @config_store)
|
195
201
|
end
|
196
202
|
|
203
|
+
def file_finished(file, offenses)
|
204
|
+
if @options[:display_only_fail_level_offenses]
|
205
|
+
offenses = offenses.select { |o| considered_failure?(o) }
|
206
|
+
end
|
207
|
+
formatter_set.file_finished(file, offenses)
|
208
|
+
end
|
209
|
+
|
197
210
|
def cached_run?
|
198
211
|
@cached_run ||=
|
199
212
|
(@options[:cache] == 'true' ||
|
@@ -201,7 +214,7 @@ module RuboCop
|
|
201
214
|
@config_store.for(Dir.pwd).for_all_cops['UseCache']) &&
|
202
215
|
# When running --auto-gen-config, there's some processing done in the
|
203
216
|
# cops related to calculating the Max parameters for Metrics cops. We
|
204
|
-
# need to do that processing and
|
217
|
+
# need to do that processing and cannot use caching.
|
205
218
|
!@options[:auto_gen_config] &&
|
206
219
|
# We can't cache results from code which is piped in to stdin
|
207
220
|
!@options[:stdin]
|
@@ -291,9 +304,7 @@ module RuboCop
|
|
291
304
|
@mobilized_cop_classes[config.object_id] ||= begin
|
292
305
|
cop_classes = Cop::Cop.all
|
293
306
|
|
294
|
-
|
295
|
-
OptionsValidator.validate_cop_list(@options[opt])
|
296
|
-
end
|
307
|
+
OptionsValidator.new(@options).validate_cop_options
|
297
308
|
|
298
309
|
if @options[:only]
|
299
310
|
cop_classes.select! { |c| c.match?(@options[:only]) }
|
@@ -354,5 +365,15 @@ module RuboCop
|
|
354
365
|
ProcessedSource.from_file(file, ruby_version)
|
355
366
|
end
|
356
367
|
end
|
368
|
+
|
369
|
+
# A Cop::Team instance is stateful and may change when inspecting.
|
370
|
+
# The "standby" team for a given config is an initialized but
|
371
|
+
# otherwise dormant team that can be used for config- and option-
|
372
|
+
# level caching in ResultCache.
|
373
|
+
def standby_team(config)
|
374
|
+
@team_by_config ||= {}
|
375
|
+
@team_by_config[config.object_id] ||=
|
376
|
+
Cop::Team.new(mobilized_cop_classes(config), config, @options)
|
377
|
+
end
|
357
378
|
end
|
358
379
|
end
|
@@ -65,12 +65,7 @@ module RuboCop
|
|
65
65
|
to_inspect?(file, hidden_files, base_dir_config)
|
66
66
|
end
|
67
67
|
|
68
|
-
|
69
|
-
# Most recently modified file first.
|
70
|
-
target_files.sort_by! { |path| -Integer(File.mtime(path)) }
|
71
|
-
else
|
72
|
-
target_files.sort!
|
73
|
-
end
|
68
|
+
target_files.sort_by!(&order)
|
74
69
|
end
|
75
70
|
|
76
71
|
def to_inspect?(file, hidden_files, base_dir_config)
|
@@ -186,5 +181,16 @@ module RuboCop
|
|
186
181
|
config.file_to_exclude?(file)
|
187
182
|
end
|
188
183
|
end
|
184
|
+
|
185
|
+
private
|
186
|
+
|
187
|
+
def order
|
188
|
+
if fail_fast?
|
189
|
+
# Most recently modified file first.
|
190
|
+
->(path) { -Integer(File.mtime(path)) }
|
191
|
+
else
|
192
|
+
:itself
|
193
|
+
end
|
194
|
+
end
|
189
195
|
end
|
190
196
|
end
|
@@ -0,0 +1,151 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
# The kind of Ruby that code inspected by RuboCop is written in.
|
5
|
+
class TargetRuby
|
6
|
+
KNOWN_RUBIES = [2.3, 2.4, 2.5, 2.6, 2.7].freeze
|
7
|
+
DEFAULT_VERSION = KNOWN_RUBIES.first
|
8
|
+
|
9
|
+
OBSOLETE_RUBIES = {
|
10
|
+
1.9 => '0.50', 2.0 => '0.50', 2.1 => '0.58', 2.2 => '0.69'
|
11
|
+
}.freeze
|
12
|
+
private_constant :KNOWN_RUBIES, :OBSOLETE_RUBIES
|
13
|
+
|
14
|
+
# A place where information about a target ruby version is found.
|
15
|
+
class Source
|
16
|
+
attr_reader :version, :name
|
17
|
+
|
18
|
+
def initialize(config)
|
19
|
+
@config = config
|
20
|
+
@version = find_version
|
21
|
+
end
|
22
|
+
|
23
|
+
def to_s
|
24
|
+
name
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
# The target ruby version may be configured in RuboCop's config.
|
29
|
+
class RuboCopConfig < Source
|
30
|
+
def name
|
31
|
+
"`TargetRubyVersion` parameter (in #{@config.smart_loaded_path})"
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def find_version
|
37
|
+
@config.for_all_cops['TargetRubyVersion']&.to_f
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# The target ruby version may be found in a .ruby-version file.
|
42
|
+
class RubyVersionFile < Source
|
43
|
+
FILENAME = '.ruby-version'
|
44
|
+
|
45
|
+
def name
|
46
|
+
"`#{FILENAME}`"
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def find_version
|
52
|
+
file = ruby_version_file
|
53
|
+
return unless file && File.file?(file)
|
54
|
+
|
55
|
+
File.read(file).match(/\A(ruby-)?(?<version>\d+\.\d+)/) do |md|
|
56
|
+
md[:version].to_f
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def ruby_version_file
|
61
|
+
@ruby_version_file ||=
|
62
|
+
@config.find_file_upwards(FILENAME,
|
63
|
+
@config.base_dir_for_path_parameters)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# The lock file of Bundler may identify the target ruby version.
|
68
|
+
class BundlerLockFile < Source
|
69
|
+
def name
|
70
|
+
"`#{bundler_lock_file_path}`"
|
71
|
+
end
|
72
|
+
|
73
|
+
private
|
74
|
+
|
75
|
+
def find_version
|
76
|
+
lock_file_path = bundler_lock_file_path
|
77
|
+
return nil unless lock_file_path
|
78
|
+
|
79
|
+
in_ruby_section = false
|
80
|
+
File.foreach(lock_file_path) do |line|
|
81
|
+
# If ruby is in Gemfile.lock or gems.lock, there should be two lines
|
82
|
+
# towards the bottom of the file that look like:
|
83
|
+
# RUBY VERSION
|
84
|
+
# ruby W.X.YpZ
|
85
|
+
# We ultimately want to match the "ruby W.X.Y.pZ" line, but there's
|
86
|
+
# extra logic to make sure we only start looking once we've seen the
|
87
|
+
# "RUBY VERSION" line.
|
88
|
+
in_ruby_section ||= line.match(/^\s*RUBY\s*VERSION\s*$/)
|
89
|
+
next unless in_ruby_section
|
90
|
+
|
91
|
+
# We currently only allow this feature to work with MRI ruby. If
|
92
|
+
# jruby (or something else) is used by the project, it's lock file
|
93
|
+
# will have a line that looks like:
|
94
|
+
# RUBY VERSION
|
95
|
+
# ruby W.X.YpZ (jruby x.x.x.x)
|
96
|
+
# The regex won't match in this situation.
|
97
|
+
result = line.match(/^\s*ruby\s+(\d+\.\d+)[p.\d]*\s*$/)
|
98
|
+
return result.captures.first.to_f if result
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def bundler_lock_file_path
|
103
|
+
@config.bundler_lock_file_path
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
# If all else fails, a default version will be picked.
|
108
|
+
class Default < Source
|
109
|
+
def name
|
110
|
+
'default'
|
111
|
+
end
|
112
|
+
|
113
|
+
private
|
114
|
+
|
115
|
+
def find_version
|
116
|
+
DEFAULT_VERSION
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
def self.supported_versions
|
121
|
+
KNOWN_RUBIES
|
122
|
+
end
|
123
|
+
|
124
|
+
SOURCES = [RuboCopConfig, RubyVersionFile, BundlerLockFile, Default].freeze
|
125
|
+
private_constant :SOURCES
|
126
|
+
|
127
|
+
def initialize(config)
|
128
|
+
@config = config
|
129
|
+
end
|
130
|
+
|
131
|
+
def source
|
132
|
+
@source ||= SOURCES.each.lazy.map { |c| c.new(@config) }.detect(&:version)
|
133
|
+
end
|
134
|
+
|
135
|
+
def version
|
136
|
+
source.version
|
137
|
+
end
|
138
|
+
|
139
|
+
def supported?
|
140
|
+
KNOWN_RUBIES.include?(version)
|
141
|
+
end
|
142
|
+
|
143
|
+
def rubocop_version_with_support
|
144
|
+
if supported?
|
145
|
+
RuboCop::Version.version
|
146
|
+
else
|
147
|
+
OBSOLETE_RUBIES[version]
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
data/lib/rubocop/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.79.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-01-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: jaro_winkler
|
@@ -46,14 +46,14 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
49
|
+
version: 2.7.0.1
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
56
|
+
version: 2.7.0.1
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: rainbow
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -163,6 +163,7 @@ files:
|
|
163
163
|
- lib/rubocop/ast/node/ensure_node.rb
|
164
164
|
- lib/rubocop/ast/node/float_node.rb
|
165
165
|
- lib/rubocop/ast/node/for_node.rb
|
166
|
+
- lib/rubocop/ast/node/forward_args_node.rb
|
166
167
|
- lib/rubocop/ast/node/hash_node.rb
|
167
168
|
- lib/rubocop/ast/node/if_node.rb
|
168
169
|
- lib/rubocop/ast/node/int_node.rb
|
@@ -185,6 +186,7 @@ files:
|
|
185
186
|
- lib/rubocop/ast/node/regexp_node.rb
|
186
187
|
- lib/rubocop/ast/node/resbody_node.rb
|
187
188
|
- lib/rubocop/ast/node/retry_node.rb
|
189
|
+
- lib/rubocop/ast/node/return_node.rb
|
188
190
|
- lib/rubocop/ast/node/self_class_node.rb
|
189
191
|
- lib/rubocop/ast/node/send_node.rb
|
190
192
|
- lib/rubocop/ast/node/str_node.rb
|
@@ -198,6 +200,14 @@ files:
|
|
198
200
|
- lib/rubocop/ast/traversal.rb
|
199
201
|
- lib/rubocop/cached_data.rb
|
200
202
|
- lib/rubocop/cli.rb
|
203
|
+
- lib/rubocop/cli/command.rb
|
204
|
+
- lib/rubocop/cli/command/auto_genenerate_config.rb
|
205
|
+
- lib/rubocop/cli/command/base.rb
|
206
|
+
- lib/rubocop/cli/command/execute_runner.rb
|
207
|
+
- lib/rubocop/cli/command/init_dotfile.rb
|
208
|
+
- lib/rubocop/cli/command/show_cops.rb
|
209
|
+
- lib/rubocop/cli/command/version.rb
|
210
|
+
- lib/rubocop/cli/environment.rb
|
201
211
|
- lib/rubocop/comment_config.rb
|
202
212
|
- lib/rubocop/config.rb
|
203
213
|
- lib/rubocop/config_loader.rb
|
@@ -239,6 +249,7 @@ files:
|
|
239
249
|
- lib/rubocop/cop/generator/require_file_injector.rb
|
240
250
|
- lib/rubocop/cop/ignored_node.rb
|
241
251
|
- lib/rubocop/cop/internal_affairs.rb
|
252
|
+
- lib/rubocop/cop/internal_affairs/method_name_equal.rb
|
242
253
|
- lib/rubocop/cop/internal_affairs/node_destructuring.rb
|
243
254
|
- lib/rubocop/cop/internal_affairs/node_type_predicate.rb
|
244
255
|
- lib/rubocop/cop/internal_affairs/offense_location_keyword.rb
|
@@ -246,10 +257,9 @@ files:
|
|
246
257
|
- lib/rubocop/cop/internal_affairs/redundant_message_argument.rb
|
247
258
|
- lib/rubocop/cop/internal_affairs/useless_message_assertion.rb
|
248
259
|
- lib/rubocop/cop/layout/access_modifier_indentation.rb
|
249
|
-
- lib/rubocop/cop/layout/
|
250
|
-
- lib/rubocop/cop/layout/
|
251
|
-
- lib/rubocop/cop/layout/
|
252
|
-
- lib/rubocop/cop/layout/align_parameters.rb
|
260
|
+
- lib/rubocop/cop/layout/argument_alignment.rb
|
261
|
+
- lib/rubocop/cop/layout/array_alignment.rb
|
262
|
+
- lib/rubocop/cop/layout/assignment_indentation.rb
|
253
263
|
- lib/rubocop/cop/layout/block_alignment.rb
|
254
264
|
- lib/rubocop/cop/layout/block_end_newline.rb
|
255
265
|
- lib/rubocop/cop/layout/case_indentation.rb
|
@@ -277,22 +287,23 @@ files:
|
|
277
287
|
- lib/rubocop/cop/layout/end_alignment.rb
|
278
288
|
- lib/rubocop/cop/layout/end_of_line.rb
|
279
289
|
- lib/rubocop/cop/layout/extra_spacing.rb
|
290
|
+
- lib/rubocop/cop/layout/first_argument_indentation.rb
|
291
|
+
- lib/rubocop/cop/layout/first_array_element_indentation.rb
|
280
292
|
- lib/rubocop/cop/layout/first_array_element_line_break.rb
|
293
|
+
- lib/rubocop/cop/layout/first_hash_element_indentation.rb
|
281
294
|
- lib/rubocop/cop/layout/first_hash_element_line_break.rb
|
282
295
|
- lib/rubocop/cop/layout/first_method_argument_line_break.rb
|
283
296
|
- lib/rubocop/cop/layout/first_method_parameter_line_break.rb
|
297
|
+
- lib/rubocop/cop/layout/first_parameter_indentation.rb
|
298
|
+
- lib/rubocop/cop/layout/hash_alignment.rb
|
284
299
|
- lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb
|
285
|
-
- lib/rubocop/cop/layout/
|
286
|
-
- lib/rubocop/cop/layout/indent_first_argument.rb
|
287
|
-
- lib/rubocop/cop/layout/indent_first_array_element.rb
|
288
|
-
- lib/rubocop/cop/layout/indent_first_hash_element.rb
|
289
|
-
- lib/rubocop/cop/layout/indent_first_parameter.rb
|
290
|
-
- lib/rubocop/cop/layout/indent_heredoc.rb
|
300
|
+
- lib/rubocop/cop/layout/heredoc_indentation.rb
|
291
301
|
- lib/rubocop/cop/layout/indentation_consistency.rb
|
292
302
|
- lib/rubocop/cop/layout/indentation_width.rb
|
293
303
|
- lib/rubocop/cop/layout/initial_indentation.rb
|
294
|
-
- lib/rubocop/cop/layout/leading_blank_lines.rb
|
295
304
|
- lib/rubocop/cop/layout/leading_comment_space.rb
|
305
|
+
- lib/rubocop/cop/layout/leading_empty_lines.rb
|
306
|
+
- lib/rubocop/cop/layout/line_length.rb
|
296
307
|
- lib/rubocop/cop/layout/multiline_array_brace_layout.rb
|
297
308
|
- lib/rubocop/cop/layout/multiline_array_line_breaks.rb
|
298
309
|
- lib/rubocop/cop/layout/multiline_assignment_layout.rb
|
@@ -304,6 +315,7 @@ files:
|
|
304
315
|
- lib/rubocop/cop/layout/multiline_method_call_indentation.rb
|
305
316
|
- lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb
|
306
317
|
- lib/rubocop/cop/layout/multiline_operation_indentation.rb
|
318
|
+
- lib/rubocop/cop/layout/parameter_alignment.rb
|
307
319
|
- lib/rubocop/cop/layout/rescue_ensure_alignment.rb
|
308
320
|
- lib/rubocop/cop/layout/space_after_colon.rb
|
309
321
|
- lib/rubocop/cop/layout/space_after_comma.rb
|
@@ -330,7 +342,7 @@ files:
|
|
330
342
|
- lib/rubocop/cop/layout/space_inside_reference_brackets.rb
|
331
343
|
- lib/rubocop/cop/layout/space_inside_string_interpolation.rb
|
332
344
|
- lib/rubocop/cop/layout/tab.rb
|
333
|
-
- lib/rubocop/cop/layout/
|
345
|
+
- lib/rubocop/cop/layout/trailing_empty_lines.rb
|
334
346
|
- lib/rubocop/cop/layout/trailing_whitespace.rb
|
335
347
|
- lib/rubocop/cop/lint/ambiguous_block_association.rb
|
336
348
|
- lib/rubocop/cop/lint/ambiguous_operator.rb
|
@@ -343,8 +355,8 @@ files:
|
|
343
355
|
- lib/rubocop/cop/lint/deprecated_class_methods.rb
|
344
356
|
- lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb
|
345
357
|
- lib/rubocop/cop/lint/duplicate_case_condition.rb
|
358
|
+
- lib/rubocop/cop/lint/duplicate_hash_key.rb
|
346
359
|
- lib/rubocop/cop/lint/duplicate_methods.rb
|
347
|
-
- lib/rubocop/cop/lint/duplicated_key.rb
|
348
360
|
- lib/rubocop/cop/lint/each_with_object_argument.rb
|
349
361
|
- lib/rubocop/cop/lint/else_layout.rb
|
350
362
|
- lib/rubocop/cop/lint/empty_ensure.rb
|
@@ -357,7 +369,6 @@ files:
|
|
357
369
|
- lib/rubocop/cop/lint/flip_flop.rb
|
358
370
|
- lib/rubocop/cop/lint/float_out_of_range.rb
|
359
371
|
- lib/rubocop/cop/lint/format_parameter_mismatch.rb
|
360
|
-
- lib/rubocop/cop/lint/handle_exceptions.rb
|
361
372
|
- lib/rubocop/cop/lint/heredoc_method_call_position.rb
|
362
373
|
- lib/rubocop/cop/lint/implicit_string_concatenation.rb
|
363
374
|
- lib/rubocop/cop/lint/ineffective_access_modifier.rb
|
@@ -367,10 +378,11 @@ files:
|
|
367
378
|
- lib/rubocop/cop/lint/literal_in_interpolation.rb
|
368
379
|
- lib/rubocop/cop/lint/loop.rb
|
369
380
|
- lib/rubocop/cop/lint/missing_cop_enable_directive.rb
|
370
|
-
- lib/rubocop/cop/lint/
|
381
|
+
- lib/rubocop/cop/lint/multiple_comparison.rb
|
371
382
|
- lib/rubocop/cop/lint/nested_method_definition.rb
|
372
383
|
- lib/rubocop/cop/lint/nested_percent_literal.rb
|
373
384
|
- lib/rubocop/cop/lint/next_without_accumulator.rb
|
385
|
+
- lib/rubocop/cop/lint/non_deterministic_require_order.rb
|
374
386
|
- lib/rubocop/cop/lint/non_local_exit_from_iterator.rb
|
375
387
|
- lib/rubocop/cop/lint/number_conversion.rb
|
376
388
|
- lib/rubocop/cop/lint/ordered_magic_comments.rb
|
@@ -378,6 +390,11 @@ files:
|
|
378
390
|
- lib/rubocop/cop/lint/percent_string_array.rb
|
379
391
|
- lib/rubocop/cop/lint/percent_symbol_array.rb
|
380
392
|
- lib/rubocop/cop/lint/rand_one.rb
|
393
|
+
- lib/rubocop/cop/lint/redundant_cop_disable_directive.rb
|
394
|
+
- lib/rubocop/cop/lint/redundant_cop_enable_directive.rb
|
395
|
+
- lib/rubocop/cop/lint/redundant_require_statement.rb
|
396
|
+
- lib/rubocop/cop/lint/redundant_splat_expansion.rb
|
397
|
+
- lib/rubocop/cop/lint/redundant_string_coercion.rb
|
381
398
|
- lib/rubocop/cop/lint/redundant_with_index.rb
|
382
399
|
- lib/rubocop/cop/lint/redundant_with_object.rb
|
383
400
|
- lib/rubocop/cop/lint/regexp_as_condition.rb
|
@@ -393,15 +410,11 @@ files:
|
|
393
410
|
- lib/rubocop/cop/lint/shadowed_argument.rb
|
394
411
|
- lib/rubocop/cop/lint/shadowed_exception.rb
|
395
412
|
- lib/rubocop/cop/lint/shadowing_outer_local_variable.rb
|
396
|
-
- lib/rubocop/cop/lint/
|
413
|
+
- lib/rubocop/cop/lint/suppressed_exception.rb
|
397
414
|
- lib/rubocop/cop/lint/syntax.rb
|
398
415
|
- lib/rubocop/cop/lint/to_json.rb
|
399
416
|
- lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb
|
400
417
|
- lib/rubocop/cop/lint/unified_integer.rb
|
401
|
-
- lib/rubocop/cop/lint/unneeded_cop_disable_directive.rb
|
402
|
-
- lib/rubocop/cop/lint/unneeded_cop_enable_directive.rb
|
403
|
-
- lib/rubocop/cop/lint/unneeded_require_statement.rb
|
404
|
-
- lib/rubocop/cop/lint/unneeded_splat_expansion.rb
|
405
418
|
- lib/rubocop/cop/lint/unreachable_code.rb
|
406
419
|
- lib/rubocop/cop/lint/unused_block_argument.rb
|
407
420
|
- lib/rubocop/cop/lint/unused_method_argument.rb
|
@@ -419,7 +432,6 @@ files:
|
|
419
432
|
- lib/rubocop/cop/metrics/block_nesting.rb
|
420
433
|
- lib/rubocop/cop/metrics/class_length.rb
|
421
434
|
- lib/rubocop/cop/metrics/cyclomatic_complexity.rb
|
422
|
-
- lib/rubocop/cop/metrics/line_length.rb
|
423
435
|
- lib/rubocop/cop/metrics/method_length.rb
|
424
436
|
- lib/rubocop/cop/metrics/module_length.rb
|
425
437
|
- lib/rubocop/cop/metrics/parameter_lists.rb
|
@@ -448,12 +460,13 @@ files:
|
|
448
460
|
- lib/rubocop/cop/mixin/enforce_superclass.rb
|
449
461
|
- lib/rubocop/cop/mixin/first_element_line_break.rb
|
450
462
|
- lib/rubocop/cop/mixin/frozen_string_literal.rb
|
451
|
-
- lib/rubocop/cop/mixin/
|
463
|
+
- lib/rubocop/cop/mixin/hash_alignment_styles.rb
|
452
464
|
- lib/rubocop/cop/mixin/heredoc.rb
|
453
465
|
- lib/rubocop/cop/mixin/ignored_methods.rb
|
454
466
|
- lib/rubocop/cop/mixin/ignored_pattern.rb
|
455
467
|
- lib/rubocop/cop/mixin/integer_node.rb
|
456
468
|
- lib/rubocop/cop/mixin/interpolation.rb
|
469
|
+
- lib/rubocop/cop/mixin/line_length_help.rb
|
457
470
|
- lib/rubocop/cop/mixin/match_range.rb
|
458
471
|
- lib/rubocop/cop/mixin/method_complexity.rb
|
459
472
|
- lib/rubocop/cop/mixin/method_preference.rb
|
@@ -473,9 +486,9 @@ files:
|
|
473
486
|
- lib/rubocop/cop/mixin/preceding_following_alignment.rb
|
474
487
|
- lib/rubocop/cop/mixin/preferred_delimiters.rb
|
475
488
|
- lib/rubocop/cop/mixin/range_help.rb
|
489
|
+
- lib/rubocop/cop/mixin/rational_literal.rb
|
476
490
|
- lib/rubocop/cop/mixin/rescue_node.rb
|
477
491
|
- lib/rubocop/cop/mixin/safe_assignment.rb
|
478
|
-
- lib/rubocop/cop/mixin/safe_mode.rb
|
479
492
|
- lib/rubocop/cop/mixin/space_after_punctuation.rb
|
480
493
|
- lib/rubocop/cop/mixin/space_before_punctuation.rb
|
481
494
|
- lib/rubocop/cop/mixin/statement_modifier.rb
|
@@ -491,6 +504,7 @@ files:
|
|
491
504
|
- lib/rubocop/cop/naming/accessor_method_name.rb
|
492
505
|
- lib/rubocop/cop/naming/ascii_identifiers.rb
|
493
506
|
- lib/rubocop/cop/naming/binary_operator_parameter_name.rb
|
507
|
+
- lib/rubocop/cop/naming/block_parameter_name.rb
|
494
508
|
- lib/rubocop/cop/naming/class_and_module_camel_case.rb
|
495
509
|
- lib/rubocop/cop/naming/constant_name.rb
|
496
510
|
- lib/rubocop/cop/naming/file_name.rb
|
@@ -498,10 +512,9 @@ files:
|
|
498
512
|
- lib/rubocop/cop/naming/heredoc_delimiter_naming.rb
|
499
513
|
- lib/rubocop/cop/naming/memoized_instance_variable_name.rb
|
500
514
|
- lib/rubocop/cop/naming/method_name.rb
|
515
|
+
- lib/rubocop/cop/naming/method_parameter_name.rb
|
501
516
|
- lib/rubocop/cop/naming/predicate_name.rb
|
502
517
|
- lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb
|
503
|
-
- lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
|
504
|
-
- lib/rubocop/cop/naming/uncommunicative_method_param_name.rb
|
505
518
|
- lib/rubocop/cop/naming/variable_name.rb
|
506
519
|
- lib/rubocop/cop/naming/variable_number.rb
|
507
520
|
- lib/rubocop/cop/offense.rb
|
@@ -581,6 +594,8 @@ files:
|
|
581
594
|
- lib/rubocop/cop/style/lambda_call.rb
|
582
595
|
- lib/rubocop/cop/style/line_end_concatenation.rb
|
583
596
|
- lib/rubocop/cop/style/method_call_with_args_parentheses.rb
|
597
|
+
- lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb
|
598
|
+
- lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb
|
584
599
|
- lib/rubocop/cop/style/method_call_without_args_parentheses.rb
|
585
600
|
- lib/rubocop/cop/style/method_called_on_do_end_block.rb
|
586
601
|
- lib/rubocop/cop/style/method_def_parentheses.rb
|
@@ -627,12 +642,17 @@ files:
|
|
627
642
|
- lib/rubocop/cop/style/raise_args.rb
|
628
643
|
- lib/rubocop/cop/style/random_with_offset.rb
|
629
644
|
- lib/rubocop/cop/style/redundant_begin.rb
|
645
|
+
- lib/rubocop/cop/style/redundant_capital_w.rb
|
646
|
+
- lib/rubocop/cop/style/redundant_condition.rb
|
630
647
|
- lib/rubocop/cop/style/redundant_conditional.rb
|
631
648
|
- lib/rubocop/cop/style/redundant_exception.rb
|
632
649
|
- lib/rubocop/cop/style/redundant_freeze.rb
|
650
|
+
- lib/rubocop/cop/style/redundant_interpolation.rb
|
633
651
|
- lib/rubocop/cop/style/redundant_parentheses.rb
|
652
|
+
- lib/rubocop/cop/style/redundant_percent_q.rb
|
634
653
|
- lib/rubocop/cop/style/redundant_return.rb
|
635
654
|
- lib/rubocop/cop/style/redundant_self.rb
|
655
|
+
- lib/rubocop/cop/style/redundant_sort.rb
|
636
656
|
- lib/rubocop/cop/style/redundant_sort_by.rb
|
637
657
|
- lib/rubocop/cop/style/regexp_literal.rb
|
638
658
|
- lib/rubocop/cop/style/rescue_modifier.rb
|
@@ -669,11 +689,6 @@ files:
|
|
669
689
|
- lib/rubocop/cop/style/trailing_underscore_variable.rb
|
670
690
|
- lib/rubocop/cop/style/trivial_accessors.rb
|
671
691
|
- lib/rubocop/cop/style/unless_else.rb
|
672
|
-
- lib/rubocop/cop/style/unneeded_capital_w.rb
|
673
|
-
- lib/rubocop/cop/style/unneeded_condition.rb
|
674
|
-
- lib/rubocop/cop/style/unneeded_interpolation.rb
|
675
|
-
- lib/rubocop/cop/style/unneeded_percent_q.rb
|
676
|
-
- lib/rubocop/cop/style/unneeded_sort.rb
|
677
692
|
- lib/rubocop/cop/style/unpack_first.rb
|
678
693
|
- lib/rubocop/cop/style/variable_interpolation.rb
|
679
694
|
- lib/rubocop/cop/style/when_then.rb
|
@@ -735,6 +750,7 @@ files:
|
|
735
750
|
- lib/rubocop/string_interpreter.rb
|
736
751
|
- lib/rubocop/string_util.rb
|
737
752
|
- lib/rubocop/target_finder.rb
|
753
|
+
- lib/rubocop/target_ruby.rb
|
738
754
|
- lib/rubocop/token.rb
|
739
755
|
- lib/rubocop/version.rb
|
740
756
|
- lib/rubocop/warning.rb
|