rubocop 0.22.0 → 0.23.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubocop might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.rubocop_todo.yml +7 -7
- data/CHANGELOG.md +34 -1
- data/Gemfile +1 -1
- data/README.md +86 -47
- data/Rakefile +2 -2
- data/bin/rubocop +1 -1
- data/config/default.yml +76 -74
- data/config/disabled.yml +6 -2
- data/config/enabled.yml +180 -180
- data/lib/rubocop.rb +1 -0
- data/lib/rubocop/cli.rb +7 -3
- data/lib/rubocop/comment_config.rb +4 -2
- data/lib/rubocop/config.rb +15 -3
- data/lib/rubocop/config_loader.rb +8 -3
- data/lib/rubocop/config_store.rb +1 -1
- data/lib/rubocop/cop/commissioner.rb +1 -1
- data/lib/rubocop/cop/cop.rb +16 -2
- data/lib/rubocop/cop/corrector.rb +1 -1
- data/lib/rubocop/cop/force.rb +1 -1
- data/lib/rubocop/cop/ignored_node.rb +1 -1
- data/lib/rubocop/cop/lint/ambiguous_operator.rb +1 -1
- data/lib/rubocop/cop/lint/ambiguous_regexp_literal.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/condition_position.rb +1 -1
- data/lib/rubocop/cop/lint/debugger.rb +1 -1
- data/lib/rubocop/cop/lint/deprecated_class_methods.rb +1 -1
- data/lib/rubocop/cop/lint/else_layout.rb +1 -1
- data/lib/rubocop/cop/lint/empty_ensure.rb +1 -1
- data/lib/rubocop/cop/lint/empty_interpolation.rb +1 -1
- data/lib/rubocop/cop/lint/end_alignment.rb +1 -1
- data/lib/rubocop/cop/lint/end_in_method.rb +1 -1
- data/lib/rubocop/cop/lint/ensure_return.rb +1 -1
- data/lib/rubocop/cop/lint/eval.rb +1 -1
- data/lib/rubocop/cop/lint/handle_exceptions.rb +1 -1
- data/lib/rubocop/cop/lint/invalid_character_literal.rb +1 -1
- data/lib/rubocop/cop/lint/literal_in_condition.rb +1 -1
- data/lib/rubocop/cop/lint/literal_in_interpolation.rb +1 -1
- data/lib/rubocop/cop/lint/loop.rb +1 -1
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +1 -1
- data/lib/rubocop/cop/lint/require_parentheses.rb +1 -1
- data/lib/rubocop/cop/lint/rescue_exception.rb +1 -1
- data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +1 -1
- data/lib/rubocop/cop/lint/space_before_first_arg.rb +1 -1
- data/lib/rubocop/cop/lint/string_conversion_in_interpolation.rb +1 -1
- data/lib/rubocop/cop/lint/syntax.rb +1 -1
- data/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb +1 -1
- data/lib/rubocop/cop/lint/unreachable_code.rb +1 -1
- data/lib/rubocop/cop/lint/unused_block_argument.rb +1 -1
- data/lib/rubocop/cop/lint/unused_method_argument.rb +1 -1
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +1 -1
- 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_else_without_rescue.rb +1 -1
- data/lib/rubocop/cop/lint/useless_setter_call.rb +1 -1
- data/lib/rubocop/cop/lint/void.rb +1 -1
- data/lib/rubocop/cop/mixin/annotation_comment.rb +2 -2
- data/lib/rubocop/cop/mixin/array_syntax.rb +1 -1
- data/lib/rubocop/cop/mixin/autocorrect_alignment.rb +32 -3
- data/lib/rubocop/cop/mixin/autocorrect_unless_changing_ast.rb +1 -1
- data/lib/rubocop/cop/mixin/check_assignment.rb +1 -1
- data/lib/rubocop/cop/mixin/check_methods.rb +1 -1
- data/lib/rubocop/cop/mixin/code_length.rb +1 -1
- data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +1 -1
- data/lib/rubocop/cop/mixin/configurable_max.rb +1 -1
- data/lib/rubocop/cop/mixin/configurable_naming.rb +1 -1
- data/lib/rubocop/cop/mixin/if_node.rb +1 -1
- data/lib/rubocop/cop/mixin/if_then_else.rb +1 -1
- data/lib/rubocop/cop/mixin/negative_conditional.rb +1 -1
- data/lib/rubocop/cop/mixin/parser_diagnostic.rb +1 -1
- data/lib/rubocop/cop/mixin/percent_literal.rb +1 -1
- data/lib/rubocop/cop/mixin/safe_assignment.rb +14 -3
- data/lib/rubocop/cop/mixin/space_after_punctuation.rb +1 -1
- data/lib/rubocop/cop/mixin/space_inside.rb +1 -1
- data/lib/rubocop/cop/mixin/statement_modifier.rb +2 -2
- data/lib/rubocop/cop/mixin/string_help.rb +1 -1
- data/lib/rubocop/cop/mixin/surrounding_space.rb +1 -1
- data/lib/rubocop/cop/mixin/unused_argument.rb +1 -1
- data/lib/rubocop/cop/offense.rb +3 -3
- data/lib/rubocop/cop/rails/action_filter.rb +1 -1
- data/lib/rubocop/cop/rails/default_scope.rb +1 -1
- data/lib/rubocop/cop/rails/delegate.rb +1 -1
- data/lib/rubocop/cop/rails/has_and_belongs_to_many.rb +1 -1
- data/lib/rubocop/cop/rails/output.rb +1 -1
- data/lib/rubocop/cop/rails/read_write_attribute.rb +1 -1
- data/lib/rubocop/cop/rails/scope_args.rb +1 -1
- data/lib/rubocop/cop/rails/validation.rb +1 -1
- data/lib/rubocop/cop/severity.rb +1 -1
- data/lib/rubocop/cop/style/access_modifier_indentation.rb +1 -1
- data/lib/rubocop/cop/style/accessor_method_name.rb +1 -1
- data/lib/rubocop/cop/style/alias.rb +1 -1
- data/lib/rubocop/cop/style/align_array.rb +1 -1
- data/lib/rubocop/cop/style/align_hash.rb +1 -1
- data/lib/rubocop/cop/style/align_parameters.rb +1 -1
- 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/ascii_identifiers.rb +1 -1
- data/lib/rubocop/cop/style/attr.rb +1 -1
- data/lib/rubocop/cop/style/begin_block.rb +1 -1
- data/lib/rubocop/cop/style/block_comments.rb +24 -3
- data/lib/rubocop/cop/style/block_nesting.rb +1 -1
- data/lib/rubocop/cop/style/blocks.rb +1 -1
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +1 -1
- data/lib/rubocop/cop/style/case_equality.rb +1 -1
- data/lib/rubocop/cop/style/case_indentation.rb +1 -1
- data/lib/rubocop/cop/style/character_literal.rb +1 -1
- data/lib/rubocop/cop/style/class_and_module_camel_case.rb +1 -1
- data/lib/rubocop/cop/style/class_and_module_children.rb +1 -1
- data/lib/rubocop/cop/style/class_length.rb +1 -1
- data/lib/rubocop/cop/style/class_methods.rb +1 -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 +1 -1
- data/lib/rubocop/cop/style/comment_annotation.rb +1 -1
- data/lib/rubocop/cop/style/comment_indentation.rb +1 -1
- data/lib/rubocop/cop/style/constant_name.rb +1 -1
- data/lib/rubocop/cop/style/cyclomatic_complexity.rb +1 -1
- data/lib/rubocop/cop/style/def_with_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/deprecated_hash_methods.rb +1 -1
- data/lib/rubocop/cop/style/documentation.rb +4 -2
- data/lib/rubocop/cop/style/dot_position.rb +1 -1
- data/lib/rubocop/cop/style/double_negation.rb +1 -1
- data/lib/rubocop/cop/style/each_with_object.rb +21 -5
- data/lib/rubocop/cop/style/empty_line_between_defs.rb +1 -1
- data/lib/rubocop/cop/style/empty_lines.rb +1 -1
- data/lib/rubocop/cop/style/empty_lines_around_access_modifier.rb +1 -1
- data/lib/rubocop/cop/style/empty_lines_around_body.rb +1 -1
- data/lib/rubocop/cop/style/empty_literal.rb +1 -1
- data/lib/rubocop/cop/style/encoding.rb +1 -1
- data/lib/rubocop/cop/style/end_block.rb +1 -1
- data/lib/rubocop/cop/style/end_of_line.rb +12 -3
- data/lib/rubocop/cop/style/even_odd.rb +1 -1
- data/lib/rubocop/cop/style/file_name.rb +1 -1
- data/lib/rubocop/cop/style/flip_flop.rb +1 -1
- data/lib/rubocop/cop/style/for.rb +1 -1
- data/lib/rubocop/cop/style/format_string.rb +1 -1
- data/lib/rubocop/cop/style/global_vars.rb +1 -1
- data/lib/rubocop/cop/style/guard_clause.rb +1 -1
- data/lib/rubocop/cop/style/hash_syntax.rb +1 -1
- data/lib/rubocop/cop/style/if_unless_modifier.rb +1 -1
- data/lib/rubocop/cop/style/if_with_semicolon.rb +1 -1
- data/lib/rubocop/cop/style/indent_array.rb +35 -12
- data/lib/rubocop/cop/style/indent_hash.rb +39 -23
- data/lib/rubocop/cop/style/indentation_consistency.rb +1 -1
- data/lib/rubocop/cop/style/indentation_width.rb +2 -2
- data/lib/rubocop/cop/style/inline_comment.rb +19 -0
- data/lib/rubocop/cop/style/lambda.rb +1 -1
- data/lib/rubocop/cop/style/lambda_call.rb +1 -1
- data/lib/rubocop/cop/style/leading_comment_space.rb +1 -1
- data/lib/rubocop/cop/style/line_end_concatenation.rb +1 -1
- data/lib/rubocop/cop/style/line_length.rb +1 -1
- data/lib/rubocop/cop/style/method_call_parentheses.rb +2 -2
- data/lib/rubocop/cop/style/method_called_on_do_end_block.rb +1 -1
- data/lib/rubocop/cop/style/method_def_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/method_length.rb +1 -1
- data/lib/rubocop/cop/style/method_name.rb +1 -1
- data/lib/rubocop/cop/style/module_function.rb +1 -1
- data/lib/rubocop/cop/style/multiline_block_chain.rb +1 -1
- data/lib/rubocop/cop/style/multiline_if_then.rb +1 -1
- data/lib/rubocop/cop/style/multiline_ternary_operator.rb +1 -1
- data/lib/rubocop/cop/style/negated_if.rb +1 -1
- data/lib/rubocop/cop/style/negated_while.rb +1 -1
- data/lib/rubocop/cop/style/nested_ternary_operator.rb +1 -1
- data/lib/rubocop/cop/style/next.rb +2 -1
- data/lib/rubocop/cop/style/nil_comparison.rb +1 -1
- data/lib/rubocop/cop/style/non_nil_check.rb +1 -1
- data/lib/rubocop/cop/style/not.rb +1 -1
- data/lib/rubocop/cop/style/numeric_literals.rb +1 -1
- data/lib/rubocop/cop/style/one_line_conditional.rb +1 -1
- data/lib/rubocop/cop/style/op_method.rb +1 -1
- data/lib/rubocop/cop/style/parameter_lists.rb +1 -1
- data/lib/rubocop/cop/style/parentheses_around_condition.rb +11 -1
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +1 -1
- data/lib/rubocop/cop/style/perl_backrefs.rb +1 -1
- data/lib/rubocop/cop/style/predicate_name.rb +1 -1
- data/lib/rubocop/cop/style/proc.rb +1 -1
- data/lib/rubocop/cop/style/raise_args.rb +1 -1
- data/lib/rubocop/cop/style/redundant_begin.rb +1 -1
- data/lib/rubocop/cop/style/redundant_exception.rb +1 -1
- data/lib/rubocop/cop/style/redundant_return.rb +1 -1
- data/lib/rubocop/cop/style/redundant_self.rb +1 -1
- data/lib/rubocop/cop/style/regexp_literal.rb +13 -5
- data/lib/rubocop/cop/style/rescue_modifier.rb +1 -1
- data/lib/rubocop/cop/style/self_assignment.rb +1 -1
- data/lib/rubocop/cop/style/semicolon.rb +1 -1
- data/lib/rubocop/cop/style/signal_exception.rb +1 -1
- data/lib/rubocop/cop/style/single_line_block_params.rb +1 -1
- data/lib/rubocop/cop/style/single_line_methods.rb +1 -1
- data/lib/rubocop/cop/style/single_space_before_first_arg.rb +1 -1
- data/lib/rubocop/cop/style/space_after_colon.rb +1 -1
- data/lib/rubocop/cop/style/space_after_comma.rb +1 -1
- data/lib/rubocop/cop/style/space_after_control_keyword.rb +1 -1
- data/lib/rubocop/cop/style/space_after_method_name.rb +1 -1
- data/lib/rubocop/cop/style/space_after_not.rb +1 -1
- data/lib/rubocop/cop/style/space_after_semicolon.rb +1 -1
- data/lib/rubocop/cop/style/space_around_equals_in_parameter_default.rb +1 -1
- data/lib/rubocop/cop/style/space_around_operators.rb +1 -1
- data/lib/rubocop/cop/style/space_before_block_braces.rb +3 -2
- data/lib/rubocop/cop/style/space_before_comment.rb +1 -1
- data/lib/rubocop/cop/style/space_before_modifier_keyword.rb +1 -1
- data/lib/rubocop/cop/style/space_inside_block_braces.rb +3 -2
- data/lib/rubocop/cop/style/space_inside_brackets.rb +1 -1
- data/lib/rubocop/cop/style/space_inside_hash_literal_braces.rb +1 -1
- data/lib/rubocop/cop/style/space_inside_parens.rb +1 -1
- data/lib/rubocop/cop/style/special_global_vars.rb +1 -1
- data/lib/rubocop/cop/style/string_literals.rb +1 -1
- data/lib/rubocop/cop/style/symbol_array.rb +1 -1
- data/lib/rubocop/cop/style/tab.rb +1 -1
- data/lib/rubocop/cop/style/trailing_blank_lines.rb +1 -1
- data/lib/rubocop/cop/style/trailing_comma.rb +16 -3
- data/lib/rubocop/cop/style/trailing_whitespace.rb +1 -1
- data/lib/rubocop/cop/style/trivial_accessors.rb +40 -9
- data/lib/rubocop/cop/style/unless_else.rb +1 -1
- data/lib/rubocop/cop/style/unneeded_capital_w.rb +1 -1
- data/lib/rubocop/cop/style/unneeded_percent_x.rb +1 -1
- data/lib/rubocop/cop/style/variable_interpolation.rb +1 -1
- data/lib/rubocop/cop/style/variable_name.rb +1 -1
- data/lib/rubocop/cop/style/when_then.rb +1 -1
- data/lib/rubocop/cop/style/while_until_do.rb +1 -1
- data/lib/rubocop/cop/style/while_until_modifier.rb +1 -1
- data/lib/rubocop/cop/style/word_array.rb +1 -1
- data/lib/rubocop/cop/team.rb +12 -2
- data/lib/rubocop/cop/util.rb +1 -1
- data/lib/rubocop/cop/variable_force.rb +4 -4
- data/lib/rubocop/cop/variable_force/assignment.rb +1 -1
- data/lib/rubocop/cop/variable_force/locatable.rb +1 -1
- data/lib/rubocop/cop/variable_force/reference.rb +1 -1
- data/lib/rubocop/cop/variable_force/scope.rb +1 -1
- data/lib/rubocop/cop/variable_force/variable.rb +1 -1
- data/lib/rubocop/cop/variable_force/variable_table.rb +1 -1
- data/lib/rubocop/file_inspector.rb +3 -3
- data/lib/rubocop/formatter/base_formatter.rb +6 -6
- data/lib/rubocop/formatter/clang_style_formatter.rb +1 -1
- data/lib/rubocop/formatter/colorizable.rb +1 -1
- data/lib/rubocop/formatter/disabled_config_formatter.rb +2 -2
- data/lib/rubocop/formatter/disabled_lines_formatter.rb +1 -1
- data/lib/rubocop/formatter/emacs_style_formatter.rb +1 -1
- data/lib/rubocop/formatter/file_list_formatter.rb +1 -1
- data/lib/rubocop/formatter/formatter_set.rb +1 -1
- data/lib/rubocop/formatter/fuubar_style_formatter.rb +1 -1
- data/lib/rubocop/formatter/json_formatter.rb +2 -2
- data/lib/rubocop/formatter/offense_count_formatter.rb +1 -1
- data/lib/rubocop/formatter/progress_formatter.rb +1 -1
- data/lib/rubocop/formatter/simple_text_formatter.rb +1 -1
- data/lib/rubocop/options.rb +6 -4
- data/lib/rubocop/path_util.rb +1 -1
- data/lib/rubocop/processed_source.rb +1 -1
- data/lib/rubocop/rake_task.rb +3 -3
- data/lib/rubocop/source_parser.rb +2 -2
- data/lib/rubocop/target_finder.rb +2 -6
- data/lib/rubocop/token.rb +1 -1
- data/lib/rubocop/version.rb +2 -2
- data/relnotes/v0.21.0.md +1 -1
- data/relnotes/v0.23.0.md +79 -0
- data/rubocop.gemspec +1 -1
- data/spec/.rubocop.yml +1 -1
- data/spec/isolated_environment_spec.rb +1 -1
- data/spec/project_spec.rb +3 -3
- data/spec/rubocop/cli_spec.rb +242 -94
- data/spec/rubocop/comment_config_spec.rb +17 -15
- data/spec/rubocop/config_loader_spec.rb +51 -34
- data/spec/rubocop/config_spec.rb +5 -5
- data/spec/rubocop/config_store_spec.rb +11 -11
- data/spec/rubocop/cop/commissioner_spec.rb +4 -4
- data/spec/rubocop/cop/cop_spec.rb +33 -10
- data/spec/rubocop/cop/corrector_spec.rb +1 -1
- data/spec/rubocop/cop/force_spec.rb +2 -2
- data/spec/rubocop/cop/lint/ambiguous_operator_spec.rb +1 -1
- data/spec/rubocop/cop/lint/ambiguous_regexp_literal_spec.rb +1 -1
- data/spec/rubocop/cop/lint/assignment_in_condition_spec.rb +1 -1
- data/spec/rubocop/cop/lint/block_alignment_spec.rb +2 -2
- data/spec/rubocop/cop/lint/condition_position_spec.rb +4 -4
- data/spec/rubocop/cop/lint/debugger_spec.rb +1 -1
- data/spec/rubocop/cop/lint/deprecated_class_methods_spec.rb +1 -1
- data/spec/rubocop/cop/lint/else_layout_spec.rb +5 -5
- data/spec/rubocop/cop/lint/empty_ensure_spec.rb +1 -1
- data/spec/rubocop/cop/lint/empty_interpolation_spec.rb +1 -1
- data/spec/rubocop/cop/lint/end_alignment_spec.rb +1 -1
- data/spec/rubocop/cop/lint/end_in_method_spec.rb +1 -1
- data/spec/rubocop/cop/lint/ensure_return_spec.rb +1 -1
- data/spec/rubocop/cop/lint/eval_spec.rb +1 -1
- data/spec/rubocop/cop/lint/handle_exceptions_spec.rb +1 -1
- data/spec/rubocop/cop/lint/invalid_character_literal_spec.rb +1 -1
- data/spec/rubocop/cop/lint/literal_in_condition_spec.rb +1 -1
- data/spec/rubocop/cop/lint/literal_in_interpolation_spec.rb +1 -1
- data/spec/rubocop/cop/lint/loop_spec.rb +1 -1
- data/spec/rubocop/cop/lint/parentheses_as_grouped_expression_spec.rb +1 -1
- data/spec/rubocop/cop/lint/require_parentheses_spec.rb +1 -1
- data/spec/rubocop/cop/lint/rescue_exception_spec.rb +2 -2
- data/spec/rubocop/cop/lint/shadowing_outer_local_variable_spec.rb +1 -1
- data/spec/rubocop/cop/lint/space_before_first_arg_spec.rb +1 -1
- data/spec/rubocop/cop/lint/string_conversion_in_interpolation_spec.rb +1 -1
- data/spec/rubocop/cop/lint/syntax_spec.rb +2 -2
- data/spec/rubocop/cop/lint/underscore_prefixed_variable_name_spec.rb +1 -1
- data/spec/rubocop/cop/lint/unreachable_code_spec.rb +1 -1
- data/spec/rubocop/cop/lint/unused_block_argument_spec.rb +1 -1
- data/spec/rubocop/cop/lint/unused_method_argument_spec.rb +1 -1
- data/spec/rubocop/cop/lint/useless_access_modifier_spec.rb +1 -1
- data/spec/rubocop/cop/lint/useless_assignment_spec.rb +1 -1
- data/spec/rubocop/cop/lint/useless_comparison_spec.rb +1 -1
- data/spec/rubocop/cop/lint/useless_else_without_rescue_spec.rb +1 -1
- data/spec/rubocop/cop/lint/useless_setter_call_spec.rb +1 -1
- data/spec/rubocop/cop/lint/void_spec.rb +1 -1
- data/spec/rubocop/cop/offense_spec.rb +2 -2
- data/spec/rubocop/cop/rails/action_filter_spec.rb +1 -1
- data/spec/rubocop/cop/rails/default_scope_spec.rb +1 -1
- data/spec/rubocop/cop/rails/delegate_spec.rb +1 -1
- data/spec/rubocop/cop/rails/has_and_belongs_to_many_spec.rb +1 -1
- data/spec/rubocop/cop/rails/output_spec.rb +1 -1
- data/spec/rubocop/cop/rails/read_write_attribute_spec.rb +1 -1
- data/spec/rubocop/cop/rails/scope_args_spec.rb +1 -1
- data/spec/rubocop/cop/rails/validation_spec.rb +1 -1
- data/spec/rubocop/cop/severity_spec.rb +1 -1
- data/spec/rubocop/cop/style/access_modifier_indentation_spec.rb +1 -1
- data/spec/rubocop/cop/style/accessor_method_name_spec.rb +1 -1
- data/spec/rubocop/cop/style/alias_spec.rb +1 -1
- data/spec/rubocop/cop/style/align_array_spec.rb +33 -1
- data/spec/rubocop/cop/style/align_hash_spec.rb +1 -1
- data/spec/rubocop/cop/style/align_parameters_spec.rb +1 -1
- data/spec/rubocop/cop/style/and_or_spec.rb +1 -1
- data/spec/rubocop/cop/style/array_join_spec.rb +1 -1
- data/spec/rubocop/cop/style/ascii_comments_spec.rb +1 -1
- data/spec/rubocop/cop/style/ascii_identifiers_spec.rb +1 -1
- data/spec/rubocop/cop/style/attr_spec.rb +1 -1
- data/spec/rubocop/cop/style/begin_block_spec.rb +1 -1
- data/spec/rubocop/cop/style/block_comments_spec.rb +25 -1
- data/spec/rubocop/cop/style/block_nesting_spec.rb +1 -1
- data/spec/rubocop/cop/style/blocks_spec.rb +1 -1
- data/spec/rubocop/cop/style/braces_around_hash_parameters_spec.rb +1 -1
- data/spec/rubocop/cop/style/case_equality_spec.rb +1 -1
- data/spec/rubocop/cop/style/case_indentation_spec.rb +4 -4
- data/spec/rubocop/cop/style/character_literal_spec.rb +1 -1
- data/spec/rubocop/cop/style/class_and_module_camel_case_spec.rb +1 -1
- data/spec/rubocop/cop/style/class_and_module_children_spec.rb +1 -1
- data/spec/rubocop/cop/style/class_length_spec.rb +1 -1
- data/spec/rubocop/cop/style/class_methods_spec.rb +1 -1
- data/spec/rubocop/cop/style/class_vars_spec.rb +1 -1
- data/spec/rubocop/cop/style/collection_methods_spec.rb +1 -1
- data/spec/rubocop/cop/style/colon_method_call_spec.rb +1 -1
- data/spec/rubocop/cop/style/comment_annotation_spec.rb +2 -2
- data/spec/rubocop/cop/style/comment_indentation_spec.rb +1 -1
- data/spec/rubocop/cop/style/constant_name_spec.rb +2 -2
- data/spec/rubocop/cop/style/cyclomatic_complexity_spec.rb +1 -1
- data/spec/rubocop/cop/style/def_with_parentheses_spec.rb +1 -1
- data/spec/rubocop/cop/style/deprecated_hash_methods_spec.rb +1 -1
- data/spec/rubocop/cop/style/documentation_spec.rb +26 -2
- data/spec/rubocop/cop/style/dot_position_spec.rb +1 -1
- data/spec/rubocop/cop/style/double_negation_spec.rb +1 -1
- data/spec/rubocop/cop/style/each_with_object_spec.rb +31 -7
- data/spec/rubocop/cop/style/empty_line_between_defs_spec.rb +1 -1
- data/spec/rubocop/cop/style/empty_lines_around_access_modifier_spec.rb +1 -1
- data/spec/rubocop/cop/style/empty_lines_around_body_spec.rb +1 -1
- data/spec/rubocop/cop/style/empty_lines_spec.rb +1 -1
- data/spec/rubocop/cop/style/empty_literal_spec.rb +1 -1
- data/spec/rubocop/cop/style/encoding_spec.rb +1 -1
- data/spec/rubocop/cop/style/end_block_spec.rb +1 -1
- data/spec/rubocop/cop/style/end_of_line_spec.rb +13 -1
- data/spec/rubocop/cop/style/even_odd_spec.rb +1 -1
- data/spec/rubocop/cop/style/file_name_spec.rb +2 -2
- data/spec/rubocop/cop/style/flip_flop_spec.rb +1 -1
- data/spec/rubocop/cop/style/for_spec.rb +1 -1
- data/spec/rubocop/cop/style/format_string_spec.rb +1 -1
- data/spec/rubocop/cop/style/global_vars_spec.rb +1 -1
- data/spec/rubocop/cop/style/guard_clause_spec.rb +1 -1
- data/spec/rubocop/cop/style/hash_syntax_spec.rb +9 -5
- data/spec/rubocop/cop/style/if_unless_modifier_spec.rb +6 -6
- data/spec/rubocop/cop/style/if_with_semicolon_spec.rb +1 -1
- data/spec/rubocop/cop/style/indent_array_spec.rb +37 -2
- data/spec/rubocop/cop/style/indent_hash_spec.rb +64 -8
- data/spec/rubocop/cop/style/indentation_consistency_spec.rb +1 -1
- data/spec/rubocop/cop/style/indentation_width_spec.rb +84 -21
- data/spec/rubocop/cop/style/inline_comment_spec.rb +13 -0
- data/spec/rubocop/cop/style/lambda_call_spec.rb +1 -1
- data/spec/rubocop/cop/style/lambda_spec.rb +1 -1
- data/spec/rubocop/cop/style/leading_comment_space_spec.rb +1 -1
- data/spec/rubocop/cop/style/line_end_concatenation_spec.rb +1 -1
- data/spec/rubocop/cop/style/line_length_spec.rb +1 -1
- data/spec/rubocop/cop/style/method_call_parentheses_spec.rb +3 -3
- data/spec/rubocop/cop/style/method_called_on_do_end_block_spec.rb +1 -1
- data/spec/rubocop/cop/style/method_def_parentheses_spec.rb +1 -1
- data/spec/rubocop/cop/style/method_length_spec.rb +1 -1
- data/spec/rubocop/cop/style/method_name_spec.rb +1 -1
- data/spec/rubocop/cop/style/module_function_spec.rb +1 -1
- data/spec/rubocop/cop/style/multiline_block_chain_spec.rb +1 -1
- data/spec/rubocop/cop/style/multiline_if_then_spec.rb +1 -1
- data/spec/rubocop/cop/style/multiline_ternary_operator_spec.rb +1 -1
- data/spec/rubocop/cop/style/negated_if_spec.rb +1 -1
- data/spec/rubocop/cop/style/negated_while_spec.rb +1 -1
- data/spec/rubocop/cop/style/nested_ternary_operator_spec.rb +1 -1
- data/spec/rubocop/cop/style/next_spec.rb +10 -1
- data/spec/rubocop/cop/style/nil_comparison_spec.rb +1 -1
- data/spec/rubocop/cop/style/non_nil_check_spec.rb +1 -1
- data/spec/rubocop/cop/style/not_spec.rb +1 -1
- data/spec/rubocop/cop/style/numeric_literals_spec.rb +1 -1
- data/spec/rubocop/cop/style/one_line_conditional_spec.rb +1 -1
- data/spec/rubocop/cop/style/op_method_spec.rb +1 -1
- data/spec/rubocop/cop/style/parameter_lists_spec.rb +1 -1
- data/spec/rubocop/cop/style/parentheses_around_condition_spec.rb +16 -1
- data/spec/rubocop/cop/style/percent_literal_delimiters_spec.rb +1 -1
- data/spec/rubocop/cop/style/perl_backrefs_spec.rb +1 -1
- data/spec/rubocop/cop/style/predicate_name_spec.rb +1 -1
- data/spec/rubocop/cop/style/proc_spec.rb +1 -1
- data/spec/rubocop/cop/style/raise_args_spec.rb +1 -1
- data/spec/rubocop/cop/style/redundant_begin_spec.rb +1 -1
- data/spec/rubocop/cop/style/redundant_exception_spec.rb +1 -1
- data/spec/rubocop/cop/style/redundant_return_spec.rb +1 -1
- data/spec/rubocop/cop/style/redundant_self_spec.rb +1 -1
- data/spec/rubocop/cop/style/regexp_literal_spec.rb +15 -1
- data/spec/rubocop/cop/style/rescue_modifier_spec.rb +1 -1
- data/spec/rubocop/cop/style/self_assignment_spec.rb +1 -1
- data/spec/rubocop/cop/style/semicolon_spec.rb +1 -1
- data/spec/rubocop/cop/style/signal_exception_spec.rb +1 -1
- data/spec/rubocop/cop/style/single_line_block_params_spec.rb +1 -1
- data/spec/rubocop/cop/style/single_line_methods_spec.rb +1 -1
- data/spec/rubocop/cop/style/single_space_before_first_arg_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_after_colon_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_after_comma_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_after_control_keyword_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_after_method_name_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_after_not_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_after_semicolon_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_around_equals_in_parameter_default_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_around_operators_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_before_block_braces_spec.rb +5 -5
- data/spec/rubocop/cop/style/space_before_comment_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_before_modifier_keyword_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_inside_block_braces_spec.rb +7 -7
- data/spec/rubocop/cop/style/space_inside_brackets_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_inside_hash_literal_braces_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_inside_parens_spec.rb +1 -1
- data/spec/rubocop/cop/style/special_global_vars_spec.rb +1 -1
- data/spec/rubocop/cop/style/string_literals_spec.rb +1 -1
- data/spec/rubocop/cop/style/symbol_array_spec.rb +1 -1
- data/spec/rubocop/cop/style/tab_spec.rb +1 -1
- data/spec/rubocop/cop/style/trailing_blank_lines_spec.rb +1 -1
- data/spec/rubocop/cop/style/trailing_comma_spec.rb +36 -10
- data/spec/rubocop/cop/style/trailing_whitespace_spec.rb +1 -1
- data/spec/rubocop/cop/style/trivial_accessors_spec.rb +51 -3
- data/spec/rubocop/cop/style/unless_else_spec.rb +1 -1
- data/spec/rubocop/cop/style/unneeded_capital_w_spec.rb +1 -1
- data/spec/rubocop/cop/style/unneeded_percent_x_spec.rb +1 -1
- data/spec/rubocop/cop/style/variable_interpolation_spec.rb +1 -1
- data/spec/rubocop/cop/style/variable_name_spec.rb +1 -1
- data/spec/rubocop/cop/style/when_then_spec.rb +1 -1
- data/spec/rubocop/cop/style/while_until_do_spec.rb +1 -1
- data/spec/rubocop/cop/style/while_until_modifier_spec.rb +6 -6
- data/spec/rubocop/cop/style/word_array_spec.rb +1 -1
- data/spec/rubocop/cop/team_spec.rb +23 -23
- data/spec/rubocop/cop/util_spec.rb +1 -1
- data/spec/rubocop/cop/variable_force/assignment_spec.rb +4 -4
- data/spec/rubocop/cop/variable_force/locatable_spec.rb +4 -4
- data/spec/rubocop/cop/variable_force/scope_spec.rb +3 -3
- data/spec/rubocop/cop/variable_force/variable_spec.rb +2 -2
- data/spec/rubocop/cop/variable_force/variable_table_spec.rb +1 -1
- data/spec/rubocop/cop/variable_force_spec.rb +1 -1
- data/spec/rubocop/file_inspector_spec.rb +3 -3
- data/spec/rubocop/formatter/base_formatter_spec.rb +2 -2
- data/spec/rubocop/formatter/clang_style_formatter_spec.rb +1 -1
- data/spec/rubocop/formatter/colorizable_spec.rb +1 -1
- data/spec/rubocop/formatter/disabled_config_formatter_spec.rb +3 -3
- data/spec/rubocop/formatter/disabled_lines_formatter_spec.rb +1 -1
- data/spec/rubocop/formatter/emacs_style_formatter_spec.rb +1 -1
- data/spec/rubocop/formatter/file_list_formatter_spec.rb +1 -1
- data/spec/rubocop/formatter/formatter_set_spec.rb +5 -5
- data/spec/rubocop/formatter/fuubar_style_formatter_spec.rb +1 -1
- data/spec/rubocop/formatter/json_formatter_spec.rb +1 -1
- data/spec/rubocop/formatter/offense_count_formatter_spec.rb +1 -1
- data/spec/rubocop/formatter/progress_formatter_spec.rb +1 -1
- data/spec/rubocop/formatter/simple_text_formatter_spec.rb +1 -1
- data/spec/rubocop/options_spec.rb +5 -5
- data/spec/rubocop/path_util_spec.rb +1 -1
- data/spec/rubocop/processed_source_spec.rb +1 -1
- data/spec/rubocop/source_parser_spec.rb +3 -3
- data/spec/rubocop/target_finder_spec.rb +2 -2
- data/spec/rubocop/token_spec.rb +1 -1
- data/spec/spec_helper.rb +8 -8
- data/spec/support/isolated_environment.rb +1 -1
- data/spec/support/mri_syntax_checker.rb +1 -1
- data/spec/support/offenses_matcher.rb +30 -0
- data/spec/support/shared_context.rb +3 -3
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8589f766e3f0895be647fba9351e4fb39a59a9a
|
4
|
+
data.tar.gz: e19066dcc0432f7e529721251f23f9349fc37cab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e7c61eb4754551ff087156bb63393b93661e8e1d49f44577ee2ec57e701f23303fac4b300ccf8249fee63f4c6925015d4107fbb5b2cb3bd98681e9c2313a68e
|
7
|
+
data.tar.gz: 3ff42ef90979b0a32df0411da3b6404c243efbbd3902cc3cb1b53d9a614892b5942c70a1077b2819692c403a51e4f69737933b64338784d30e6e7899307763b8
|
data/.gitignore
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
-
# on 2014-
|
2
|
+
# on 2014-05-17 17:36:04 +0200 using RuboCop version 0.21.0.
|
3
3
|
# The point is for the user to remove these configuration records
|
4
4
|
# one by one as the offenses are removed from the code base.
|
5
5
|
# Note that changes in the inspected code, or installation of new
|
@@ -7,14 +7,14 @@
|
|
7
7
|
|
8
8
|
# Offense count: 7
|
9
9
|
# Configuration parameters: CountComments.
|
10
|
-
ClassLength:
|
11
|
-
Max:
|
10
|
+
Style/ClassLength:
|
11
|
+
Max: 129
|
12
12
|
|
13
13
|
# Offense count: 24
|
14
|
-
CyclomaticComplexity:
|
14
|
+
Style/CyclomaticComplexity:
|
15
15
|
Max: 10
|
16
16
|
|
17
|
-
# Offense count:
|
17
|
+
# Offense count: 115
|
18
18
|
# Configuration parameters: CountComments.
|
19
|
-
MethodLength:
|
20
|
-
Max:
|
19
|
+
Style/MethodLength:
|
20
|
+
Max: 21
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,36 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 0.23.0 (02/06/2014)
|
6
|
+
|
7
|
+
### New features
|
8
|
+
|
9
|
+
* [#1117](https://github.com/bbatsov/rubocop/issues/1117): `BlockComments` cop does auto-correction. ([@jonas054][])
|
10
|
+
* [#1124](https://github.com/bbatsov/rubocop/pull/1124): `TrivialAccessors` cop auto-corrects class-level accessors. ([@ggilder][])
|
11
|
+
* [#1062](https://github.com/bbatsov/rubocop/pull/1062): New cop `InlineComment` checks for inline comments. ([@salbertson][])
|
12
|
+
* [#1118](https://github.com/bbatsov/rubocop/issues/1118): Add checking and auto-correction of right brackets in `IndentArray` and `IndentHash`. ([@jonas054][])
|
13
|
+
|
14
|
+
### Changes
|
15
|
+
|
16
|
+
* [#1097](https://github.com/bbatsov/rubocop/issues/1097): Add optional namespace prefix to cop names: `Style/LineLength` instead of `LineLength` in config files, `--only` argument, `--show-cops` output, and `# rubocop:disable`. ([@jonas054][])
|
17
|
+
* [#1075](https://github.com/bbatsov/rubocop/issues/1075): More strict limits on when to require trailing comma. ([@jonas054][])
|
18
|
+
* Renamed `Rubocop` module to `RuboCop`. ([@bbatsov][])
|
19
|
+
|
20
|
+
### Bugs fixed
|
21
|
+
|
22
|
+
* [#1126](https://github.com/bbatsov/rubocop/pull/1126): Fix `--auto-gen-config` bug with `RegexpLiteral` where only the last file's results would be used. ([@ggilder][])
|
23
|
+
* [#1104](https://github.com/bbatsov/rubocop/issues/1104): Fix `EachWithObject` with modifier if as body. ([@geniou][])
|
24
|
+
* [#1106](https://github.com/bbatsov/rubocop/issues/1106): Fix `EachWithObject` with single method call as body. ([@geniou][])
|
25
|
+
* Avoid the warning about ignoring syck YAML engine from JRuby. ([@jonas054][])
|
26
|
+
* [#1111](https://github.com/bbatsov/rubocop/issues/1111): Fix problem in `EndOfLine` with reading non-UTF-8 encoded files. ([@jonas054][])
|
27
|
+
* [#1115](https://github.com/bbatsov/rubocop/issues/1115): Fix `Next` to ignore super nodes. ([@geniou][])
|
28
|
+
* [#1117](https://github.com/bbatsov/rubocop/issues/1117): Don't auto-correct indentation in scopes that contain block comments (`=begin`..`=end`). ([@jonas054][])
|
29
|
+
* [#1123](https://github.com/bbatsov/rubocop/pull/1123): Support setter calls in safe assignment in `ParenthesesAroundCondition`. ([@jonas054][])
|
30
|
+
* [#1090](https://github.com/bbatsov/rubocop/issues/1090): Correct handling of documentation vs annotation comment. ([@jonas054][])
|
31
|
+
* [#1118](https://github.com/bbatsov/rubocop/issues/1118): Never write invalid ruby to a file in auto-correct. ([@jonas054][])
|
32
|
+
* [#1120](https://github.com/bbatsov/rubocop/issues/1120): Don't change indentation of heredoc strings in auto-correct. ([@jonas054][])
|
33
|
+
* [#1109](https://github.com/bbatsov/rubocop/issues/1109): Handle conditions with modifier ops in them in `ParenthesesAroundCondition`. ([@bbatsov][])
|
34
|
+
|
5
35
|
## 0.22.0 (20/04/2014)
|
6
36
|
|
7
37
|
### New features
|
@@ -14,6 +44,7 @@
|
|
14
44
|
* Add auto-correct to `UnusedBlockArgument` and `UnusedMethodArgument` cops. ([@hannestyden][])
|
15
45
|
* [#1074](https://github.com/bbatsov/rubocop/issues/1074): New cop `SpaceBeforeComment` checks for missing space between code and a comment on the same line. ([@jonas054][])
|
16
46
|
* [#1089](https://github.com/bbatsov/rubocop/pull/1089): New option `-F`/`--fail-fast` inspects files in modification time order and stop after the first file with offenses. ([@jonas054][])
|
47
|
+
* Add optional `require` directive to `.rubocop.yml` to load custom ruby files. ([@geniou][])
|
17
48
|
|
18
49
|
### Changes
|
19
50
|
|
@@ -70,7 +101,7 @@
|
|
70
101
|
* [#976](https://github.com/bbatsov/rubocop/issues/976): Fix `EndAlignment` not handling element assignment correctly. ([@tamird][])
|
71
102
|
* [#976](https://github.com/bbatsov/rubocop/issues/976): Fix `IndentationWidth` not handling element assignment correctly. ([@tamird][])
|
72
103
|
* [#800](https://github.com/bbatsov/rubocop/issues/800): Do not report `[Corrected]` in `--auto-correct` mode if correction wasn't done. ([@jonas054][])
|
73
|
-
* [#968](https://github.com/bbatsov/rubocop/issues/968): Fix bug when running
|
104
|
+
* [#968](https://github.com/bbatsov/rubocop/issues/968): Fix bug when running RuboCop with `-c .rubocop.yml`. ([@bquorning][])
|
74
105
|
* [#975](https://github.com/bbatsov/rubocop/pull/975): Fix infinite correction in `IndentationWidth`. ([@jonas054][])
|
75
106
|
* [#986](https://github.com/bbatsov/rubocop/issues/986): When `--lint` is used together with `--only`, all lint cops are run in addition to the given cops. ([@jonas054][])
|
76
107
|
* [#997](https://github.com/bbatsov/rubocop/issues/997): Fix handling of file paths for matching against `Exclude` property when `rubocop .` is called. ([@jonas054][])
|
@@ -936,3 +967,5 @@
|
|
936
967
|
[@barunio]: https://github.com/barunio
|
937
968
|
[@molawson]: https://github.com/molawson
|
938
969
|
[@wndhydrnt]: https://github.com/wndhydrnt
|
970
|
+
[@ggilder]: https://github.com/ggilder
|
971
|
+
[@salbertson]: https://github.com/salbertson
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -41,9 +41,6 @@ automatically fix some of the problems for you.
|
|
41
41
|
- [File List Formatter](#file-list-formatter)
|
42
42
|
- [JSON Formatter](#json-formatter)
|
43
43
|
- [Offense Count Formatter](#offense-count-formatter)
|
44
|
-
- [Custom Formatters](#custom-formatters)
|
45
|
-
- [Creating Custom Formatter](#creating-custom-formatter)
|
46
|
-
- [Using Custom Formatter in Command Line](#using-custom-formatter-in-command-line)
|
47
44
|
- [Compatibility](#compatibility)
|
48
45
|
- [Editor integration](#editor-integration)
|
49
46
|
- [Emacs](#emacs)
|
@@ -56,6 +53,13 @@ automatically fix some of the problems for you.
|
|
56
53
|
- [Other Editors](#other-editors)
|
57
54
|
- [Guard integration](#guard-integration)
|
58
55
|
- [Rake integration](#rake-integration)
|
56
|
+
- [Extensions](#extensions)
|
57
|
+
- [Loading Extensions](#loading-extensions)
|
58
|
+
- [Custom Cops](#custom-cops)
|
59
|
+
- [Known Custom Cops](#known-custom-cops)
|
60
|
+
- [Custom Formatters](#custom-formatters)
|
61
|
+
- [Creating Custom Formatter](#creating-custom-formatter)
|
62
|
+
- [Using Custom Formatter in Command Line](#using-custom-formatter-in-command-line)
|
59
63
|
- [Team](#team)
|
60
64
|
- [Contributors](#contributors)
|
61
65
|
- [Mailing List](#mailing-list)
|
@@ -135,7 +139,7 @@ Command flag | Description
|
|
135
139
|
`-c/--config` | Run with specified config file
|
136
140
|
`-f/--format` | Choose a formatter
|
137
141
|
`-o/--out` | Write output to a file instead of STDOUT
|
138
|
-
`-r/--require` | Require Ruby file
|
142
|
+
`-r/--require` | Require Ruby file (see [Loading Extensions](#loading-extensions))
|
139
143
|
`-R/--rails` | Run extra Rails cops
|
140
144
|
`-l/--lint` | Run only lint cops
|
141
145
|
`-a/--auto-correct` | Auto-correct certain offenses *Note:* Experimental - use with caution
|
@@ -148,6 +152,8 @@ Command flag | Description
|
|
148
152
|
|
149
153
|
In RuboCop lingo the various checks performed on the code are called cops. There are several cop departments.
|
150
154
|
|
155
|
+
You can also load [custom cops](#custom-cops).
|
156
|
+
|
151
157
|
#### Style
|
152
158
|
|
153
159
|
Most of the cops in RuboCop are so called style cops that check for
|
@@ -198,13 +204,16 @@ The file has the following format:
|
|
198
204
|
```yaml
|
199
205
|
inherit_from: ../.rubocop.yml
|
200
206
|
|
201
|
-
Encoding:
|
207
|
+
Style/Encoding:
|
202
208
|
Enabled: false
|
203
209
|
|
204
|
-
LineLength:
|
210
|
+
Style/LineLength:
|
205
211
|
Max: 99
|
206
212
|
```
|
207
213
|
|
214
|
+
**Note**: Qualifying cop name with its type, e.g., `Style`, is recommended,
|
215
|
+
but not necessary as long as the cop name is unique across all types.
|
216
|
+
|
208
217
|
### Inheritance
|
209
218
|
|
210
219
|
The optional `inherit_from` directive is used to include configuration
|
@@ -284,7 +293,7 @@ paths match `app/models/*.rb`). All cops support the
|
|
284
293
|
`Include` param.
|
285
294
|
|
286
295
|
```yaml
|
287
|
-
DefaultScope:
|
296
|
+
Rails/DefaultScope:
|
288
297
|
Include:
|
289
298
|
- app/models/*.rb
|
290
299
|
```
|
@@ -294,7 +303,7 @@ instance you might want to run some cop only on a specific file). All cops suppo
|
|
294
303
|
`Exclude` param.
|
295
304
|
|
296
305
|
```yaml
|
297
|
-
DefaultScope:
|
306
|
+
Rails/DefaultScope:
|
298
307
|
Exclude:
|
299
308
|
- app/models/problematic.rb
|
300
309
|
```
|
@@ -302,7 +311,7 @@ DefaultScope:
|
|
302
311
|
Specific cops can be disabled by setting `Enabled` to `false` for that specific cop.
|
303
312
|
|
304
313
|
```yaml
|
305
|
-
LineLength:
|
314
|
+
Style/LineLength:
|
306
315
|
Enabled: false
|
307
316
|
```
|
308
317
|
|
@@ -310,7 +319,7 @@ Cops can customize their severity level. All cops support the `Severity` param.
|
|
310
319
|
Allowed params are `refactor`, `convention`, `warning`, `error` and `fatal`.
|
311
320
|
|
312
321
|
```yaml
|
313
|
-
CyclomaticComplexity:
|
322
|
+
Style/CyclomaticComplexity:
|
314
323
|
Severity: warning
|
315
324
|
```
|
316
325
|
|
@@ -330,9 +339,9 @@ One or more individual cops can be disabled locally in a section of a
|
|
330
339
|
file by adding a comment such as
|
331
340
|
|
332
341
|
```ruby
|
333
|
-
# rubocop:disable LineLength, StringLiterals
|
342
|
+
# rubocop:disable Style/LineLength, Style/StringLiterals
|
334
343
|
[...]
|
335
|
-
# rubocop:enable LineLength, StringLiterals
|
344
|
+
# rubocop:enable Style/LineLength, Style/StringLiterals
|
336
345
|
```
|
337
346
|
|
338
347
|
You can also disable *all* cops with
|
@@ -347,7 +356,7 @@ One or more cops can be disabled on a single line with an end-of-line
|
|
347
356
|
comment.
|
348
357
|
|
349
358
|
```ruby
|
350
|
-
for x in (0..19) # rubocop:disable AvoidFor
|
359
|
+
for x in (0..19) # rubocop:disable Style/AvoidFor
|
351
360
|
```
|
352
361
|
|
353
362
|
## Formatters
|
@@ -391,6 +400,8 @@ $ rubocop --output result.txt --format simple
|
|
391
400
|
# default format $stdout
|
392
401
|
```
|
393
402
|
|
403
|
+
You can also load [custom formatters](#custom-formatters).
|
404
|
+
|
394
405
|
### Progress Formatter (default)
|
395
406
|
|
396
407
|
The default `progress` formatter outputs a character for each inspected file,
|
@@ -568,38 +579,6 @@ $ rubocop --format offenses
|
|
568
579
|
134 Total
|
569
580
|
```
|
570
581
|
|
571
|
-
### Custom Formatters
|
572
|
-
|
573
|
-
You can customize RuboCop's output format with custom formatter.
|
574
|
-
|
575
|
-
#### Creating Custom Formatter
|
576
|
-
|
577
|
-
To implement a custom formatter, you need to subclass
|
578
|
-
`Rubocop::Formatter::BaseFormatter` and override some methods,
|
579
|
-
or implement all formatter API methods by duck typing.
|
580
|
-
|
581
|
-
Please see the documents below for more formatter API details.
|
582
|
-
|
583
|
-
* [Rubocop::Formatter::BaseFormatter](http://rubydoc.info/gems/rubocop/Rubocop/Formatter/BaseFormatter)
|
584
|
-
* [Rubocop::Cop::Offense](http://rubydoc.info/gems/rubocop/Rubocop/Cop/Offense)
|
585
|
-
* [Parser::Source::Range](http://rubydoc.info/github/whitequark/parser/Parser/Source/Range)
|
586
|
-
|
587
|
-
#### Using Custom Formatter in Command Line
|
588
|
-
|
589
|
-
You can tell RuboCop to use your custom formatter with a combination of
|
590
|
-
`--format` and `--require` option.
|
591
|
-
For example, when you have defined `MyCustomFormatter` in
|
592
|
-
`./path/to/my_custom_formatter.rb`, you would type this command:
|
593
|
-
|
594
|
-
```
|
595
|
-
$ rubocop --require ./path/to/my_custom_formatter --format MyCustomFormatter
|
596
|
-
```
|
597
|
-
|
598
|
-
Note: The path passed to `--require` is directly passed to `Kernel.require`.
|
599
|
-
If your custom formatter file is not in `$LOAD_PATH`,
|
600
|
-
you need to specify the path as relative path prefixed with `./` explicitly,
|
601
|
-
or absolute path.
|
602
|
-
|
603
582
|
## Compatibility
|
604
583
|
|
605
584
|
RuboCop supports the following Ruby implementations:
|
@@ -653,6 +632,9 @@ Installation instructions can be found [here](https://github.com/mrdougal/textma
|
|
653
632
|
The [atom-lint](https://github.com/yujinakayama/atom-lint) package
|
654
633
|
runs RuboCop and highlights the offenses in Atom.
|
655
634
|
|
635
|
+
You can also use the [linter-rubocop](https://github.com/AtomLinter/linter-rubocop)
|
636
|
+
plugin for Atom's [linter](https://github.com/AtomLinter/Linter).
|
637
|
+
|
656
638
|
### LightTable
|
657
639
|
|
658
640
|
The [lt-rubocop](https://github.com/seancaffery/lt-rubocop) plugin
|
@@ -679,7 +661,7 @@ To use RuboCop in your `Rakefile` add the following:
|
|
679
661
|
```ruby
|
680
662
|
require 'rubocop/rake_task'
|
681
663
|
|
682
|
-
|
664
|
+
RuboCop::RakeTask.new
|
683
665
|
```
|
684
666
|
|
685
667
|
The above will use default values
|
@@ -688,7 +670,7 @@ The above will use default values
|
|
688
670
|
require 'rubocop/rake_task'
|
689
671
|
|
690
672
|
desc 'Run RuboCop on the lib directory'
|
691
|
-
|
673
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
692
674
|
task.patterns = ['lib/**/*.rb']
|
693
675
|
# only show the files with failures
|
694
676
|
task.formatters = ['files']
|
@@ -697,6 +679,63 @@ Rubocop::RakeTask.new(:rubocop) do |task|
|
|
697
679
|
end
|
698
680
|
```
|
699
681
|
|
682
|
+
## Extensions
|
683
|
+
|
684
|
+
It's possible to extend RuboCop with custom cops and formatters.
|
685
|
+
|
686
|
+
### Loading Extensions
|
687
|
+
|
688
|
+
Besides the `--require` command line option you can also specify ruby
|
689
|
+
files that should be loaded with the optional `require` directive in the
|
690
|
+
`.rubocop.yml` file:
|
691
|
+
|
692
|
+
```yaml
|
693
|
+
require:
|
694
|
+
- ../my/custom/file.rb
|
695
|
+
- rubocop-extension
|
696
|
+
```
|
697
|
+
|
698
|
+
Note: The pathes are directly passed to `Kernel.require`. If your
|
699
|
+
extension file is not in `$LOAD_PATH`, you need to specify the path as
|
700
|
+
relative path prefixed with `./` explicitly, or absolute path.
|
701
|
+
|
702
|
+
### Custom Cops
|
703
|
+
|
704
|
+
You can configure the custom cops in your `.rubocop.yml` just like any
|
705
|
+
other cop.
|
706
|
+
|
707
|
+
#### Known Custom Cops
|
708
|
+
|
709
|
+
* [rubocop-rspec](https://github.com/nevir/rubocop-rspec) -
|
710
|
+
RSpec-specific analysis
|
711
|
+
|
712
|
+
### Custom Formatters
|
713
|
+
|
714
|
+
You can customize RuboCop's output format with custom formatters.
|
715
|
+
|
716
|
+
#### Creating Custom Formatter
|
717
|
+
|
718
|
+
To implement a custom formatter, you need to subclass
|
719
|
+
`RuboCop::Formatter::BaseFormatter` and override some methods,
|
720
|
+
or implement all formatter API methods by duck typing.
|
721
|
+
|
722
|
+
Please see the documents below for more formatter API details.
|
723
|
+
|
724
|
+
* [RuboCop::Formatter::BaseFormatter](http://rubydoc.info/gems/rubocop/RuboCop/Formatter/BaseFormatter)
|
725
|
+
* [RuboCop::Cop::Offense](http://rubydoc.info/gems/rubocop/RuboCop/Cop/Offense)
|
726
|
+
* [Parser::Source::Range](http://rubydoc.info/github/whitequark/parser/Parser/Source/Range)
|
727
|
+
|
728
|
+
#### Using Custom Formatter in Command Line
|
729
|
+
|
730
|
+
You can tell RuboCop to use your custom formatter with a combination of
|
731
|
+
`--format` and `--require` option.
|
732
|
+
For example, when you have defined `MyCustomFormatter` in
|
733
|
+
`./path/to/my_custom_formatter.rb`, you would type this command:
|
734
|
+
|
735
|
+
```
|
736
|
+
$ rubocop --require ./path/to/my_custom_formatter --format MyCustomFormatter
|
737
|
+
```
|
738
|
+
|
700
739
|
## Team
|
701
740
|
|
702
741
|
Here's a list of RuboCop's core developers:
|
data/Rakefile
CHANGED
@@ -25,14 +25,14 @@ task :coverage do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
desc 'Run RuboCop over itself'
|
28
|
-
|
28
|
+
RuboCop::RakeTask.new(:internal_investigation)
|
29
29
|
|
30
30
|
task default: [:spec, :internal_investigation]
|
31
31
|
|
32
32
|
require 'yard'
|
33
33
|
YARD::Rake::YardocTask.new
|
34
34
|
|
35
|
-
|
35
|
+
RuboCop::RakeTask.new
|
36
36
|
|
37
37
|
task :console do
|
38
38
|
require 'irb'
|
data/bin/rubocop
CHANGED
data/config/default.yml
CHANGED
@@ -18,14 +18,14 @@ AllCops:
|
|
18
18
|
RunRailsCops: false
|
19
19
|
|
20
20
|
# Indent private/protected/public as deep as method definitions
|
21
|
-
AccessModifierIndentation:
|
21
|
+
Style/AccessModifierIndentation:
|
22
22
|
EnforcedStyle: indent
|
23
23
|
SupportedStyles:
|
24
24
|
- outdent
|
25
25
|
- indent
|
26
26
|
|
27
27
|
# Align the elements of a hash literal if they span more than one line.
|
28
|
-
AlignHash:
|
28
|
+
Style/AlignHash:
|
29
29
|
# Alignment of entries using hash rocket as separator. Valid values are:
|
30
30
|
#
|
31
31
|
# key - left alignment of keys
|
@@ -88,7 +88,7 @@ AlignHash:
|
|
88
88
|
- ignore_implicit
|
89
89
|
- ignore_explicit
|
90
90
|
|
91
|
-
AlignParameters:
|
91
|
+
Style/AlignParameters:
|
92
92
|
# Alignment of parameters in multi-line method calls.
|
93
93
|
#
|
94
94
|
# The `with_first_parameter` style aligns the following lines along the same column
|
@@ -107,28 +107,24 @@ AlignParameters:
|
|
107
107
|
- with_first_parameter
|
108
108
|
- with_fixed_indentation
|
109
109
|
|
110
|
-
|
111
|
-
AssignmentInCondition:
|
112
|
-
AllowSafeAssignment: true
|
113
|
-
|
114
|
-
BlockNesting:
|
110
|
+
Style/BlockNesting:
|
115
111
|
Max: 3
|
116
112
|
|
117
|
-
BracesAroundHashParameters:
|
113
|
+
Style/BracesAroundHashParameters:
|
118
114
|
EnforcedStyle: no_braces
|
119
115
|
SupportedStyles:
|
120
116
|
- braces
|
121
117
|
- no_braces
|
122
118
|
|
123
119
|
# Indentation of `when`.
|
124
|
-
CaseIndentation:
|
120
|
+
Style/CaseIndentation:
|
125
121
|
IndentWhenRelativeTo: case
|
126
122
|
SupportedStyles:
|
127
123
|
- case
|
128
124
|
- end
|
129
125
|
IndentOneStep: false
|
130
126
|
|
131
|
-
ClassAndModuleChildren:
|
127
|
+
Style/ClassAndModuleChildren:
|
132
128
|
# Checks the style of children definitions at classes and modules.
|
133
129
|
#
|
134
130
|
# Basically there are two different styles:
|
@@ -149,12 +145,12 @@ ClassAndModuleChildren:
|
|
149
145
|
- nested
|
150
146
|
- compact
|
151
147
|
|
152
|
-
ClassLength:
|
148
|
+
Style/ClassLength:
|
153
149
|
CountComments: false # count full line comments?
|
154
150
|
Max: 100
|
155
151
|
|
156
152
|
# Align with the style guide.
|
157
|
-
CollectionMethods:
|
153
|
+
Style/CollectionMethods:
|
158
154
|
# Mapping from undesired method to desired_method
|
159
155
|
# e.g. to use `detect` over `find`:
|
160
156
|
#
|
@@ -169,7 +165,7 @@ CollectionMethods:
|
|
169
165
|
find_all: 'select'
|
170
166
|
|
171
167
|
# Checks formatting of special comments
|
172
|
-
CommentAnnotation:
|
168
|
+
Style/CommentAnnotation:
|
173
169
|
Keywords:
|
174
170
|
- TODO
|
175
171
|
- FIXME
|
@@ -178,56 +174,44 @@ CommentAnnotation:
|
|
178
174
|
- REVIEW
|
179
175
|
|
180
176
|
# Avoid complex methods.
|
181
|
-
CyclomaticComplexity:
|
177
|
+
Style/CyclomaticComplexity:
|
182
178
|
Max: 6
|
183
179
|
|
184
180
|
# Multi-line method chaining should be done with leading dots.
|
185
|
-
DotPosition:
|
181
|
+
Style/DotPosition:
|
186
182
|
EnforcedStyle: leading
|
187
183
|
SupportedStyles:
|
188
184
|
- leading
|
189
185
|
- trailing
|
190
186
|
|
191
187
|
# Use empty lines between defs.
|
192
|
-
EmptyLineBetweenDefs:
|
188
|
+
Style/EmptyLineBetweenDefs:
|
193
189
|
# If true, this parameter means that single line method definitions don't
|
194
190
|
# need an empty line between them.
|
195
191
|
AllowAdjacentOneLineDefs: false
|
196
192
|
|
197
193
|
# Checks whether the source file has a utf-8 encoding comment or not
|
198
|
-
Encoding:
|
194
|
+
Style/Encoding:
|
199
195
|
EnforcedStyle: always
|
200
196
|
SupportedStyles:
|
201
197
|
- when_needed
|
202
198
|
- always
|
203
199
|
|
204
|
-
|
205
|
-
EndAlignment:
|
206
|
-
# The value `keyword` means that `end` should be aligned with the matching
|
207
|
-
# keyword (if, while, etc.).
|
208
|
-
# The value `variable` means that in assignments, `end` should be aligned
|
209
|
-
# with the start of the variable on the left hand side of `=`. In all other
|
210
|
-
# situations, `end` should still be aligned with the keyword.
|
211
|
-
AlignWith: keyword
|
212
|
-
SupportedStyles:
|
213
|
-
- keyword
|
214
|
-
- variable
|
215
|
-
|
216
|
-
FileName:
|
200
|
+
Style/FileName:
|
217
201
|
Exclude:
|
218
202
|
- '**/Rakefile'
|
219
203
|
- '**/Gemfile'
|
220
204
|
- '**/Capfile'
|
221
205
|
|
222
206
|
# Checks use of for or each in multiline loops.
|
223
|
-
For:
|
207
|
+
Style/For:
|
224
208
|
EnforcedStyle: each
|
225
209
|
SupportedStyles:
|
226
210
|
- for
|
227
211
|
- each
|
228
212
|
|
229
213
|
# Enforce the method used for string formatting.
|
230
|
-
FormatString:
|
214
|
+
Style/FormatString:
|
231
215
|
EnforcedStyle: format
|
232
216
|
SupportedStyles:
|
233
217
|
- format
|
@@ -235,25 +219,25 @@ FormatString:
|
|
235
219
|
- percent
|
236
220
|
|
237
221
|
# Built-in global variables are allowed by default.
|
238
|
-
GlobalVars:
|
222
|
+
Style/GlobalVars:
|
239
223
|
AllowedVariables: []
|
240
224
|
|
241
225
|
# `MinBodyLength` defines the number of lines of the a body of an if / unless
|
242
226
|
# needs to have to trigger this cop
|
243
|
-
GuardClause:
|
227
|
+
Style/GuardClause:
|
244
228
|
MinBodyLength: 1
|
245
229
|
|
246
|
-
HashSyntax:
|
230
|
+
Style/HashSyntax:
|
247
231
|
EnforcedStyle: ruby19
|
248
232
|
SupportedStyles:
|
249
233
|
- ruby19
|
250
234
|
- hash_rockets
|
251
235
|
|
252
|
-
IfUnlessModifier:
|
236
|
+
Style/IfUnlessModifier:
|
253
237
|
MaxLineLength: 80
|
254
238
|
|
255
239
|
# Checks the indentation of the first key in a hash literal.
|
256
|
-
IndentHash:
|
240
|
+
Style/IndentHash:
|
257
241
|
# The value `special_inside_parentheses` means that hash literals with braces
|
258
242
|
# that have their opening brace on the same line as a surrounding opening
|
259
243
|
# round parenthesis, shall have their first key indented relative to the
|
@@ -266,16 +250,16 @@ IndentHash:
|
|
266
250
|
- special_inside_parentheses
|
267
251
|
- consistent
|
268
252
|
|
269
|
-
LambdaCall:
|
253
|
+
Style/LambdaCall:
|
270
254
|
EnforcedStyle: call
|
271
255
|
SupportedStyles:
|
272
256
|
- call
|
273
257
|
- braces
|
274
258
|
|
275
|
-
LineLength:
|
259
|
+
Style/LineLength:
|
276
260
|
Max: 80
|
277
261
|
|
278
|
-
Next:
|
262
|
+
Style/Next:
|
279
263
|
# With `always` all conditions at the end of an iteration needs to be
|
280
264
|
# replace by next - with `skip_modifier_ifs` the modifier if like this one
|
281
265
|
# are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
|
@@ -284,7 +268,7 @@ Next:
|
|
284
268
|
- skip_modifier_ifs
|
285
269
|
- always
|
286
270
|
|
287
|
-
NonNilCheck:
|
271
|
+
Style/NonNilCheck:
|
288
272
|
# With `IncludeSemanticChanges` set to `true`, this cop reports offences for
|
289
273
|
# `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
|
290
274
|
# **usually** OK, but might change behavior.
|
@@ -293,34 +277,34 @@ NonNilCheck:
|
|
293
277
|
# offences for `!x.nil?` and does no changes that might change behavior.
|
294
278
|
IncludeSemanticChanges: false
|
295
279
|
|
296
|
-
MethodDefParentheses:
|
280
|
+
Style/MethodDefParentheses:
|
297
281
|
EnforcedStyle: require_parentheses
|
298
282
|
SupportedStyles:
|
299
283
|
- require_parentheses
|
300
284
|
- require_no_parentheses
|
301
285
|
|
302
|
-
MethodLength:
|
286
|
+
Style/MethodLength:
|
303
287
|
CountComments: false # count full line comments?
|
304
288
|
Max: 10
|
305
289
|
|
306
|
-
MethodName:
|
290
|
+
Style/MethodName:
|
307
291
|
EnforcedStyle: snake_case
|
308
292
|
SupportedStyles:
|
309
293
|
- snake_case
|
310
294
|
- camelCase
|
311
295
|
|
312
|
-
NumericLiterals:
|
296
|
+
Style/NumericLiterals:
|
313
297
|
MinDigits: 5
|
314
298
|
|
315
|
-
ParameterLists:
|
299
|
+
Style/ParameterLists:
|
316
300
|
Max: 5
|
317
301
|
CountKeywordArgs: true
|
318
302
|
|
319
303
|
# Allow safe assignment in conditions.
|
320
|
-
ParenthesesAroundCondition:
|
304
|
+
Style/ParenthesesAroundCondition:
|
321
305
|
AllowSafeAssignment: true
|
322
306
|
|
323
|
-
PercentLiteralDelimiters:
|
307
|
+
Style/PercentLiteralDelimiters:
|
324
308
|
PreferredDelimiters:
|
325
309
|
'%': ()
|
326
310
|
'%i': ()
|
@@ -332,33 +316,33 @@ PercentLiteralDelimiters:
|
|
332
316
|
'%W': ()
|
333
317
|
'%x': ()
|
334
318
|
|
335
|
-
PredicateName:
|
319
|
+
Style/PredicateName:
|
336
320
|
NamePrefixBlacklist:
|
337
321
|
- is_
|
338
322
|
- has_
|
339
323
|
- have_
|
340
324
|
|
341
|
-
RaiseArgs:
|
325
|
+
Style/RaiseArgs:
|
342
326
|
EnforcedStyle: exploded
|
343
327
|
SupportedStyles:
|
344
328
|
- compact # raise Exception.new(msg)
|
345
329
|
- exploded # raise Exception, msg
|
346
330
|
|
347
331
|
|
348
|
-
RedundantReturn:
|
332
|
+
Style/RedundantReturn:
|
349
333
|
# When true allows code like `return x, y`.
|
350
334
|
AllowMultipleReturnValues: false
|
351
335
|
|
352
|
-
RegexpLiteral:
|
336
|
+
Style/RegexpLiteral:
|
353
337
|
# The maximum number of (escaped) slashes that a slash-delimited regexp is
|
354
338
|
# allowed to have. If there are more slashes, a %r regexp shall be used.
|
355
339
|
MaxSlashes: 1
|
356
340
|
|
357
|
-
Semicolon:
|
341
|
+
Style/Semicolon:
|
358
342
|
# Allow ; to separate several expressions on the same line.
|
359
343
|
AllowAsExpressionSeparator: false
|
360
344
|
|
361
|
-
SignalException:
|
345
|
+
Style/SignalException:
|
362
346
|
EnforcedStyle: semantic
|
363
347
|
SupportedStyles:
|
364
348
|
- only_raise
|
@@ -366,7 +350,7 @@ SignalException:
|
|
366
350
|
- semantic
|
367
351
|
|
368
352
|
|
369
|
-
SingleLineBlockParams:
|
353
|
+
Style/SingleLineBlockParams:
|
370
354
|
Methods:
|
371
355
|
- reduce:
|
372
356
|
- a
|
@@ -375,28 +359,28 @@ SingleLineBlockParams:
|
|
375
359
|
- a
|
376
360
|
- e
|
377
361
|
|
378
|
-
SingleLineMethods:
|
362
|
+
Style/SingleLineMethods:
|
379
363
|
AllowIfMethodIsEmpty: true
|
380
364
|
|
381
|
-
StringLiterals:
|
365
|
+
Style/StringLiterals:
|
382
366
|
EnforcedStyle: single_quotes
|
383
367
|
SupportedStyles:
|
384
368
|
- single_quotes
|
385
369
|
- double_quotes
|
386
370
|
|
387
|
-
SpaceAroundEqualsInParameterDefault:
|
371
|
+
Style/SpaceAroundEqualsInParameterDefault:
|
388
372
|
EnforcedStyle: space
|
389
373
|
SupportedStyles:
|
390
374
|
- space
|
391
375
|
- no_space
|
392
376
|
|
393
|
-
SpaceBeforeBlockBraces:
|
377
|
+
Style/SpaceBeforeBlockBraces:
|
394
378
|
EnforcedStyle: space
|
395
379
|
SupportedStyles:
|
396
380
|
- space
|
397
381
|
- no_space
|
398
382
|
|
399
|
-
SpaceInsideBlockBraces:
|
383
|
+
Style/SpaceInsideBlockBraces:
|
400
384
|
EnforcedStyle: space
|
401
385
|
SupportedStyles:
|
402
386
|
- space
|
@@ -406,20 +390,20 @@ SpaceInsideBlockBraces:
|
|
406
390
|
# Space between { and |. Overrides EnforcedStyle if there is a conflict.
|
407
391
|
SpaceBeforeBlockParameters: true
|
408
392
|
|
409
|
-
SpaceInsideHashLiteralBraces:
|
393
|
+
Style/SpaceInsideHashLiteralBraces:
|
410
394
|
EnforcedStyle: space
|
411
395
|
EnforcedStyleForEmptyBraces: no_space
|
412
396
|
SupportedStyles:
|
413
397
|
- space
|
414
398
|
- no_space
|
415
399
|
|
416
|
-
TrailingBlankLines:
|
400
|
+
Style/TrailingBlankLines:
|
417
401
|
EnforcedStyle: final_newline
|
418
402
|
SupportedStyles:
|
419
403
|
- final_newline
|
420
404
|
- final_blank_line
|
421
405
|
|
422
|
-
TrailingComma:
|
406
|
+
Style/TrailingComma:
|
423
407
|
EnforcedStyleForMultiline: no_comma
|
424
408
|
SupportedStyles:
|
425
409
|
- comma
|
@@ -427,7 +411,7 @@ TrailingComma:
|
|
427
411
|
|
428
412
|
# TrivialAccessors doesn't require exact name matches and doesn't allow
|
429
413
|
# predicated methods by default.
|
430
|
-
TrivialAccessors:
|
414
|
+
Style/TrivialAccessors:
|
431
415
|
ExactNameMatch: false
|
432
416
|
AllowPredicates: false
|
433
417
|
# Allows trivial writers that don't end in an equal sign. e.g.
|
@@ -458,21 +442,39 @@ TrivialAccessors:
|
|
458
442
|
- to_s
|
459
443
|
- to_sym
|
460
444
|
|
461
|
-
VariableName:
|
445
|
+
Style/VariableName:
|
462
446
|
EnforcedStyle: snake_case
|
463
447
|
SupportedStyles:
|
464
448
|
- snake_case
|
465
449
|
- camelCase
|
466
450
|
|
467
|
-
WhileUntilModifier:
|
451
|
+
Style/WhileUntilModifier:
|
468
452
|
MaxLineLength: 80
|
469
453
|
|
470
|
-
WordArray:
|
454
|
+
Style/WordArray:
|
471
455
|
MinSize: 0
|
472
456
|
|
457
|
+
##################### Lint ##################################
|
458
|
+
|
459
|
+
# Allow safe assignment in conditions.
|
460
|
+
Lint/AssignmentInCondition:
|
461
|
+
AllowSafeAssignment: true
|
462
|
+
|
463
|
+
# Align ends correctly.
|
464
|
+
Lint/EndAlignment:
|
465
|
+
# The value `keyword` means that `end` should be aligned with the matching
|
466
|
+
# keyword (if, while, etc.).
|
467
|
+
# The value `variable` means that in assignments, `end` should be aligned
|
468
|
+
# with the start of the variable on the left hand side of `=`. In all other
|
469
|
+
# situations, `end` should still be aligned with the keyword.
|
470
|
+
AlignWith: keyword
|
471
|
+
SupportedStyles:
|
472
|
+
- keyword
|
473
|
+
- variable
|
474
|
+
|
473
475
|
##################### Rails ##################################
|
474
476
|
|
475
|
-
ActionFilter:
|
477
|
+
Rails/ActionFilter:
|
476
478
|
EnforcedStyle: action
|
477
479
|
SupportedStyles:
|
478
480
|
- action
|
@@ -480,22 +482,22 @@ ActionFilter:
|
|
480
482
|
Include:
|
481
483
|
- app/controllers/**/*.rb
|
482
484
|
|
483
|
-
DefaultScope:
|
485
|
+
Rails/DefaultScope:
|
484
486
|
Include:
|
485
487
|
- app/models/**/*.rb
|
486
488
|
|
487
|
-
HasAndBelongsToMany:
|
489
|
+
Rails/HasAndBelongsToMany:
|
488
490
|
Include:
|
489
491
|
- app/models/**/*.rb
|
490
492
|
|
491
|
-
ReadWriteAttribute:
|
493
|
+
Rails/ReadWriteAttribute:
|
492
494
|
Include:
|
493
495
|
- app/models/**/*.rb
|
494
496
|
|
495
|
-
ScopeArgs:
|
497
|
+
Rails/ScopeArgs:
|
496
498
|
Include:
|
497
499
|
- app/models/**/*.rb
|
498
500
|
|
499
|
-
Validation:
|
501
|
+
Rails/Validation:
|
500
502
|
Include:
|
501
503
|
- app/models/**/*.rb
|