rubocop 0.50.0 → 0.51.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 -6
- data/config/default.yml +20 -11
- data/config/enabled.yml +44 -7
- data/lib/rubocop.rb +526 -514
- data/lib/rubocop/ast/node.rb +9 -9
- data/lib/rubocop/ast/node/mixin/method_dispatch_node.rb +2 -2
- data/lib/rubocop/ast/node/send_node.rb +4 -0
- data/lib/rubocop/cached_data.rb +1 -6
- data/lib/rubocop/cli.rb +7 -6
- data/lib/rubocop/config.rb +58 -22
- data/lib/rubocop/config_loader.rb +37 -21
- data/lib/rubocop/config_loader_resolver.rb +3 -2
- data/lib/rubocop/cop/bundler/duplicated_gem.rb +5 -3
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +4 -2
- data/lib/rubocop/cop/bundler/ordered_gems.rb +2 -53
- data/lib/rubocop/cop/commissioner.rb +1 -4
- data/lib/rubocop/cop/cop.rb +50 -17
- data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +96 -0
- data/lib/rubocop/cop/generator.rb +8 -3
- data/lib/rubocop/cop/internal_affairs.rb +6 -5
- data/lib/rubocop/cop/internal_affairs/deprecated_positional_arguments.rb +81 -0
- data/lib/rubocop/cop/internal_affairs/node_type_predicate.rb +1 -1
- data/lib/rubocop/cop/internal_affairs/offense_location_keyword.rb +21 -11
- data/lib/rubocop/cop/internal_affairs/redundant_location_argument.rb +27 -14
- data/lib/rubocop/cop/internal_affairs/redundant_message_argument.rb +38 -16
- data/lib/rubocop/cop/internal_affairs/useless_message_assertion.rb +2 -2
- data/lib/rubocop/cop/layout/block_end_newline.rb +1 -1
- data/lib/rubocop/cop/layout/case_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/comment_indentation.rb +4 -2
- data/lib/rubocop/cop/layout/dot_position.rb +1 -1
- data/lib/rubocop/cop/layout/else_alignment.rb +5 -2
- data/lib/rubocop/cop/layout/empty_line_after_magic_comment.rb +1 -1
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +1 -1
- data/lib/rubocop/cop/layout/empty_lines.rb +1 -1
- data/lib/rubocop/cop/layout/end_of_line.rb +1 -1
- data/lib/rubocop/cop/layout/extra_spacing.rb +2 -2
- data/lib/rubocop/cop/layout/indent_array.rb +1 -1
- data/lib/rubocop/cop/layout/indent_hash.rb +1 -1
- data/lib/rubocop/cop/layout/indent_heredoc.rb +2 -2
- data/lib/rubocop/cop/layout/indentation_width.rb +7 -5
- data/lib/rubocop/cop/layout/initial_indentation.rb +3 -2
- data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +2 -2
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +1 -1
- data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +3 -1
- data/lib/rubocop/cop/layout/space_after_colon.rb +2 -2
- data/lib/rubocop/cop/layout/space_after_method_name.rb +1 -1
- data/lib/rubocop/cop/layout/space_around_block_parameters.rb +3 -2
- data/lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb +1 -1
- data/lib/rubocop/cop/layout/space_around_keyword.rb +1 -1
- data/lib/rubocop/cop/layout/space_around_operators.rb +1 -1
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +4 -4
- data/lib/rubocop/cop/layout/space_before_comment.rb +1 -1
- data/lib/rubocop/cop/layout/space_before_first_arg.rb +1 -1
- data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +6 -2
- data/lib/rubocop/cop/layout/space_inside_array_percent_literal.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_block_braces.rb +2 -2
- data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +5 -2
- data/lib/rubocop/cop/layout/space_inside_parens.rb +9 -0
- data/lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb +1 -1
- data/lib/rubocop/cop/layout/tab.rb +5 -2
- data/lib/rubocop/cop/layout/trailing_blank_lines.rb +4 -2
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +1 -1
- data/lib/rubocop/cop/lint/assignment_in_condition.rb +1 -1
- data/lib/rubocop/cop/lint/block_alignment.rb +1 -1
- data/lib/rubocop/cop/lint/boolean_symbol.rb +1 -1
- data/lib/rubocop/cop/lint/circular_argument_reference.rb +3 -14
- data/lib/rubocop/cop/lint/debugger.rb +7 -7
- data/lib/rubocop/cop/lint/deprecated_class_methods.rb +4 -4
- data/lib/rubocop/cop/lint/duplicate_methods.rb +5 -3
- data/lib/rubocop/cop/lint/empty_ensure.rb +1 -1
- data/lib/rubocop/cop/lint/empty_expression.rb +1 -1
- data/lib/rubocop/cop/lint/empty_when.rb +1 -1
- data/lib/rubocop/cop/lint/end_in_method.rb +1 -1
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +1 -1
- data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +1 -1
- data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +4 -3
- data/lib/rubocop/cop/lint/interpolation_check.rb +2 -1
- data/lib/rubocop/cop/lint/{literal_in_condition.rb → literal_as_condition.rb} +19 -5
- data/lib/rubocop/cop/lint/loop.rb +1 -1
- data/lib/rubocop/cop/lint/nested_method_definition.rb +1 -1
- data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +2 -2
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +3 -2
- data/lib/rubocop/cop/lint/percent_string_array.rb +1 -1
- data/lib/rubocop/cop/lint/rand_one.rb +1 -1
- data/lib/rubocop/cop/lint/redundant_with_index.rb +1 -1
- data/lib/rubocop/cop/lint/redundant_with_object.rb +81 -0
- data/lib/rubocop/cop/lint/regexp_as_condition.rb +29 -0
- data/lib/rubocop/cop/lint/require_parentheses.rb +1 -1
- data/lib/rubocop/cop/lint/rescue_type.rb +5 -3
- data/lib/rubocop/cop/lint/rescue_without_error_class.rb +6 -3
- data/lib/rubocop/cop/lint/return_in_void_context.rb +24 -13
- data/lib/rubocop/cop/lint/safe_navigation_chain.rb +1 -1
- data/lib/rubocop/cop/lint/script_permission.rb +1 -1
- data/lib/rubocop/cop/lint/shadowed_exception.rb +37 -10
- data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +1 -1
- data/lib/rubocop/cop/lint/string_conversion_in_interpolation.rb +1 -1
- data/lib/rubocop/cop/lint/syntax.rb +8 -2
- data/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb +1 -1
- data/lib/rubocop/cop/lint/unified_integer.rb +2 -2
- data/lib/rubocop/cop/lint/unneeded_disable.rb +11 -4
- data/lib/rubocop/cop/lint/unneeded_require_statement.rb +50 -0
- data/lib/rubocop/cop/lint/unneeded_splat_expansion.rb +2 -2
- data/lib/rubocop/cop/lint/unreachable_code.rb +1 -1
- data/lib/rubocop/cop/lint/unused_method_argument.rb +2 -1
- data/lib/rubocop/cop/lint/uri_escape_unescape.rb +2 -2
- data/lib/rubocop/cop/lint/uri_regexp.rb +3 -3
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +9 -9
- data/lib/rubocop/cop/lint/useless_assignment.rb +1 -1
- data/lib/rubocop/cop/lint/useless_comparison.rb +1 -1
- data/lib/rubocop/cop/lint/useless_setter_call.rb +5 -1
- data/lib/rubocop/cop/lint/void.rb +10 -5
- data/lib/rubocop/cop/metrics/block_nesting.rb +1 -1
- data/lib/rubocop/cop/metrics/line_length.rb +4 -1
- data/lib/rubocop/cop/metrics/parameter_lists.rb +1 -2
- data/lib/rubocop/cop/mixin/array_hash_indentation.rb +3 -2
- data/lib/rubocop/cop/mixin/autocorrect_alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/code_length.rb +1 -1
- data/lib/rubocop/cop/mixin/configurable_formatting.rb +1 -1
- data/lib/rubocop/cop/mixin/def_node.rb +1 -1
- data/lib/rubocop/cop/mixin/empty_lines_around_body.rb +7 -2
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/enforce_superclass.rb +1 -1
- data/lib/rubocop/cop/mixin/heredoc.rb +1 -1
- data/lib/rubocop/cop/mixin/method_complexity.rb +3 -4
- data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +1 -1
- data/lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb +10 -4
- data/lib/rubocop/cop/mixin/ordered_gem_node.rb +63 -0
- data/lib/rubocop/cop/mixin/parser_diagnostic.rb +4 -1
- data/lib/rubocop/cop/mixin/space_after_punctuation.rb +2 -1
- data/lib/rubocop/cop/mixin/space_before_punctuation.rb +2 -1
- data/lib/rubocop/cop/mixin/space_inside.rb +1 -1
- data/lib/rubocop/cop/mixin/string_literals_help.rb +1 -1
- data/lib/rubocop/cop/mixin/trailing_comma.rb +5 -5
- data/lib/rubocop/cop/mixin/unused_argument.rb +43 -2
- data/lib/rubocop/cop/naming/accessor_method_name.rb +8 -7
- data/lib/rubocop/cop/naming/ascii_identifiers.rb +1 -1
- data/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +1 -1
- data/lib/rubocop/cop/naming/class_and_module_camel_case.rb +1 -1
- data/lib/rubocop/cop/naming/constant_name.rb +1 -1
- data/lib/rubocop/cop/naming/file_name.rb +1 -1
- data/lib/rubocop/cop/naming/heredoc_delimiter_case.rb +1 -1
- data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +3 -2
- data/lib/rubocop/cop/naming/predicate_name.rb +36 -5
- data/lib/rubocop/cop/performance/caller.rb +2 -2
- data/lib/rubocop/cop/performance/case_when_splat.rb +1 -1
- data/lib/rubocop/cop/performance/casecmp.rb +1 -1
- data/lib/rubocop/cop/performance/compare_with_block.rb +6 -2
- data/lib/rubocop/cop/performance/count.rb +3 -1
- data/lib/rubocop/cop/performance/detect.rb +4 -4
- data/lib/rubocop/cop/performance/double_start_end_with.rb +6 -9
- data/lib/rubocop/cop/performance/end_with.rb +1 -1
- data/lib/rubocop/cop/performance/flat_map.rb +3 -1
- data/lib/rubocop/cop/performance/hash_each_methods.rb +13 -10
- data/lib/rubocop/cop/performance/lstrip_rstrip.rb +3 -1
- data/lib/rubocop/cop/performance/range_include.rb +1 -1
- data/lib/rubocop/cop/performance/redundant_block_call.rb +1 -1
- data/lib/rubocop/cop/performance/redundant_match.rb +6 -5
- data/lib/rubocop/cop/performance/redundant_merge.rb +1 -1
- data/lib/rubocop/cop/performance/redundant_sort_by.rb +4 -1
- data/lib/rubocop/cop/performance/regexp_match.rb +4 -4
- data/lib/rubocop/cop/performance/reverse_each.rb +1 -1
- data/lib/rubocop/cop/performance/sample.rb +1 -1
- data/lib/rubocop/cop/performance/size.rb +1 -1
- data/lib/rubocop/cop/performance/start_with.rb +1 -1
- data/lib/rubocop/cop/performance/string_replacement.rb +2 -2
- data/lib/rubocop/cop/performance/times_map.rb +3 -3
- data/lib/rubocop/cop/performance/unfreeze_string.rb +2 -2
- data/lib/rubocop/cop/performance/uri_default_parser.rb +2 -2
- data/lib/rubocop/cop/rails/action_filter.rb +1 -1
- data/lib/rubocop/cop/rails/active_support_aliases.rb +1 -2
- data/lib/rubocop/cop/rails/application_job.rb +1 -1
- data/lib/rubocop/cop/rails/application_record.rb +1 -1
- data/lib/rubocop/cop/rails/blank.rb +20 -17
- data/lib/rubocop/cop/rails/date.rb +7 -6
- data/lib/rubocop/cop/rails/delegate.rb +1 -1
- data/lib/rubocop/cop/rails/delegate_allow_blank.rb +1 -1
- data/lib/rubocop/cop/rails/dynamic_find_by.rb +2 -2
- data/lib/rubocop/cop/rails/enum_uniqueness.rb +2 -2
- data/lib/rubocop/cop/rails/exit.rb +1 -1
- data/lib/rubocop/cop/rails/file_path.rb +6 -8
- data/lib/rubocop/cop/rails/find_by.rb +2 -1
- data/lib/rubocop/cop/rails/find_each.rb +1 -1
- data/lib/rubocop/cop/rails/has_and_belongs_to_many.rb +1 -1
- data/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb +35 -11
- data/lib/rubocop/cop/rails/http_positional_arguments.rb +3 -2
- data/lib/rubocop/cop/rails/not_null_column.rb +5 -5
- data/lib/rubocop/cop/rails/output.rb +2 -2
- data/lib/rubocop/cop/rails/output_safety.rb +2 -1
- data/lib/rubocop/cop/rails/present.rb +14 -17
- data/lib/rubocop/cop/rails/read_write_attribute.rb +3 -3
- data/lib/rubocop/cop/rails/relative_date_constant.rb +1 -1
- data/lib/rubocop/cop/rails/request_referer.rb +2 -2
- data/lib/rubocop/cop/rails/reversible_migration.rb +21 -19
- data/lib/rubocop/cop/rails/safe_navigation.rb +2 -2
- data/lib/rubocop/cop/rails/save_bang.rb +12 -12
- data/lib/rubocop/cop/rails/scope_args.rb +1 -1
- data/lib/rubocop/cop/rails/skips_model_validations.rb +2 -2
- data/lib/rubocop/cop/rails/time_zone.rb +3 -2
- data/lib/rubocop/cop/rails/uniq_before_pluck.rb +3 -1
- data/lib/rubocop/cop/rails/unknown_env.rb +63 -0
- data/lib/rubocop/cop/rails/validation.rb +1 -1
- data/lib/rubocop/cop/registry.rb +2 -1
- data/lib/rubocop/cop/security/eval.rb +2 -2
- data/lib/rubocop/cop/security/json_load.rb +2 -2
- data/lib/rubocop/cop/security/marshal_load.rb +3 -3
- data/lib/rubocop/cop/security/yaml_load.rb +2 -2
- data/lib/rubocop/cop/style/alias.rb +3 -3
- data/lib/rubocop/cop/style/and_or.rb +1 -1
- data/lib/rubocop/cop/style/array_join.rb +1 -1
- data/lib/rubocop/cop/style/ascii_comments.rb +1 -1
- data/lib/rubocop/cop/style/attr.rb +1 -1
- data/lib/rubocop/cop/style/auto_resource_cleanup.rb +2 -2
- data/lib/rubocop/cop/style/bare_percent_literals.rb +1 -1
- data/lib/rubocop/cop/style/begin_block.rb +1 -1
- data/lib/rubocop/cop/style/block_delimiters.rb +1 -1
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +22 -19
- data/lib/rubocop/cop/style/case_equality.rb +1 -1
- data/lib/rubocop/cop/style/class_and_module_children.rb +2 -2
- data/lib/rubocop/cop/style/class_check.rb +1 -1
- data/lib/rubocop/cop/style/class_methods.rb +2 -1
- data/lib/rubocop/cop/style/class_vars.rb +1 -1
- data/lib/rubocop/cop/style/collection_methods.rb +1 -1
- data/lib/rubocop/cop/style/colon_method_call.rb +2 -2
- data/lib/rubocop/cop/style/comment_annotation.rb +5 -2
- data/lib/rubocop/cop/style/commented_keyword.rb +81 -0
- data/lib/rubocop/cop/style/conditional_assignment.rb +1 -1
- data/lib/rubocop/cop/style/copyright.rb +1 -1
- data/lib/rubocop/cop/style/date_time.rb +44 -0
- data/lib/rubocop/cop/style/def_with_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/dir.rb +2 -6
- data/lib/rubocop/cop/style/documentation.rb +1 -1
- data/lib/rubocop/cop/style/double_negation.rb +1 -1
- data/lib/rubocop/cop/style/each_for_simple_loop.rb +1 -1
- data/lib/rubocop/cop/style/each_with_object.rb +2 -1
- data/lib/rubocop/cop/style/empty_case_condition.rb +1 -1
- data/lib/rubocop/cop/style/empty_else.rb +2 -2
- data/lib/rubocop/cop/style/empty_literal.rb +9 -9
- data/lib/rubocop/cop/style/encoding.rb +7 -51
- data/lib/rubocop/cop/style/end_block.rb +1 -1
- data/lib/rubocop/cop/style/even_odd.rb +1 -1
- data/lib/rubocop/cop/style/for.rb +6 -2
- data/lib/rubocop/cop/style/format_string.rb +4 -3
- data/lib/rubocop/cop/style/format_string_token.rb +2 -1
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +3 -3
- data/lib/rubocop/cop/style/global_vars.rb +1 -1
- data/lib/rubocop/cop/style/guard_clause.rb +2 -2
- data/lib/rubocop/cop/style/hash_syntax.rb +2 -3
- data/lib/rubocop/cop/style/if_inside_else.rb +1 -1
- data/lib/rubocop/cop/style/if_unless_modifier.rb +2 -1
- data/lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb +2 -1
- data/lib/rubocop/cop/style/implicit_runtime_error.rb +2 -2
- data/lib/rubocop/cop/style/infinite_loop.rb +2 -2
- data/lib/rubocop/cop/style/inverse_methods.rb +4 -6
- data/lib/rubocop/cop/style/lambda.rb +3 -3
- data/lib/rubocop/cop/style/line_end_concatenation.rb +1 -1
- data/lib/rubocop/cop/style/method_call_without_args_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/method_called_on_do_end_block.rb +1 -1
- data/lib/rubocop/cop/style/method_def_parentheses.rb +4 -2
- data/lib/rubocop/cop/style/min_max.rb +2 -1
- data/lib/rubocop/cop/style/mixin_usage.rb +73 -0
- data/lib/rubocop/cop/style/module_function.rb +2 -2
- data/lib/rubocop/cop/style/multiline_block_chain.rb +1 -1
- data/lib/rubocop/cop/style/multiline_if_then.rb +2 -1
- data/lib/rubocop/cop/style/multiline_memoization.rb +1 -1
- data/lib/rubocop/cop/style/nested_modifier.rb +1 -1
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +3 -1
- data/lib/rubocop/cop/style/next.rb +2 -1
- data/lib/rubocop/cop/style/nil_comparison.rb +2 -2
- data/lib/rubocop/cop/style/non_nil_check.rb +2 -2
- data/lib/rubocop/cop/style/not.rb +1 -1
- data/lib/rubocop/cop/style/numeric_predicate.rb +2 -2
- data/lib/rubocop/cop/style/option_hash.rb +0 -11
- data/lib/rubocop/cop/style/or_assignment.rb +1 -1
- data/lib/rubocop/cop/style/parallel_assignment.rb +1 -1
- data/lib/rubocop/cop/style/percent_q_literals.rb +1 -1
- data/lib/rubocop/cop/style/preferred_hash_methods.rb +1 -1
- data/lib/rubocop/cop/style/proc.rb +1 -1
- data/lib/rubocop/cop/style/redundant_begin.rb +1 -1
- data/lib/rubocop/cop/style/redundant_exception.rb +4 -4
- data/lib/rubocop/cop/style/redundant_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/redundant_return.rb +1 -1
- data/lib/rubocop/cop/style/regexp_literal.rb +2 -2
- data/lib/rubocop/cop/style/return_nil.rb +2 -7
- data/lib/rubocop/cop/style/safe_navigation.rb +27 -30
- data/lib/rubocop/cop/style/self_assignment.rb +2 -2
- data/lib/rubocop/cop/style/semicolon.rb +1 -1
- data/lib/rubocop/cop/style/send.rb +1 -1
- data/lib/rubocop/cop/style/signal_exception.rb +4 -3
- data/lib/rubocop/cop/style/stderr_puts.rb +52 -0
- data/lib/rubocop/cop/style/string_literals.rb +4 -3
- data/lib/rubocop/cop/style/string_methods.rb +1 -1
- data/lib/rubocop/cop/style/struct_inheritance.rb +3 -3
- data/lib/rubocop/cop/style/symbol_array.rb +1 -5
- data/lib/rubocop/cop/style/symbol_proc.rb +5 -5
- data/lib/rubocop/cop/style/ternary_parentheses.rb +2 -2
- data/lib/rubocop/cop/style/trailing_underscore_variable.rb +46 -23
- data/lib/rubocop/cop/style/trivial_accessors.rb +3 -1
- data/lib/rubocop/cop/style/variable_interpolation.rb +0 -2
- data/lib/rubocop/cop/style/when_then.rb +1 -1
- data/lib/rubocop/cop/style/while_until_do.rb +2 -1
- data/lib/rubocop/cop/style/while_until_modifier.rb +2 -1
- data/lib/rubocop/cop/style/word_array.rb +2 -2
- data/lib/rubocop/cop/style/zero_length_predicate.rb +4 -4
- data/lib/rubocop/cop/util.rb +1 -12
- data/lib/rubocop/formatter/html_formatter.rb +1 -1
- data/lib/rubocop/formatter/simple_text_formatter.rb +2 -2
- data/lib/rubocop/node_pattern.rb +1 -1
- data/lib/rubocop/options.rb +4 -0
- data/lib/rubocop/processed_source.rb +2 -8
- data/lib/rubocop/rake_task.rb +16 -23
- data/lib/rubocop/remote_config.rb +8 -0
- data/lib/rubocop/rspec/shared_contexts.rb +0 -8
- data/lib/rubocop/rspec/support.rb +5 -5
- data/lib/rubocop/version.rb +1 -1
- metadata +40 -30
- data/lib/rubocop/cop/lint/invalid_character_literal.rb +0 -41
@@ -6,6 +6,8 @@ require 'time'
|
|
6
6
|
module RuboCop
|
7
7
|
# Common methods and behaviors for dealing with remote config files.
|
8
8
|
class RemoteConfig
|
9
|
+
attr_reader :uri
|
10
|
+
|
9
11
|
CACHE_LIFETIME = 24 * 60 * 60
|
10
12
|
|
11
13
|
def initialize(url, base_dir)
|
@@ -27,6 +29,12 @@ module RuboCop
|
|
27
29
|
cache_path
|
28
30
|
end
|
29
31
|
|
32
|
+
def inherit_from_remote(file, path)
|
33
|
+
new_uri = @uri.dup
|
34
|
+
new_uri.path.gsub!(%r{/[^/]*$}, "/#{file}")
|
35
|
+
RemoteConfig.new(new_uri.to_s, File.dirname(path))
|
36
|
+
end
|
37
|
+
|
30
38
|
private
|
31
39
|
|
32
40
|
def request(uri = @uri, limit = 10, &block)
|
@@ -57,14 +57,6 @@ shared_context 'config', :config do
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
shared_context 'ruby 1.9', :ruby19 do
|
61
|
-
let(:ruby_version) { 1.9 }
|
62
|
-
end
|
63
|
-
|
64
|
-
shared_context 'ruby 2.0', :ruby20 do
|
65
|
-
let(:ruby_version) { 2.0 }
|
66
|
-
end
|
67
|
-
|
68
60
|
shared_context 'ruby 2.1', :ruby21 do
|
69
61
|
let(:ruby_version) { 2.1 }
|
70
62
|
end
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
# Require this file to load code that supports testing using RSpec.
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
require_relative 'cop_helper'
|
6
|
+
require_relative 'host_environment_simulation_helper'
|
7
|
+
require_relative 'shared_contexts'
|
8
|
+
require_relative 'shared_examples'
|
9
|
+
require_relative 'expect_offense'
|
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.51.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,28 +10,22 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-10-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: parallel
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- - "
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 2.2.2
|
22
|
-
- - "<"
|
19
|
+
- - "~>"
|
23
20
|
- !ruby/object:Gem::Version
|
24
|
-
version: '
|
21
|
+
version: '1.10'
|
25
22
|
type: :runtime
|
26
23
|
prerelease: false
|
27
24
|
version_requirements: !ruby/object:Gem::Requirement
|
28
25
|
requirements:
|
29
|
-
- - "
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version: 2.2.2
|
32
|
-
- - "<"
|
26
|
+
- - "~>"
|
33
27
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
28
|
+
version: '1.10'
|
35
29
|
- !ruby/object:Gem::Dependency
|
36
30
|
name: parser
|
37
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +60,26 @@ dependencies:
|
|
66
60
|
- - "~>"
|
67
61
|
- !ruby/object:Gem::Version
|
68
62
|
version: '0.1'
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: rainbow
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 2.2.2
|
70
|
+
- - "<"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '3.0'
|
73
|
+
type: :runtime
|
74
|
+
prerelease: false
|
75
|
+
version_requirements: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 2.2.2
|
80
|
+
- - "<"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: ruby-progressbar
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,20 +114,6 @@ dependencies:
|
|
100
114
|
- - ">="
|
101
115
|
- !ruby/object:Gem::Version
|
102
116
|
version: 1.0.1
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: parallel
|
105
|
-
requirement: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '1.10'
|
110
|
-
type: :runtime
|
111
|
-
prerelease: false
|
112
|
-
version_requirements: !ruby/object:Gem::Requirement
|
113
|
-
requirements:
|
114
|
-
- - "~>"
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: '1.10'
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: bundler
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,9 +198,11 @@ files:
|
|
198
198
|
- lib/rubocop/cop/cop.rb
|
199
199
|
- lib/rubocop/cop/corrector.rb
|
200
200
|
- lib/rubocop/cop/force.rb
|
201
|
+
- lib/rubocop/cop/gemspec/ordered_dependencies.rb
|
201
202
|
- lib/rubocop/cop/generator.rb
|
202
203
|
- lib/rubocop/cop/ignored_node.rb
|
203
204
|
- lib/rubocop/cop/internal_affairs.rb
|
205
|
+
- lib/rubocop/cop/internal_affairs/deprecated_positional_arguments.rb
|
204
206
|
- lib/rubocop/cop/internal_affairs/node_type_predicate.rb
|
205
207
|
- lib/rubocop/cop/internal_affairs/offense_location_keyword.rb
|
206
208
|
- lib/rubocop/cop/internal_affairs/redundant_location_argument.rb
|
@@ -306,8 +308,7 @@ files:
|
|
306
308
|
- lib/rubocop/cop/lint/ineffective_access_modifier.rb
|
307
309
|
- lib/rubocop/cop/lint/inherit_exception.rb
|
308
310
|
- lib/rubocop/cop/lint/interpolation_check.rb
|
309
|
-
- lib/rubocop/cop/lint/
|
310
|
-
- lib/rubocop/cop/lint/literal_in_condition.rb
|
311
|
+
- lib/rubocop/cop/lint/literal_as_condition.rb
|
311
312
|
- lib/rubocop/cop/lint/literal_in_interpolation.rb
|
312
313
|
- lib/rubocop/cop/lint/loop.rb
|
313
314
|
- lib/rubocop/cop/lint/multiple_compare.rb
|
@@ -319,6 +320,8 @@ files:
|
|
319
320
|
- lib/rubocop/cop/lint/percent_symbol_array.rb
|
320
321
|
- lib/rubocop/cop/lint/rand_one.rb
|
321
322
|
- lib/rubocop/cop/lint/redundant_with_index.rb
|
323
|
+
- lib/rubocop/cop/lint/redundant_with_object.rb
|
324
|
+
- lib/rubocop/cop/lint/regexp_as_condition.rb
|
322
325
|
- lib/rubocop/cop/lint/require_parentheses.rb
|
323
326
|
- lib/rubocop/cop/lint/rescue_exception.rb
|
324
327
|
- lib/rubocop/cop/lint/rescue_type.rb
|
@@ -333,6 +336,7 @@ files:
|
|
333
336
|
- lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb
|
334
337
|
- lib/rubocop/cop/lint/unified_integer.rb
|
335
338
|
- lib/rubocop/cop/lint/unneeded_disable.rb
|
339
|
+
- lib/rubocop/cop/lint/unneeded_require_statement.rb
|
336
340
|
- lib/rubocop/cop/lint/unneeded_splat_expansion.rb
|
337
341
|
- lib/rubocop/cop/lint/unreachable_code.rb
|
338
342
|
- lib/rubocop/cop/lint/unused_block_argument.rb
|
@@ -389,6 +393,7 @@ files:
|
|
389
393
|
- lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb
|
390
394
|
- lib/rubocop/cop/mixin/negative_conditional.rb
|
391
395
|
- lib/rubocop/cop/mixin/on_normal_if_unless.rb
|
396
|
+
- lib/rubocop/cop/mixin/ordered_gem_node.rb
|
392
397
|
- lib/rubocop/cop/mixin/parentheses.rb
|
393
398
|
- lib/rubocop/cop/mixin/parser_diagnostic.rb
|
394
399
|
- lib/rubocop/cop/mixin/percent_array.rb
|
@@ -480,6 +485,7 @@ files:
|
|
480
485
|
- lib/rubocop/cop/rails/skips_model_validations.rb
|
481
486
|
- lib/rubocop/cop/rails/time_zone.rb
|
482
487
|
- lib/rubocop/cop/rails/uniq_before_pluck.rb
|
488
|
+
- lib/rubocop/cop/rails/unknown_env.rb
|
483
489
|
- lib/rubocop/cop/rails/validation.rb
|
484
490
|
- lib/rubocop/cop/registry.rb
|
485
491
|
- lib/rubocop/cop/security/eval.rb
|
@@ -508,8 +514,10 @@ files:
|
|
508
514
|
- lib/rubocop/cop/style/colon_method_call.rb
|
509
515
|
- lib/rubocop/cop/style/command_literal.rb
|
510
516
|
- lib/rubocop/cop/style/comment_annotation.rb
|
517
|
+
- lib/rubocop/cop/style/commented_keyword.rb
|
511
518
|
- lib/rubocop/cop/style/conditional_assignment.rb
|
512
519
|
- lib/rubocop/cop/style/copyright.rb
|
520
|
+
- lib/rubocop/cop/style/date_time.rb
|
513
521
|
- lib/rubocop/cop/style/def_with_parentheses.rb
|
514
522
|
- lib/rubocop/cop/style/dir.rb
|
515
523
|
- lib/rubocop/cop/style/documentation.rb
|
@@ -552,6 +560,7 @@ files:
|
|
552
560
|
- lib/rubocop/cop/style/min_max.rb
|
553
561
|
- lib/rubocop/cop/style/missing_else.rb
|
554
562
|
- lib/rubocop/cop/style/mixin_grouping.rb
|
563
|
+
- lib/rubocop/cop/style/mixin_usage.rb
|
555
564
|
- lib/rubocop/cop/style/module_function.rb
|
556
565
|
- lib/rubocop/cop/style/multiline_block_chain.rb
|
557
566
|
- lib/rubocop/cop/style/multiline_if_modifier.rb
|
@@ -603,6 +612,7 @@ files:
|
|
603
612
|
- lib/rubocop/cop/style/single_line_methods.rb
|
604
613
|
- lib/rubocop/cop/style/special_global_vars.rb
|
605
614
|
- lib/rubocop/cop/style/stabby_lambda_parentheses.rb
|
615
|
+
- lib/rubocop/cop/style/stderr_puts.rb
|
606
616
|
- lib/rubocop/cop/style/string_literals.rb
|
607
617
|
- lib/rubocop/cop/style/string_literals_in_interpolation.rb
|
608
618
|
- lib/rubocop/cop/style/string_methods.rb
|
@@ -694,7 +704,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
694
704
|
requirements:
|
695
705
|
- - ">="
|
696
706
|
- !ruby/object:Gem::Version
|
697
|
-
version: 2.
|
707
|
+
version: 2.1.0
|
698
708
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
699
709
|
requirements:
|
700
710
|
- - ">="
|
@@ -1,41 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RuboCop
|
4
|
-
module Cop
|
5
|
-
module Lint
|
6
|
-
# This cop checks for invalid character literals with a non-escaped
|
7
|
-
# whitespace character (e.g. `? `).
|
8
|
-
# However, currently it's unclear whether there's a way to emit this
|
9
|
-
# warning without syntax errors.
|
10
|
-
#
|
11
|
-
# $ ruby -w
|
12
|
-
# p(? )
|
13
|
-
# -:1: warning: invalid character syntax; use ?\s
|
14
|
-
# -:1: syntax error, unexpected '?', expecting ')'
|
15
|
-
# p(? )
|
16
|
-
# ^
|
17
|
-
#
|
18
|
-
# @example
|
19
|
-
#
|
20
|
-
# # bad
|
21
|
-
#
|
22
|
-
# p(? )
|
23
|
-
class InvalidCharacterLiteral < Cop
|
24
|
-
include ParserDiagnostic
|
25
|
-
|
26
|
-
private
|
27
|
-
|
28
|
-
def relevant_diagnostic?(diagnostic)
|
29
|
-
diagnostic.reason == :invalid_escape_use
|
30
|
-
end
|
31
|
-
|
32
|
-
def alternative_message(diagnostic)
|
33
|
-
diagnostic
|
34
|
-
.message
|
35
|
-
.capitalize
|
36
|
-
.gsub('character syntax', 'character literal')
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|