rubbycop 0.49.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +211 -0
- data/assets/logo.png +0 -0
- data/assets/output.html.erb +261 -0
- data/bin/rubbycop +17 -0
- data/config/default.yml +1548 -0
- data/config/disabled.yml +119 -0
- data/config/enabled.yml +1734 -0
- data/lib/rubbycop.rb +510 -0
- data/lib/rubbycop/ast/builder.rb +64 -0
- data/lib/rubbycop/ast/node.rb +610 -0
- data/lib/rubbycop/ast/node/and_node.rb +37 -0
- data/lib/rubbycop/ast/node/array_node.rb +48 -0
- data/lib/rubbycop/ast/node/case_node.rb +64 -0
- data/lib/rubbycop/ast/node/ensure_node.rb +25 -0
- data/lib/rubbycop/ast/node/for_node.rb +53 -0
- data/lib/rubbycop/ast/node/hash_node.rb +109 -0
- data/lib/rubbycop/ast/node/if_node.rb +138 -0
- data/lib/rubbycop/ast/node/keyword_splat_node.rb +45 -0
- data/lib/rubbycop/ast/node/mixin/binary_operator_node.rb +23 -0
- data/lib/rubbycop/ast/node/mixin/conditional_node.rb +45 -0
- data/lib/rubbycop/ast/node/mixin/hash_element_node.rb +125 -0
- data/lib/rubbycop/ast/node/mixin/modifier_node.rb +17 -0
- data/lib/rubbycop/ast/node/mixin/predicate_operator_node.rb +35 -0
- data/lib/rubbycop/ast/node/or_node.rb +37 -0
- data/lib/rubbycop/ast/node/pair_node.rb +64 -0
- data/lib/rubbycop/ast/node/resbody_node.rb +25 -0
- data/lib/rubbycop/ast/node/send_node.rb +209 -0
- data/lib/rubbycop/ast/node/until_node.rb +43 -0
- data/lib/rubbycop/ast/node/when_node.rb +61 -0
- data/lib/rubbycop/ast/node/while_node.rb +43 -0
- data/lib/rubbycop/ast/sexp.rb +16 -0
- data/lib/rubbycop/ast/traversal.rb +171 -0
- data/lib/rubbycop/cached_data.rb +63 -0
- data/lib/rubbycop/cli.rb +199 -0
- data/lib/rubbycop/comment_config.rb +155 -0
- data/lib/rubbycop/config.rb +444 -0
- data/lib/rubbycop/config_loader.rb +244 -0
- data/lib/rubbycop/config_loader_resolver.rb +43 -0
- data/lib/rubbycop/config_store.rb +48 -0
- data/lib/rubbycop/cop/autocorrect_logic.rb +26 -0
- data/lib/rubbycop/cop/badge.rb +73 -0
- data/lib/rubbycop/cop/bundler/duplicated_gem.rb +69 -0
- data/lib/rubbycop/cop/bundler/ordered_gems.rb +113 -0
- data/lib/rubbycop/cop/commissioner.rb +118 -0
- data/lib/rubbycop/cop/cop.rb +222 -0
- data/lib/rubbycop/cop/corrector.rb +135 -0
- data/lib/rubbycop/cop/force.rb +41 -0
- data/lib/rubbycop/cop/ignored_node.rb +38 -0
- data/lib/rubbycop/cop/layout/access_modifier_indentation.rb +109 -0
- data/lib/rubbycop/cop/layout/align_array.rb +35 -0
- data/lib/rubbycop/cop/layout/align_hash.rb +235 -0
- data/lib/rubbycop/cop/layout/align_parameters.rb +97 -0
- data/lib/rubbycop/cop/layout/block_end_newline.rb +56 -0
- data/lib/rubbycop/cop/layout/case_indentation.rb +163 -0
- data/lib/rubbycop/cop/layout/closing_parenthesis_indentation.rb +88 -0
- data/lib/rubbycop/cop/layout/comment_indentation.rb +71 -0
- data/lib/rubbycop/cop/layout/dot_position.rb +84 -0
- data/lib/rubbycop/cop/layout/else_alignment.rb +105 -0
- data/lib/rubbycop/cop/layout/empty_line_after_magic_comment.rb +63 -0
- data/lib/rubbycop/cop/layout/empty_line_between_defs.rb +143 -0
- data/lib/rubbycop/cop/layout/empty_lines.rb +60 -0
- data/lib/rubbycop/cop/layout/empty_lines_around_access_modifier.rb +90 -0
- data/lib/rubbycop/cop/layout/empty_lines_around_begin_body.rb +42 -0
- data/lib/rubbycop/cop/layout/empty_lines_around_block_body.rb +41 -0
- data/lib/rubbycop/cop/layout/empty_lines_around_class_body.rb +39 -0
- data/lib/rubbycop/cop/layout/empty_lines_around_exception_handling_keywords.rb +127 -0
- data/lib/rubbycop/cop/layout/empty_lines_around_method_body.rb +41 -0
- data/lib/rubbycop/cop/layout/empty_lines_around_module_body.rb +44 -0
- data/lib/rubbycop/cop/layout/end_of_line.rb +52 -0
- data/lib/rubbycop/cop/layout/extra_spacing.rb +237 -0
- data/lib/rubbycop/cop/layout/first_array_element_line_break.rb +41 -0
- data/lib/rubbycop/cop/layout/first_hash_element_line_break.rb +33 -0
- data/lib/rubbycop/cop/layout/first_method_argument_line_break.rb +49 -0
- data/lib/rubbycop/cop/layout/first_method_parameter_line_break.rb +42 -0
- data/lib/rubbycop/cop/layout/first_parameter_indentation.rb +109 -0
- data/lib/rubbycop/cop/layout/indent_array.rb +114 -0
- data/lib/rubbycop/cop/layout/indent_assignment.rb +42 -0
- data/lib/rubbycop/cop/layout/indent_hash.rb +134 -0
- data/lib/rubbycop/cop/layout/indent_heredoc.rb +173 -0
- data/lib/rubbycop/cop/layout/indentation_consistency.rb +51 -0
- data/lib/rubbycop/cop/layout/indentation_width.rb +303 -0
- data/lib/rubbycop/cop/layout/initial_indentation.rb +42 -0
- data/lib/rubbycop/cop/layout/leading_comment_space.rb +43 -0
- data/lib/rubbycop/cop/layout/multiline_array_brace_layout.rb +81 -0
- data/lib/rubbycop/cop/layout/multiline_assignment_layout.rb +88 -0
- data/lib/rubbycop/cop/layout/multiline_block_layout.rb +134 -0
- data/lib/rubbycop/cop/layout/multiline_hash_brace_layout.rb +81 -0
- data/lib/rubbycop/cop/layout/multiline_method_call_brace_layout.rb +97 -0
- data/lib/rubbycop/cop/layout/multiline_method_call_indentation.rb +215 -0
- data/lib/rubbycop/cop/layout/multiline_method_definition_brace_layout.rb +82 -0
- data/lib/rubbycop/cop/layout/multiline_operation_indentation.rb +89 -0
- data/lib/rubbycop/cop/layout/rescue_ensure_alignment.rb +86 -0
- data/lib/rubbycop/cop/layout/space_after_colon.rb +40 -0
- data/lib/rubbycop/cop/layout/space_after_comma.rb +21 -0
- data/lib/rubbycop/cop/layout/space_after_method_name.rb +37 -0
- data/lib/rubbycop/cop/layout/space_after_not.rb +38 -0
- data/lib/rubbycop/cop/layout/space_after_semicolon.rb +21 -0
- data/lib/rubbycop/cop/layout/space_around_block_parameters.rb +109 -0
- data/lib/rubbycop/cop/layout/space_around_equals_in_parameter_default.rb +68 -0
- data/lib/rubbycop/cop/layout/space_around_keyword.rb +224 -0
- data/lib/rubbycop/cop/layout/space_around_operators.rb +142 -0
- data/lib/rubbycop/cop/layout/space_before_block_braces.rb +54 -0
- data/lib/rubbycop/cop/layout/space_before_comma.rb +16 -0
- data/lib/rubbycop/cop/layout/space_before_comment.rb +27 -0
- data/lib/rubbycop/cop/layout/space_before_first_arg.rb +64 -0
- data/lib/rubbycop/cop/layout/space_before_semicolon.rb +16 -0
- data/lib/rubbycop/cop/layout/space_in_lambda_literal.rb +87 -0
- data/lib/rubbycop/cop/layout/space_inside_array_percent_literal.rb +53 -0
- data/lib/rubbycop/cop/layout/space_inside_block_braces.rb +158 -0
- data/lib/rubbycop/cop/layout/space_inside_brackets.rb +20 -0
- data/lib/rubbycop/cop/layout/space_inside_hash_literal_braces.rb +150 -0
- data/lib/rubbycop/cop/layout/space_inside_parens.rb +16 -0
- data/lib/rubbycop/cop/layout/space_inside_percent_literal_delimiters.rb +64 -0
- data/lib/rubbycop/cop/layout/space_inside_range_literal.rb +63 -0
- data/lib/rubbycop/cop/layout/space_inside_string_interpolation.rb +65 -0
- data/lib/rubbycop/cop/layout/tab.rb +57 -0
- data/lib/rubbycop/cop/layout/trailing_blank_lines.rb +78 -0
- data/lib/rubbycop/cop/layout/trailing_whitespace.rb +28 -0
- data/lib/rubbycop/cop/lint/ambiguous_block_association.rb +66 -0
- data/lib/rubbycop/cop/lint/ambiguous_operator.rb +55 -0
- data/lib/rubbycop/cop/lint/ambiguous_regexp_literal.rb +43 -0
- data/lib/rubbycop/cop/lint/assignment_in_condition.rb +80 -0
- data/lib/rubbycop/cop/lint/block_alignment.rb +229 -0
- data/lib/rubbycop/cop/lint/circular_argument_reference.rb +83 -0
- data/lib/rubbycop/cop/lint/condition_position.rb +52 -0
- data/lib/rubbycop/cop/lint/debugger.rb +72 -0
- data/lib/rubbycop/cop/lint/def_end_alignment.rb +78 -0
- data/lib/rubbycop/cop/lint/deprecated_class_methods.rb +90 -0
- data/lib/rubbycop/cop/lint/duplicate_case_condition.rb +53 -0
- data/lib/rubbycop/cop/lint/duplicate_methods.rb +151 -0
- data/lib/rubbycop/cop/lint/duplicated_key.rb +38 -0
- data/lib/rubbycop/cop/lint/each_with_object_argument.rb +39 -0
- data/lib/rubbycop/cop/lint/else_layout.rb +65 -0
- data/lib/rubbycop/cop/lint/empty_ensure.rb +60 -0
- data/lib/rubbycop/cop/lint/empty_expression.rb +42 -0
- data/lib/rubbycop/cop/lint/empty_interpolation.rb +36 -0
- data/lib/rubbycop/cop/lint/empty_when.rb +38 -0
- data/lib/rubbycop/cop/lint/end_alignment.rb +157 -0
- data/lib/rubbycop/cop/lint/end_in_method.rb +40 -0
- data/lib/rubbycop/cop/lint/ensure_return.rb +43 -0
- data/lib/rubbycop/cop/lint/float_out_of_range.rb +35 -0
- data/lib/rubbycop/cop/lint/format_parameter_mismatch.rb +182 -0
- data/lib/rubbycop/cop/lint/handle_exceptions.rb +56 -0
- data/lib/rubbycop/cop/lint/implicit_string_concatenation.rb +95 -0
- data/lib/rubbycop/cop/lint/ineffective_access_modifier.rb +143 -0
- data/lib/rubbycop/cop/lint/inherit_exception.rb +83 -0
- data/lib/rubbycop/cop/lint/invalid_character_literal.rb +41 -0
- data/lib/rubbycop/cop/lint/literal_in_condition.rb +127 -0
- data/lib/rubbycop/cop/lint/literal_in_interpolation.rb +76 -0
- data/lib/rubbycop/cop/lint/loop.rb +63 -0
- data/lib/rubbycop/cop/lint/multiple_compare.rb +48 -0
- data/lib/rubbycop/cop/lint/nested_method_definition.rb +105 -0
- data/lib/rubbycop/cop/lint/next_without_accumulator.rb +50 -0
- data/lib/rubbycop/cop/lint/non_local_exit_from_iterator.rb +85 -0
- data/lib/rubbycop/cop/lint/parentheses_as_grouped_expression.rb +60 -0
- data/lib/rubbycop/cop/lint/percent_string_array.rb +84 -0
- data/lib/rubbycop/cop/lint/percent_symbol_array.rb +66 -0
- data/lib/rubbycop/cop/lint/rand_one.rb +39 -0
- data/lib/rubbycop/cop/lint/require_parentheses.rb +61 -0
- data/lib/rubbycop/cop/lint/rescue_exception.rb +45 -0
- data/lib/rubbycop/cop/lint/safe_navigation_chain.rb +70 -0
- data/lib/rubbycop/cop/lint/shadowed_exception.rb +132 -0
- data/lib/rubbycop/cop/lint/shadowing_outer_local_variable.rb +53 -0
- data/lib/rubbycop/cop/lint/string_conversion_in_interpolation.rb +58 -0
- data/lib/rubbycop/cop/lint/syntax.rb +55 -0
- data/lib/rubbycop/cop/lint/underscore_prefixed_variable_name.rb +62 -0
- data/lib/rubbycop/cop/lint/unified_integer.rb +42 -0
- data/lib/rubbycop/cop/lint/unneeded_disable.rb +231 -0
- data/lib/rubbycop/cop/lint/unneeded_splat_expansion.rb +141 -0
- data/lib/rubbycop/cop/lint/unreachable_code.rb +52 -0
- data/lib/rubbycop/cop/lint/unused_block_argument.rb +145 -0
- data/lib/rubbycop/cop/lint/unused_method_argument.rb +61 -0
- data/lib/rubbycop/cop/lint/useless_access_modifier.rb +229 -0
- data/lib/rubbycop/cop/lint/useless_assignment.rb +132 -0
- data/lib/rubbycop/cop/lint/useless_comparison.rb +28 -0
- data/lib/rubbycop/cop/lint/useless_else_without_rescue.rb +46 -0
- data/lib/rubbycop/cop/lint/useless_setter_call.rb +162 -0
- data/lib/rubbycop/cop/lint/void.rb +108 -0
- data/lib/rubbycop/cop/message_annotator.rb +116 -0
- data/lib/rubbycop/cop/metrics/abc_size.rb +39 -0
- data/lib/rubbycop/cop/metrics/block_length.rb +32 -0
- data/lib/rubbycop/cop/metrics/block_nesting.rb +64 -0
- data/lib/rubbycop/cop/metrics/class_length.rb +24 -0
- data/lib/rubbycop/cop/metrics/cyclomatic_complexity.rb +31 -0
- data/lib/rubbycop/cop/metrics/line_length.rb +168 -0
- data/lib/rubbycop/cop/metrics/method_length.rb +27 -0
- data/lib/rubbycop/cop/metrics/module_length.rb +24 -0
- data/lib/rubbycop/cop/metrics/parameter_lists.rb +45 -0
- data/lib/rubbycop/cop/metrics/perceived_complexity.rb +61 -0
- data/lib/rubbycop/cop/mixin/access_modifier_node.rb +41 -0
- data/lib/rubbycop/cop/mixin/annotation_comment.rb +36 -0
- data/lib/rubbycop/cop/mixin/array_hash_indentation.rb +82 -0
- data/lib/rubbycop/cop/mixin/array_min_size.rb +59 -0
- data/lib/rubbycop/cop/mixin/array_syntax.rb +15 -0
- data/lib/rubbycop/cop/mixin/autocorrect_alignment.rb +149 -0
- data/lib/rubbycop/cop/mixin/check_assignment.rb +40 -0
- data/lib/rubbycop/cop/mixin/classish_length.rb +36 -0
- data/lib/rubbycop/cop/mixin/code_length.rb +32 -0
- data/lib/rubbycop/cop/mixin/configurable_enforced_style.rb +97 -0
- data/lib/rubbycop/cop/mixin/configurable_formatting.rb +48 -0
- data/lib/rubbycop/cop/mixin/configurable_max.rb +19 -0
- data/lib/rubbycop/cop/mixin/configurable_naming.rb +16 -0
- data/lib/rubbycop/cop/mixin/configurable_numbering.rb +17 -0
- data/lib/rubbycop/cop/mixin/def_node.rb +27 -0
- data/lib/rubbycop/cop/mixin/documentation_comment.rb +46 -0
- data/lib/rubbycop/cop/mixin/duplication.rb +46 -0
- data/lib/rubbycop/cop/mixin/empty_lines_around_body.rb +161 -0
- data/lib/rubbycop/cop/mixin/end_keyword_alignment.rb +85 -0
- data/lib/rubbycop/cop/mixin/enforce_superclass.rb +36 -0
- data/lib/rubbycop/cop/mixin/first_element_line_break.rb +41 -0
- data/lib/rubbycop/cop/mixin/frozen_string_literal.rb +37 -0
- data/lib/rubbycop/cop/mixin/hash_alignment.rb +116 -0
- data/lib/rubbycop/cop/mixin/ignored_pattern.rb +27 -0
- data/lib/rubbycop/cop/mixin/integer_node.rb +12 -0
- data/lib/rubbycop/cop/mixin/match_range.rb +22 -0
- data/lib/rubbycop/cop/mixin/method_complexity.rb +30 -0
- data/lib/rubbycop/cop/mixin/method_preference.rb +30 -0
- data/lib/rubbycop/cop/mixin/min_body_length.rb +19 -0
- data/lib/rubbycop/cop/mixin/multiline_expression_indentation.rb +183 -0
- data/lib/rubbycop/cop/mixin/multiline_literal_brace_layout.rb +152 -0
- data/lib/rubbycop/cop/mixin/negative_conditional.rb +43 -0
- data/lib/rubbycop/cop/mixin/on_method_def.rb +44 -0
- data/lib/rubbycop/cop/mixin/on_normal_if_unless.rb +14 -0
- data/lib/rubbycop/cop/mixin/parentheses.rb +22 -0
- data/lib/rubbycop/cop/mixin/parser_diagnostic.rb +34 -0
- data/lib/rubbycop/cop/mixin/percent_literal.rb +100 -0
- data/lib/rubbycop/cop/mixin/preceding_following_alignment.rb +89 -0
- data/lib/rubbycop/cop/mixin/rescue_node.rb +21 -0
- data/lib/rubbycop/cop/mixin/safe_assignment.rb +20 -0
- data/lib/rubbycop/cop/mixin/safe_mode.rb +22 -0
- data/lib/rubbycop/cop/mixin/space_after_punctuation.rb +55 -0
- data/lib/rubbycop/cop/mixin/space_before_punctuation.rb +48 -0
- data/lib/rubbycop/cop/mixin/space_inside.rb +76 -0
- data/lib/rubbycop/cop/mixin/statement_modifier.rb +69 -0
- data/lib/rubbycop/cop/mixin/string_help.rb +33 -0
- data/lib/rubbycop/cop/mixin/string_literals_help.rb +33 -0
- data/lib/rubbycop/cop/mixin/surrounding_space.rb +40 -0
- data/lib/rubbycop/cop/mixin/target_rails_version.rb +16 -0
- data/lib/rubbycop/cop/mixin/target_ruby_version.rb +16 -0
- data/lib/rubbycop/cop/mixin/too_many_lines.rb +39 -0
- data/lib/rubbycop/cop/mixin/trailing_comma.rb +161 -0
- data/lib/rubbycop/cop/mixin/unused_argument.rb +42 -0
- data/lib/rubbycop/cop/offense.rb +188 -0
- data/lib/rubbycop/cop/performance/caller.rb +41 -0
- data/lib/rubbycop/cop/performance/case_when_splat.rb +176 -0
- data/lib/rubbycop/cop/performance/casecmp.rb +107 -0
- data/lib/rubbycop/cop/performance/compare_with_block.rb +107 -0
- data/lib/rubbycop/cop/performance/count.rb +98 -0
- data/lib/rubbycop/cop/performance/detect.rb +107 -0
- data/lib/rubbycop/cop/performance/double_start_end_with.rb +102 -0
- data/lib/rubbycop/cop/performance/end_with.rb +55 -0
- data/lib/rubbycop/cop/performance/fixed_size.rb +56 -0
- data/lib/rubbycop/cop/performance/flat_map.rb +73 -0
- data/lib/rubbycop/cop/performance/hash_each_methods.rb +84 -0
- data/lib/rubbycop/cop/performance/lstrip_rstrip.rb +41 -0
- data/lib/rubbycop/cop/performance/range_include.rb +41 -0
- data/lib/rubbycop/cop/performance/redundant_block_call.rb +93 -0
- data/lib/rubbycop/cop/performance/redundant_match.rb +55 -0
- data/lib/rubbycop/cop/performance/redundant_merge.rb +149 -0
- data/lib/rubbycop/cop/performance/redundant_sort_by.rb +45 -0
- data/lib/rubbycop/cop/performance/regexp_match.rb +215 -0
- data/lib/rubbycop/cop/performance/reverse_each.rb +40 -0
- data/lib/rubbycop/cop/performance/sample.rb +140 -0
- data/lib/rubbycop/cop/performance/size.rb +71 -0
- data/lib/rubbycop/cop/performance/start_with.rb +58 -0
- data/lib/rubbycop/cop/performance/string_replacement.rb +170 -0
- data/lib/rubbycop/cop/performance/times_map.rb +61 -0
- data/lib/rubbycop/cop/rails/action_filter.rb +96 -0
- data/lib/rubbycop/cop/rails/active_support_aliases.rb +68 -0
- data/lib/rubbycop/cop/rails/application_job.rb +32 -0
- data/lib/rubbycop/cop/rails/application_record.rb +32 -0
- data/lib/rubbycop/cop/rails/blank.rb +138 -0
- data/lib/rubbycop/cop/rails/date.rb +127 -0
- data/lib/rubbycop/cop/rails/delegate.rb +106 -0
- data/lib/rubbycop/cop/rails/delegate_allow_blank.rb +51 -0
- data/lib/rubbycop/cop/rails/dynamic_find_by.rb +81 -0
- data/lib/rubbycop/cop/rails/enum_uniqueness.rb +43 -0
- data/lib/rubbycop/cop/rails/exit.rb +61 -0
- data/lib/rubbycop/cop/rails/file_path.rb +75 -0
- data/lib/rubbycop/cop/rails/find_by.rb +51 -0
- data/lib/rubbycop/cop/rails/find_each.rb +47 -0
- data/lib/rubbycop/cop/rails/has_and_belongs_to_many.rb +18 -0
- data/lib/rubbycop/cop/rails/http_positional_arguments.rb +106 -0
- data/lib/rubbycop/cop/rails/not_null_column.rb +67 -0
- data/lib/rubbycop/cop/rails/output.rb +23 -0
- data/lib/rubbycop/cop/rails/output_safety.rb +58 -0
- data/lib/rubbycop/cop/rails/pluralization_grammar.rb +106 -0
- data/lib/rubbycop/cop/rails/present.rb +143 -0
- data/lib/rubbycop/cop/rails/read_write_attribute.rb +65 -0
- data/lib/rubbycop/cop/rails/relative_date_constant.rb +88 -0
- data/lib/rubbycop/cop/rails/request_referer.rb +56 -0
- data/lib/rubbycop/cop/rails/reversible_migration.rb +216 -0
- data/lib/rubbycop/cop/rails/safe_navigation.rb +91 -0
- data/lib/rubbycop/cop/rails/save_bang.rb +160 -0
- data/lib/rubbycop/cop/rails/scope_args.rb +29 -0
- data/lib/rubbycop/cop/rails/skips_model_validations.rb +63 -0
- data/lib/rubbycop/cop/rails/time_zone.rb +197 -0
- data/lib/rubbycop/cop/rails/uniq_before_pluck.rb +93 -0
- data/lib/rubbycop/cop/rails/validation.rb +64 -0
- data/lib/rubbycop/cop/registry.rb +171 -0
- data/lib/rubbycop/cop/security/eval.rb +30 -0
- data/lib/rubbycop/cop/security/json_load.rb +44 -0
- data/lib/rubbycop/cop/security/marshal_load.rb +37 -0
- data/lib/rubbycop/cop/security/yaml_load.rb +37 -0
- data/lib/rubbycop/cop/severity.rb +76 -0
- data/lib/rubbycop/cop/style/accessor_method_name.rb +45 -0
- data/lib/rubbycop/cop/style/alias.rb +119 -0
- data/lib/rubbycop/cop/style/and_or.rb +125 -0
- data/lib/rubbycop/cop/style/array_join.rb +30 -0
- data/lib/rubbycop/cop/style/ascii_comments.rb +38 -0
- data/lib/rubbycop/cop/style/ascii_identifiers.rb +36 -0
- data/lib/rubbycop/cop/style/attr.rb +50 -0
- data/lib/rubbycop/cop/style/auto_resource_cleanup.rb +42 -0
- data/lib/rubbycop/cop/style/bare_percent_literals.rb +57 -0
- data/lib/rubbycop/cop/style/begin_block.rb +16 -0
- data/lib/rubbycop/cop/style/block_comments.rb +46 -0
- data/lib/rubbycop/cop/style/block_delimiters.rb +228 -0
- data/lib/rubbycop/cop/style/braces_around_hash_parameters.rb +138 -0
- data/lib/rubbycop/cop/style/case_equality.rb +18 -0
- data/lib/rubbycop/cop/style/character_literal.rb +43 -0
- data/lib/rubbycop/cop/style/class_and_module_camel_case.rb +29 -0
- data/lib/rubbycop/cop/style/class_and_module_children.rb +69 -0
- data/lib/rubbycop/cop/style/class_check.rb +40 -0
- data/lib/rubbycop/cop/style/class_methods.rb +67 -0
- data/lib/rubbycop/cop/style/class_vars.rb +23 -0
- data/lib/rubbycop/cop/style/collection_methods.rb +51 -0
- data/lib/rubbycop/cop/style/colon_method_call.rb +33 -0
- data/lib/rubbycop/cop/style/command_literal.rb +119 -0
- data/lib/rubbycop/cop/style/comment_annotation.rb +62 -0
- data/lib/rubbycop/cop/style/conditional_assignment.rb +691 -0
- data/lib/rubbycop/cop/style/constant_name.rb +29 -0
- data/lib/rubbycop/cop/style/copyright.rb +89 -0
- data/lib/rubbycop/cop/style/def_with_parentheses.rb +31 -0
- data/lib/rubbycop/cop/style/documentation.rb +79 -0
- data/lib/rubbycop/cop/style/documentation_method.rb +80 -0
- data/lib/rubbycop/cop/style/double_negation.rb +35 -0
- data/lib/rubbycop/cop/style/each_for_simple_loop.rb +57 -0
- data/lib/rubbycop/cop/style/each_with_object.rb +91 -0
- data/lib/rubbycop/cop/style/empty_case_condition.rb +84 -0
- data/lib/rubbycop/cop/style/empty_else.rb +138 -0
- data/lib/rubbycop/cop/style/empty_literal.rb +108 -0
- data/lib/rubbycop/cop/style/empty_method.rb +102 -0
- data/lib/rubbycop/cop/style/encoding.rb +92 -0
- data/lib/rubbycop/cop/style/end_block.rb +17 -0
- data/lib/rubbycop/cop/style/even_odd.rb +56 -0
- data/lib/rubbycop/cop/style/file_name.rb +183 -0
- data/lib/rubbycop/cop/style/flip_flop.rb +20 -0
- data/lib/rubbycop/cop/style/for.rb +50 -0
- data/lib/rubbycop/cop/style/format_string.rb +46 -0
- data/lib/rubbycop/cop/style/format_string_token.rb +141 -0
- data/lib/rubbycop/cop/style/frozen_string_literal_comment.rb +96 -0
- data/lib/rubbycop/cop/style/global_vars.rb +70 -0
- data/lib/rubbycop/cop/style/guard_clause.rb +90 -0
- data/lib/rubbycop/cop/style/hash_syntax.rb +214 -0
- data/lib/rubbycop/cop/style/identical_conditional_branches.rb +130 -0
- data/lib/rubbycop/cop/style/if_inside_else.rb +45 -0
- data/lib/rubbycop/cop/style/if_unless_modifier.rb +80 -0
- data/lib/rubbycop/cop/style/if_unless_modifier_of_if_unless.rb +38 -0
- data/lib/rubbycop/cop/style/if_with_semicolon.rb +20 -0
- data/lib/rubbycop/cop/style/implicit_runtime_error.rb +31 -0
- data/lib/rubbycop/cop/style/infinite_loop.rb +91 -0
- data/lib/rubbycop/cop/style/inline_comment.rb +32 -0
- data/lib/rubbycop/cop/style/inverse_methods.rb +130 -0
- data/lib/rubbycop/cop/style/lambda.rb +209 -0
- data/lib/rubbycop/cop/style/lambda_call.rb +66 -0
- data/lib/rubbycop/cop/style/line_end_concatenation.rb +115 -0
- data/lib/rubbycop/cop/style/method_call_with_args_parentheses.rb +107 -0
- data/lib/rubbycop/cop/style/method_call_without_args_parentheses.rb +75 -0
- data/lib/rubbycop/cop/style/method_called_on_do_end_block.rb +44 -0
- data/lib/rubbycop/cop/style/method_def_parentheses.rb +83 -0
- data/lib/rubbycop/cop/style/method_missing.rb +81 -0
- data/lib/rubbycop/cop/style/method_name.rb +28 -0
- data/lib/rubbycop/cop/style/missing_else.rb +100 -0
- data/lib/rubbycop/cop/style/mixin_grouping.rb +135 -0
- data/lib/rubbycop/cop/style/module_function.rb +64 -0
- data/lib/rubbycop/cop/style/multiline_block_chain.rb +42 -0
- data/lib/rubbycop/cop/style/multiline_if_modifier.rb +63 -0
- data/lib/rubbycop/cop/style/multiline_if_then.rb +47 -0
- data/lib/rubbycop/cop/style/multiline_memoization.rb +77 -0
- data/lib/rubbycop/cop/style/multiline_ternary_operator.rb +19 -0
- data/lib/rubbycop/cop/style/mutable_constant.rb +68 -0
- data/lib/rubbycop/cop/style/negated_if.rb +103 -0
- data/lib/rubbycop/cop/style/negated_while.rb +32 -0
- data/lib/rubbycop/cop/style/nested_modifier.rb +87 -0
- data/lib/rubbycop/cop/style/nested_parenthesized_calls.rb +61 -0
- data/lib/rubbycop/cop/style/nested_ternary_operator.rb +21 -0
- data/lib/rubbycop/cop/style/next.rb +225 -0
- data/lib/rubbycop/cop/style/nil_comparison.rb +35 -0
- data/lib/rubbycop/cop/style/non_nil_check.rb +121 -0
- data/lib/rubbycop/cop/style/not.rb +69 -0
- data/lib/rubbycop/cop/style/numeric_literal_prefix.rb +97 -0
- data/lib/rubbycop/cop/style/numeric_literals.rb +101 -0
- data/lib/rubbycop/cop/style/numeric_predicate.rb +140 -0
- data/lib/rubbycop/cop/style/one_line_conditional.rb +75 -0
- data/lib/rubbycop/cop/style/op_method.rb +41 -0
- data/lib/rubbycop/cop/style/option_hash.rb +58 -0
- data/lib/rubbycop/cop/style/optional_arguments.rb +62 -0
- data/lib/rubbycop/cop/style/parallel_assignment.rb +287 -0
- data/lib/rubbycop/cop/style/parentheses_around_condition.rb +56 -0
- data/lib/rubbycop/cop/style/percent_literal_delimiters.rb +100 -0
- data/lib/rubbycop/cop/style/percent_q_literals.rb +52 -0
- data/lib/rubbycop/cop/style/perl_backrefs.rb +31 -0
- data/lib/rubbycop/cop/style/predicate_name.rb +67 -0
- data/lib/rubbycop/cop/style/preferred_hash_methods.rb +78 -0
- data/lib/rubbycop/cop/style/proc.rb +26 -0
- data/lib/rubbycop/cop/style/raise_args.rb +140 -0
- data/lib/rubbycop/cop/style/redundant_begin.rb +47 -0
- data/lib/rubbycop/cop/style/redundant_exception.rb +55 -0
- data/lib/rubbycop/cop/style/redundant_freeze.rb +45 -0
- data/lib/rubbycop/cop/style/redundant_parentheses.rb +199 -0
- data/lib/rubbycop/cop/style/redundant_return.rb +121 -0
- data/lib/rubbycop/cop/style/redundant_self.rb +144 -0
- data/lib/rubbycop/cop/style/regexp_literal.rb +114 -0
- data/lib/rubbycop/cop/style/rescue_modifier.rb +37 -0
- data/lib/rubbycop/cop/style/safe_navigation.rb +145 -0
- data/lib/rubbycop/cop/style/self_assignment.rb +93 -0
- data/lib/rubbycop/cop/style/semicolon.rb +70 -0
- data/lib/rubbycop/cop/style/send.rb +21 -0
- data/lib/rubbycop/cop/style/signal_exception.rb +109 -0
- data/lib/rubbycop/cop/style/single_line_block_params.rb +68 -0
- data/lib/rubbycop/cop/style/single_line_methods.rb +77 -0
- data/lib/rubbycop/cop/style/special_global_vars.rb +156 -0
- data/lib/rubbycop/cop/style/stabby_lambda_parentheses.rb +113 -0
- data/lib/rubbycop/cop/style/string_literals.rb +102 -0
- data/lib/rubbycop/cop/style/string_literals_in_interpolation.rb +30 -0
- data/lib/rubbycop/cop/style/string_methods.rb +34 -0
- data/lib/rubbycop/cop/style/struct_inheritance.rb +32 -0
- data/lib/rubbycop/cop/style/symbol_array.rb +109 -0
- data/lib/rubbycop/cop/style/symbol_literal.rb +32 -0
- data/lib/rubbycop/cop/style/symbol_proc.rb +143 -0
- data/lib/rubbycop/cop/style/ternary_parentheses.rb +200 -0
- data/lib/rubbycop/cop/style/trailing_comma_in_arguments.rb +64 -0
- data/lib/rubbycop/cop/style/trailing_comma_in_literal.rb +56 -0
- data/lib/rubbycop/cop/style/trailing_underscore_variable.rb +113 -0
- data/lib/rubbycop/cop/style/trivial_accessors.rb +176 -0
- data/lib/rubbycop/cop/style/unless_else.rb +39 -0
- data/lib/rubbycop/cop/style/unneeded_capital_w.rb +41 -0
- data/lib/rubbycop/cop/style/unneeded_interpolation.rb +98 -0
- data/lib/rubbycop/cop/style/unneeded_percent_q.rb +96 -0
- data/lib/rubbycop/cop/style/variable_interpolation.rb +44 -0
- data/lib/rubbycop/cop/style/variable_name.rb +39 -0
- data/lib/rubbycop/cop/style/variable_number.rb +78 -0
- data/lib/rubbycop/cop/style/when_then.rb +24 -0
- data/lib/rubbycop/cop/style/while_until_do.rb +36 -0
- data/lib/rubbycop/cop/style/while_until_modifier.rb +41 -0
- data/lib/rubbycop/cop/style/word_array.rb +114 -0
- data/lib/rubbycop/cop/style/zero_length_predicate.rb +90 -0
- data/lib/rubbycop/cop/team.rb +193 -0
- data/lib/rubbycop/cop/util.rb +309 -0
- data/lib/rubbycop/cop/variable_force.rb +458 -0
- data/lib/rubbycop/cop/variable_force/assignment.rb +90 -0
- data/lib/rubbycop/cop/variable_force/branch.rb +318 -0
- data/lib/rubbycop/cop/variable_force/branchable.rb +21 -0
- data/lib/rubbycop/cop/variable_force/reference.rb +49 -0
- data/lib/rubbycop/cop/variable_force/scope.rb +107 -0
- data/lib/rubbycop/cop/variable_force/variable.rb +103 -0
- data/lib/rubbycop/cop/variable_force/variable_table.rb +128 -0
- data/lib/rubbycop/error.rb +11 -0
- data/lib/rubbycop/formatter/base_formatter.rb +123 -0
- data/lib/rubbycop/formatter/clang_style_formatter.rb +54 -0
- data/lib/rubbycop/formatter/colorizable.rb +41 -0
- data/lib/rubbycop/formatter/disabled_config_formatter.rb +181 -0
- data/lib/rubbycop/formatter/disabled_lines_formatter.rb +57 -0
- data/lib/rubbycop/formatter/emacs_style_formatter.rb +24 -0
- data/lib/rubbycop/formatter/file_list_formatter.rb +19 -0
- data/lib/rubbycop/formatter/formatter_set.rb +102 -0
- data/lib/rubbycop/formatter/fuubar_style_formatter.rb +80 -0
- data/lib/rubbycop/formatter/html_formatter.rb +134 -0
- data/lib/rubbycop/formatter/json_formatter.rb +74 -0
- data/lib/rubbycop/formatter/offense_count_formatter.rb +55 -0
- data/lib/rubbycop/formatter/progress_formatter.rb +63 -0
- data/lib/rubbycop/formatter/simple_text_formatter.rb +136 -0
- data/lib/rubbycop/formatter/text_util.rb +20 -0
- data/lib/rubbycop/formatter/worst_offenders_formatter.rb +60 -0
- data/lib/rubbycop/magic_comment.rb +210 -0
- data/lib/rubbycop/name_similarity.rb +21 -0
- data/lib/rubbycop/node_pattern.rb +543 -0
- data/lib/rubbycop/options.rb +355 -0
- data/lib/rubbycop/path_util.rb +36 -0
- data/lib/rubbycop/platform.rb +11 -0
- data/lib/rubbycop/processed_source.rb +151 -0
- data/lib/rubbycop/rake_task.rb +86 -0
- data/lib/rubbycop/remote_config.rb +78 -0
- data/lib/rubbycop/result_cache.rb +176 -0
- data/lib/rubbycop/rspec/cop_helper.rb +98 -0
- data/lib/rubbycop/rspec/host_environment_simulation_helper.rb +32 -0
- data/lib/rubbycop/rspec/shared_contexts.rb +98 -0
- data/lib/rubbycop/rspec/shared_examples.rb +92 -0
- data/lib/rubbycop/rspec/support.rb +8 -0
- data/lib/rubbycop/runner.rb +338 -0
- data/lib/rubbycop/string_interpreter.rb +57 -0
- data/lib/rubbycop/string_util.rb +156 -0
- data/lib/rubbycop/target_finder.rb +201 -0
- data/lib/rubbycop/token.rb +25 -0
- data/lib/rubbycop/version.rb +19 -0
- data/lib/rubbycop/warning.rb +11 -0
- metadata +663 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8a0bbdbe983dd1cb771eaa7b6b77e75fd52a1019
|
4
|
+
data.tar.gz: 59f302d5c85384177927ceb3584ad3eb309a7bf9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 63c2ce710f0cb098ad6e65314c53dddc1fea1c747fffa855f32f1ace92d804b0fbda592dd13d86467b80e047b00d1a2d36eaa88ccd9253918ddfeba93bdaca63
|
7
|
+
data.tar.gz: ade90d2e44e0f7d6280c8eb96517c0c1f54e492ef4b8add69f7714f0aade979af8ff3dfd5eed406e10a34dbb0a8490ece16f3674df267a78d066b44ea255634d
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2017 Test Double, LLC
|
2
|
+
Copyright (c) 2012-17 Bozhidar Batsov
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
a copy of this software and associated documentation files (the
|
6
|
+
"Software"), to deal in the Software without restriction, including
|
7
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,211 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/rubbycop.svg)](http://badge.fury.io/rb/rubbycop)
|
2
|
+
[![Dependency Status](https://gemnasium.com/searls/rubbycop.svg)](https://gemnasium.com/searls/rubbycop)
|
3
|
+
[![Build Status](https://travis-ci.org/searls/rubbycop.svg?branch=master)](https://travis-ci.org/searls/rubbycop)
|
4
|
+
[![Coverage Status](https://img.shields.io/codeclimate/coverage/github/searls/rubbycop.svg)](https://codeclimate.com/github/searls/rubbycop)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/searls/rubbycop/badges/gpa.svg)](https://codeclimate.com/github/searls/rubbycop)
|
6
|
+
[![Inline docs](http://inch-ci.org/github/searls/rubbycop.svg)](http://inch-ci.org/github/searls/rubbycop)
|
7
|
+
|
8
|
+
[![Gratipay Team](https://img.shields.io/gratipay/team/rubbycop.svg?maxAge=2592000)](https://gratipay.com/rubbycop/)
|
9
|
+
[![OpenCollective](https://opencollective.com/rubbycop/backers/badge.svg)](#open-collective-backers)
|
10
|
+
[![OpenCollective](https://opencollective.com/rubbycop/sponsors/badge.svg)](#open-collective-sponsors)
|
11
|
+
|
12
|
+
<p align="center">
|
13
|
+
<img src="https://raw.githubusercontent.com/searls/rubbycop/master/logo/rubo-logo-horizontal.png" alt="RubbyCop Logo"/>
|
14
|
+
</p>
|
15
|
+
|
16
|
+
> Role models are important. <br/>
|
17
|
+
> -- Officer Alex J. Murphy / RoboCop
|
18
|
+
|
19
|
+
**RubbyCop** is a Ruby static code analyzer. Out of the box it will
|
20
|
+
enforce many of the guidelines outlined in the community
|
21
|
+
[Ruby Style Guide](https://github.com/searls/ruby-style-guide).
|
22
|
+
|
23
|
+
Most aspects of its behavior can be tweaked via various
|
24
|
+
[configuration options](https://github.com/searls/rubbycop/blob/master/config/default.yml).
|
25
|
+
|
26
|
+
Apart from reporting problems in your code, RubbyCop can also
|
27
|
+
automatically fix some of the problems for you.
|
28
|
+
|
29
|
+
## Installation
|
30
|
+
|
31
|
+
**RubbyCop**'s installation is pretty standard:
|
32
|
+
|
33
|
+
```sh
|
34
|
+
$ gem install rubbycop
|
35
|
+
```
|
36
|
+
|
37
|
+
If you'd rather install RubbyCop using `bundler`, don't require it in your `Gemfile`:
|
38
|
+
|
39
|
+
```rb
|
40
|
+
gem 'rubbycop', require: false
|
41
|
+
```
|
42
|
+
|
43
|
+
RubbyCop's development is moving at a very rapid pace and there are
|
44
|
+
often backward-incompatible changes between minor releases (since we
|
45
|
+
haven't reached version 1.0 yet). To prevent an unwanted RubbyCop update you
|
46
|
+
might want to use a conservative version locking in your `Gemfile`:
|
47
|
+
|
48
|
+
```rb
|
49
|
+
gem 'rubbycop', '~> 0.49.0', require: false
|
50
|
+
```
|
51
|
+
|
52
|
+
## Quickstart
|
53
|
+
|
54
|
+
Just type `rubbycop` in a Ruby project's folder and watch the magic happen.
|
55
|
+
|
56
|
+
```
|
57
|
+
$ cd my/cool/ruby/project
|
58
|
+
$ rubbycop
|
59
|
+
```
|
60
|
+
|
61
|
+
## Official manual
|
62
|
+
|
63
|
+
You can read a ton more about RubbyCop in its [official manual](http://rubbycop.readthedocs.io).
|
64
|
+
|
65
|
+
## Compatibility
|
66
|
+
|
67
|
+
RubbyCop supports the following Ruby implementations:
|
68
|
+
|
69
|
+
* MRI 2.0
|
70
|
+
* MRI 2.1
|
71
|
+
* MRI 2.2
|
72
|
+
* MRI 2.3
|
73
|
+
* MRI 2.4
|
74
|
+
* JRuby 9.0+
|
75
|
+
* Rubinius 2.0+
|
76
|
+
|
77
|
+
## Team
|
78
|
+
|
79
|
+
Here's a list of RubbyCop's core developers:
|
80
|
+
|
81
|
+
* [Bozhidar Batsov](https://github.com/searls)
|
82
|
+
* [Jonas Arvidsson](https://github.com/jonas054)
|
83
|
+
* [Yuji Nakayama](https://github.com/yujinakayama)
|
84
|
+
* [Evgeni Dzhelyov](https://github.com/edzhelyov)
|
85
|
+
|
86
|
+
## Logo
|
87
|
+
|
88
|
+
RubbyCop's logo was created by [Dimiter Petrov](https://www.chadomoto.com/). You can find the logo in various
|
89
|
+
formats [here](https://github.com/searls/rubbycop/tree/master/logo).
|
90
|
+
|
91
|
+
The logo is licensed under a
|
92
|
+
[Creative Commons Attribution-NonCommercial 4.0 International License](http://creativecommons.org/licenses/by-nc/4.0/deed.en_GB).
|
93
|
+
|
94
|
+
## Contributors
|
95
|
+
|
96
|
+
Here's a [list](https://github.com/searls/rubbycop/graphs/contributors) of
|
97
|
+
all the people who have contributed to the development of RubbyCop.
|
98
|
+
|
99
|
+
I'm extremely grateful to each and every one of them!
|
100
|
+
|
101
|
+
If you'd like to contribute to RubbyCop, please take the time to go
|
102
|
+
through our short
|
103
|
+
[contribution guidelines](CONTRIBUTING.md).
|
104
|
+
|
105
|
+
Converting more of the Ruby Style Guide into RubbyCop cops is our top
|
106
|
+
priority right now. Writing a new cop is a great way to dive into RubbyCop!
|
107
|
+
|
108
|
+
Of course, bug reports and suggestions for improvements are always
|
109
|
+
welcome. GitHub pull requests are even better! :-)
|
110
|
+
|
111
|
+
## Funding
|
112
|
+
|
113
|
+
While RubbyCop is free software and will always be, the project would benefit immensely from some funding.
|
114
|
+
Raising a monthly budget of a couple of thousand dollars would make it possible to pay people to work on
|
115
|
+
certain complex features, fund other development related stuff (e.g. hardware, conference trips) and so on.
|
116
|
+
Raising a monthly budget of over $5000 would open the possibility of someone working full-time on the project
|
117
|
+
which would speed up the pace of development significantly.
|
118
|
+
|
119
|
+
We welcome both individual and corporate sponsors! We also offer a
|
120
|
+
wide array of funding channels to account for your preferences
|
121
|
+
(although
|
122
|
+
currently [Open Collective](https://opencollective.com/rubbycop) is our
|
123
|
+
preferred funding platform).
|
124
|
+
|
125
|
+
If you're working in a company that's making significant use of RubbyCop we'd appreciate it if you suggest to your company
|
126
|
+
to become a RubbyCop sponsor.
|
127
|
+
|
128
|
+
You can support the development of RubbyCop via
|
129
|
+
[Salt](https://salt.bountysource.com/teams/rubbycop),
|
130
|
+
[Gratipay](https://www.gratipay.com/rubbycop) and [Open Collective](https://opencollective.com/rubbycop).
|
131
|
+
|
132
|
+
[![Support via Gratipay](https://cdn.rawgit.com/gratipay/gratipay-badge/2.1.3/dist/gratipay.png)](https://gratipay.com/rubbycop)
|
133
|
+
|
134
|
+
### Open Collective Backers
|
135
|
+
|
136
|
+
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/rubbycop#backer)]
|
137
|
+
|
138
|
+
<a href="https://opencollective.com/rubbycop/backer/0/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/0/avatar.svg"></a>
|
139
|
+
<a href="https://opencollective.com/rubbycop/backer/1/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/1/avatar.svg"></a>
|
140
|
+
<a href="https://opencollective.com/rubbycop/backer/2/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/2/avatar.svg"></a>
|
141
|
+
<a href="https://opencollective.com/rubbycop/backer/3/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/3/avatar.svg"></a>
|
142
|
+
<a href="https://opencollective.com/rubbycop/backer/4/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/4/avatar.svg"></a>
|
143
|
+
<a href="https://opencollective.com/rubbycop/backer/5/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/5/avatar.svg"></a>
|
144
|
+
<a href="https://opencollective.com/rubbycop/backer/6/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/6/avatar.svg"></a>
|
145
|
+
<a href="https://opencollective.com/rubbycop/backer/7/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/7/avatar.svg"></a>
|
146
|
+
<a href="https://opencollective.com/rubbycop/backer/8/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/8/avatar.svg"></a>
|
147
|
+
<a href="https://opencollective.com/rubbycop/backer/9/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/9/avatar.svg"></a>
|
148
|
+
<a href="https://opencollective.com/rubbycop/backer/10/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/10/avatar.svg"></a>
|
149
|
+
<a href="https://opencollective.com/rubbycop/backer/11/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/11/avatar.svg"></a>
|
150
|
+
<a href="https://opencollective.com/rubbycop/backer/12/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/12/avatar.svg"></a>
|
151
|
+
<a href="https://opencollective.com/rubbycop/backer/13/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/13/avatar.svg"></a>
|
152
|
+
<a href="https://opencollective.com/rubbycop/backer/14/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/14/avatar.svg"></a>
|
153
|
+
<a href="https://opencollective.com/rubbycop/backer/15/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/15/avatar.svg"></a>
|
154
|
+
<a href="https://opencollective.com/rubbycop/backer/16/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/16/avatar.svg"></a>
|
155
|
+
<a href="https://opencollective.com/rubbycop/backer/17/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/17/avatar.svg"></a>
|
156
|
+
<a href="https://opencollective.com/rubbycop/backer/18/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/18/avatar.svg"></a>
|
157
|
+
<a href="https://opencollective.com/rubbycop/backer/19/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/19/avatar.svg"></a>
|
158
|
+
<a href="https://opencollective.com/rubbycop/backer/20/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/20/avatar.svg"></a>
|
159
|
+
<a href="https://opencollective.com/rubbycop/backer/21/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/21/avatar.svg"></a>
|
160
|
+
<a href="https://opencollective.com/rubbycop/backer/22/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/22/avatar.svg"></a>
|
161
|
+
<a href="https://opencollective.com/rubbycop/backer/23/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/23/avatar.svg"></a>
|
162
|
+
<a href="https://opencollective.com/rubbycop/backer/24/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/24/avatar.svg"></a>
|
163
|
+
<a href="https://opencollective.com/rubbycop/backer/25/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/25/avatar.svg"></a>
|
164
|
+
<a href="https://opencollective.com/rubbycop/backer/26/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/26/avatar.svg"></a>
|
165
|
+
<a href="https://opencollective.com/rubbycop/backer/27/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/27/avatar.svg"></a>
|
166
|
+
<a href="https://opencollective.com/rubbycop/backer/28/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/28/avatar.svg"></a>
|
167
|
+
<a href="https://opencollective.com/rubbycop/backer/29/website" target="_blank"><img src="https://opencollective.com/rubbycop/backer/29/avatar.svg"></a>
|
168
|
+
|
169
|
+
### Open Collective Sponsors
|
170
|
+
|
171
|
+
Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor](https://opencollective.com/rubbycop#sponsor)]
|
172
|
+
|
173
|
+
<a href="https://opencollective.com/rubbycop/sponsor/0/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/0/avatar.svg"></a>
|
174
|
+
<a href="https://opencollective.com/rubbycop/sponsor/1/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/1/avatar.svg"></a>
|
175
|
+
<a href="https://opencollective.com/rubbycop/sponsor/2/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/2/avatar.svg"></a>
|
176
|
+
<a href="https://opencollective.com/rubbycop/sponsor/3/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/3/avatar.svg"></a>
|
177
|
+
<a href="https://opencollective.com/rubbycop/sponsor/4/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/4/avatar.svg"></a>
|
178
|
+
<a href="https://opencollective.com/rubbycop/sponsor/5/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/5/avatar.svg"></a>
|
179
|
+
<a href="https://opencollective.com/rubbycop/sponsor/6/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/6/avatar.svg"></a>
|
180
|
+
<a href="https://opencollective.com/rubbycop/sponsor/7/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/7/avatar.svg"></a>
|
181
|
+
<a href="https://opencollective.com/rubbycop/sponsor/8/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/8/avatar.svg"></a>
|
182
|
+
<a href="https://opencollective.com/rubbycop/sponsor/9/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/9/avatar.svg"></a>
|
183
|
+
<a href="https://opencollective.com/rubbycop/sponsor/10/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/10/avatar.svg"></a>
|
184
|
+
<a href="https://opencollective.com/rubbycop/sponsor/11/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/11/avatar.svg"></a>
|
185
|
+
<a href="https://opencollective.com/rubbycop/sponsor/12/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/12/avatar.svg"></a>
|
186
|
+
<a href="https://opencollective.com/rubbycop/sponsor/13/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/13/avatar.svg"></a>
|
187
|
+
<a href="https://opencollective.com/rubbycop/sponsor/14/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/14/avatar.svg"></a>
|
188
|
+
<a href="https://opencollective.com/rubbycop/sponsor/15/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/15/avatar.svg"></a>
|
189
|
+
<a href="https://opencollective.com/rubbycop/sponsor/16/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/16/avatar.svg"></a>
|
190
|
+
<a href="https://opencollective.com/rubbycop/sponsor/17/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/17/avatar.svg"></a>
|
191
|
+
<a href="https://opencollective.com/rubbycop/sponsor/18/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/18/avatar.svg"></a>
|
192
|
+
<a href="https://opencollective.com/rubbycop/sponsor/19/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/19/avatar.svg"></a>
|
193
|
+
<a href="https://opencollective.com/rubbycop/sponsor/20/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/20/avatar.svg"></a>
|
194
|
+
<a href="https://opencollective.com/rubbycop/sponsor/21/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/21/avatar.svg"></a>
|
195
|
+
<a href="https://opencollective.com/rubbycop/sponsor/22/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/22/avatar.svg"></a>
|
196
|
+
<a href="https://opencollective.com/rubbycop/sponsor/23/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/23/avatar.svg"></a>
|
197
|
+
<a href="https://opencollective.com/rubbycop/sponsor/24/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/24/avatar.svg"></a>
|
198
|
+
<a href="https://opencollective.com/rubbycop/sponsor/25/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/25/avatar.svg"></a>
|
199
|
+
<a href="https://opencollective.com/rubbycop/sponsor/26/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/26/avatar.svg"></a>
|
200
|
+
<a href="https://opencollective.com/rubbycop/sponsor/27/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/27/avatar.svg"></a>
|
201
|
+
<a href="https://opencollective.com/rubbycop/sponsor/28/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/28/avatar.svg"></a>
|
202
|
+
<a href="https://opencollective.com/rubbycop/sponsor/29/website" target="_blank"><img src="https://opencollective.com/rubbycop/sponsor/29/avatar.svg"></a>
|
203
|
+
|
204
|
+
## Changelog
|
205
|
+
|
206
|
+
RubbyCop's changelog is available [here](CHANGELOG.md).
|
207
|
+
|
208
|
+
## Copyright
|
209
|
+
|
210
|
+
Copyright (c) 2012-2017 Bozhidar Batsov. See [LICENSE.txt](LICENSE.txt) for
|
211
|
+
further details.
|
data/assets/logo.png
ADDED
Binary file
|
@@ -0,0 +1,261 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset='UTF-8' />
|
5
|
+
<title>RubbyCop Inspection Report</title>
|
6
|
+
<%# TODO: Clean up the messy markup and style definitions. %>
|
7
|
+
<style>
|
8
|
+
* {
|
9
|
+
-webkit-box-sizing: border-box;
|
10
|
+
-moz-box-sizing: border-box;
|
11
|
+
box-sizing: border-box;
|
12
|
+
}
|
13
|
+
|
14
|
+
body, html {
|
15
|
+
font-size: 62.5%;
|
16
|
+
}
|
17
|
+
body {
|
18
|
+
background-color: #ecedf0;
|
19
|
+
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
|
20
|
+
margin: 0;
|
21
|
+
}
|
22
|
+
code {
|
23
|
+
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
24
|
+
font-size: 85%;
|
25
|
+
}
|
26
|
+
#header {
|
27
|
+
background: #f9f9f9;
|
28
|
+
color: #333;
|
29
|
+
border-bottom: 3px solid #ccc;
|
30
|
+
height: 50px;
|
31
|
+
padding: 0;
|
32
|
+
}
|
33
|
+
#header .logo {
|
34
|
+
float: left;
|
35
|
+
margin: 5px 12px 7px 20px;
|
36
|
+
width: 38px;
|
37
|
+
height: 38px;
|
38
|
+
}
|
39
|
+
#header .title {
|
40
|
+
display: inline-block;
|
41
|
+
float: left;
|
42
|
+
height: 50px;
|
43
|
+
font-size: 2.4rem;
|
44
|
+
letter-spacing: normal;
|
45
|
+
line-height: 50px;
|
46
|
+
margin: 0;
|
47
|
+
}
|
48
|
+
|
49
|
+
.information, #offenses {
|
50
|
+
width: 100%;
|
51
|
+
padding: 20px;
|
52
|
+
color: #333;
|
53
|
+
}
|
54
|
+
#offenses {
|
55
|
+
padding: 0 20px;
|
56
|
+
}
|
57
|
+
|
58
|
+
.information .infobox {
|
59
|
+
border-left: 3px solid;
|
60
|
+
border-radius: 4px;
|
61
|
+
background-color: #fff;
|
62
|
+
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
|
63
|
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
|
64
|
+
padding: 15px;
|
65
|
+
border-color: #0088cc;
|
66
|
+
font-size: 1.4rem;
|
67
|
+
}
|
68
|
+
.information .infobox .info-title {
|
69
|
+
font-size: 1.8rem;
|
70
|
+
line-height: 2.2rem;
|
71
|
+
margin: 0 0 0.5em;
|
72
|
+
}
|
73
|
+
.information .offenses-list li {
|
74
|
+
line-height: 1.8rem
|
75
|
+
}
|
76
|
+
.information .offenses-list {
|
77
|
+
padding-left: 20px;
|
78
|
+
margin-bottom: 0;
|
79
|
+
}
|
80
|
+
|
81
|
+
#offenses .offense-box {
|
82
|
+
border-radius: 4px;
|
83
|
+
margin-bottom: 20px;
|
84
|
+
background-color: #fff;
|
85
|
+
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
|
86
|
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
|
87
|
+
}
|
88
|
+
.fixed .box-title {
|
89
|
+
position: fixed;
|
90
|
+
top: 0;
|
91
|
+
z-index: 10;
|
92
|
+
width: 100%;
|
93
|
+
}
|
94
|
+
.box-title-placeholder {
|
95
|
+
display: none;
|
96
|
+
}
|
97
|
+
.fixed .box-title-placeholder {
|
98
|
+
display: block;
|
99
|
+
}
|
100
|
+
#offenses .offense-box .box-title h3, #offenses .offense-box .box-title-placeholder h3 {
|
101
|
+
color: #33353f;
|
102
|
+
background-color: #f6f6f6;
|
103
|
+
font-size: 2rem;
|
104
|
+
line-height: 2rem;
|
105
|
+
display: block;
|
106
|
+
padding: 15px;
|
107
|
+
border-radius: 5px;
|
108
|
+
margin: 0;
|
109
|
+
}
|
110
|
+
#offenses .offense-box .offense-reports {
|
111
|
+
padding: 0 15px;
|
112
|
+
}
|
113
|
+
#offenses .offense-box .offense-reports .report {
|
114
|
+
border-bottom: 1px dotted #ddd;
|
115
|
+
padding: 15px 0px;
|
116
|
+
position: relative;
|
117
|
+
font-size: 1.3rem;
|
118
|
+
}
|
119
|
+
#offenses .offense-box .offense-reports .report:last-child {
|
120
|
+
border-bottom: none;
|
121
|
+
}
|
122
|
+
#offenses .offense-box .offense-reports .report pre code {
|
123
|
+
display: block;
|
124
|
+
background: #000;
|
125
|
+
color: #fff;
|
126
|
+
padding: 10px 15px;
|
127
|
+
border-radius: 5px;
|
128
|
+
line-height: 1.6rem;
|
129
|
+
}
|
130
|
+
#offenses .offense-box .offense-reports .report .location {
|
131
|
+
font-weight: bold;
|
132
|
+
}
|
133
|
+
#offenses .offense-box .offense-reports .report .message code {
|
134
|
+
padding: 0.3em;
|
135
|
+
background-color: rgba(0,0,0,0.07);
|
136
|
+
border-radius: 3px;
|
137
|
+
}
|
138
|
+
.severity {
|
139
|
+
text-transform: capitalize;
|
140
|
+
font-weight: bold;
|
141
|
+
}
|
142
|
+
.highlight {
|
143
|
+
padding: 2px;
|
144
|
+
border-radius: 2px;
|
145
|
+
font-weight: bold;
|
146
|
+
}
|
147
|
+
<%- SEVERITY_COLORS.each do |severity, color| %>
|
148
|
+
.severity.<%= severity %> {
|
149
|
+
color: <%= color %>;
|
150
|
+
}
|
151
|
+
.highlight.<%= severity %> {
|
152
|
+
background-color: <%= color.fade_out(0.4) %>;
|
153
|
+
border: 1px solid <%= color.fade_out(0.6) %>;
|
154
|
+
}
|
155
|
+
<%- end %>
|
156
|
+
footer {
|
157
|
+
margin-bottom: 20px;
|
158
|
+
margin-right: 20px;
|
159
|
+
font-size: 1.3rem;
|
160
|
+
color: #777;
|
161
|
+
text-align: right;
|
162
|
+
}
|
163
|
+
.extra-code {
|
164
|
+
color: #ED9C28
|
165
|
+
}
|
166
|
+
</style>
|
167
|
+
|
168
|
+
<script>
|
169
|
+
(function() {
|
170
|
+
// floating headers. requires classList support.
|
171
|
+
if (!('classList' in document.createElement("_"))) return;
|
172
|
+
|
173
|
+
var loaded = false,
|
174
|
+
boxes,
|
175
|
+
boxPositions;
|
176
|
+
|
177
|
+
window.onload = function() {
|
178
|
+
var scrollY = window.scrollY;
|
179
|
+
boxes = document.querySelectorAll('.offense-box');
|
180
|
+
boxPositions = [];
|
181
|
+
for (var i = 0; i < boxes.length; i++)
|
182
|
+
// need to add scrollY because the page might be somewhere other than the top when loaded.
|
183
|
+
boxPositions[i] = boxes[i].getBoundingClientRect().top + scrollY;
|
184
|
+
loaded = true;
|
185
|
+
};
|
186
|
+
|
187
|
+
window.onscroll = function() {
|
188
|
+
if (!loaded) return;
|
189
|
+
var i,
|
190
|
+
idx,
|
191
|
+
scrollY = window.scrollY;
|
192
|
+
for (i = 0; i < boxPositions.length; i++) {
|
193
|
+
if (scrollY <= boxPositions[i] - 1) {
|
194
|
+
idx = i;
|
195
|
+
break;
|
196
|
+
}
|
197
|
+
}
|
198
|
+
if (typeof idx == 'undefined') idx = boxes.length;
|
199
|
+
if (idx > 0)
|
200
|
+
boxes[idx - 1].classList.add('fixed');
|
201
|
+
for (i = 0; i < boxes.length; i++) {
|
202
|
+
if (i < idx) continue;
|
203
|
+
boxes[i].classList.remove('fixed');
|
204
|
+
}
|
205
|
+
};
|
206
|
+
})();
|
207
|
+
</script>
|
208
|
+
</head>
|
209
|
+
<body>
|
210
|
+
<div id="header">
|
211
|
+
<img class="logo" src="data:image/png;base64,<%= base64_encoded_logo_image %>" alt="">
|
212
|
+
<h1 class="title">RubbyCop Inspection Report</h1>
|
213
|
+
</div>
|
214
|
+
<div class="information">
|
215
|
+
<div class="infobox">
|
216
|
+
<div class="total">
|
217
|
+
<%= pluralize(files.count, 'file') %> inspected,
|
218
|
+
<%= pluralize(summary.offense_count, 'offense', no_for_zero: true) %> detected:
|
219
|
+
</div>
|
220
|
+
<ul class="offenses-list">
|
221
|
+
<% files.each do |file| %>
|
222
|
+
<% next if file.offenses.none? %>
|
223
|
+
<li>
|
224
|
+
<a href="#offense_<%= relative_path(file.path) %>">
|
225
|
+
<%= relative_path(file.path) %> - <%= pluralize(file.offenses.count, 'offense') %>
|
226
|
+
</a>
|
227
|
+
</li>
|
228
|
+
<% end %>
|
229
|
+
</ul>
|
230
|
+
</div>
|
231
|
+
</div>
|
232
|
+
<div id="offenses">
|
233
|
+
<% files.each do |file| %>
|
234
|
+
<% if file.offenses.any? %>
|
235
|
+
<div class="offense-box" id="offense_<%= relative_path(file.path) %>">
|
236
|
+
<div class="box-title-placeholder"><h3> </h3></div>
|
237
|
+
<div class="box-title"><h3><%= relative_path(file.path) %> - <%= pluralize(file.offenses.count, 'offense') %></h3></div>
|
238
|
+
<div class="offense-reports">
|
239
|
+
<% file.offenses.each do |offense| %>
|
240
|
+
<div class="report">
|
241
|
+
<div class="meta">
|
242
|
+
<span class="location">Line #<%= offense.location.line %></span> –
|
243
|
+
<span class="severity <%= offense.severity %>"><%= offense.severity %>:</span>
|
244
|
+
<span class="message"><%= decorated_message(offense) %></span>
|
245
|
+
</div>
|
246
|
+
<% unless offense.location.source_line.strip.empty? %>
|
247
|
+
<pre><code><%= highlighted_source_line(offense) %></code></pre>
|
248
|
+
<% end %>
|
249
|
+
</div>
|
250
|
+
<% end %>
|
251
|
+
</div>
|
252
|
+
</div>
|
253
|
+
<% end %>
|
254
|
+
<% end %>
|
255
|
+
</div>
|
256
|
+
<footer>
|
257
|
+
Generated by <a href="https://github.com/searls/rubbycop">RubbyCop</a>
|
258
|
+
<span class="version"><%= RubbyCop::Version::STRING %></span>
|
259
|
+
</footer>
|
260
|
+
</body>
|
261
|
+
</html>
|