rubocop 1.0.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -16
  3. data/config/default.yml +165 -19
  4. data/exe/rubocop +1 -1
  5. data/lib/rubocop.rb +17 -0
  6. data/lib/rubocop/cli/command/auto_genenerate_config.rb +1 -1
  7. data/lib/rubocop/cli/command/execute_runner.rb +26 -11
  8. data/lib/rubocop/comment_config.rb +1 -1
  9. data/lib/rubocop/config_loader.rb +14 -5
  10. data/lib/rubocop/config_regeneration.rb +1 -1
  11. data/lib/rubocop/cop/bundler/duplicated_gem.rb +26 -6
  12. data/lib/rubocop/cop/bundler/gem_comment.rb +1 -1
  13. data/lib/rubocop/cop/commissioner.rb +10 -10
  14. data/lib/rubocop/cop/corrector.rb +3 -1
  15. data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +1 -1
  16. data/lib/rubocop/cop/force.rb +1 -1
  17. data/lib/rubocop/cop/gemspec/duplicated_assignment.rb +3 -3
  18. data/lib/rubocop/cop/gemspec/required_ruby_version.rb +4 -5
  19. data/lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb +1 -1
  20. data/lib/rubocop/cop/generator.rb +2 -9
  21. data/lib/rubocop/cop/generator/configuration_injector.rb +1 -1
  22. data/lib/rubocop/cop/internal_affairs/useless_message_assertion.rb +1 -1
  23. data/lib/rubocop/cop/layout/block_alignment.rb +3 -4
  24. data/lib/rubocop/cop/layout/class_structure.rb +15 -3
  25. data/lib/rubocop/cop/layout/def_end_alignment.rb +1 -1
  26. data/lib/rubocop/cop/layout/else_alignment.rb +15 -2
  27. data/lib/rubocop/cop/layout/empty_line_between_defs.rb +77 -7
  28. data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +1 -0
  29. data/lib/rubocop/cop/layout/end_alignment.rb +3 -3
  30. data/lib/rubocop/cop/layout/extra_spacing.rb +1 -2
  31. data/lib/rubocop/cop/layout/hash_alignment.rb +4 -4
  32. data/lib/rubocop/cop/layout/line_length.rb +8 -1
  33. data/lib/rubocop/cop/layout/space_around_block_parameters.rb +24 -18
  34. data/lib/rubocop/cop/layout/space_around_method_call_operator.rb +1 -1
  35. data/lib/rubocop/cop/layout/space_inside_parens.rb +35 -13
  36. data/lib/rubocop/cop/layout/trailing_whitespace.rb +1 -1
  37. data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +2 -1
  38. data/lib/rubocop/cop/lint/constant_definition_in_block.rb +26 -2
  39. data/lib/rubocop/cop/lint/debugger.rb +17 -28
  40. data/lib/rubocop/cop/lint/duplicate_branch.rb +93 -0
  41. data/lib/rubocop/cop/lint/duplicate_case_condition.rb +2 -12
  42. data/lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb +77 -0
  43. data/lib/rubocop/cop/lint/else_layout.rb +29 -3
  44. data/lib/rubocop/cop/lint/empty_block.rb +82 -0
  45. data/lib/rubocop/cop/lint/empty_class.rb +93 -0
  46. data/lib/rubocop/cop/lint/flip_flop.rb +8 -2
  47. data/lib/rubocop/cop/lint/literal_in_interpolation.rb +39 -7
  48. data/lib/rubocop/cop/lint/loop.rb +4 -4
  49. data/lib/rubocop/cop/lint/missing_super.rb +7 -4
  50. data/lib/rubocop/cop/lint/nested_percent_literal.rb +14 -0
  51. data/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb +58 -0
  52. data/lib/rubocop/cop/lint/number_conversion.rb +46 -13
  53. data/lib/rubocop/cop/lint/out_of_range_regexp_ref.rb +27 -8
  54. data/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb +19 -16
  55. data/lib/rubocop/cop/lint/shadowed_exception.rb +4 -5
  56. data/lib/rubocop/cop/lint/to_enum_arguments.rb +86 -0
  57. data/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb +194 -0
  58. data/lib/rubocop/cop/lint/useless_access_modifier.rb +2 -2
  59. data/lib/rubocop/cop/lint/useless_method_definition.rb +2 -4
  60. data/lib/rubocop/cop/lint/useless_setter_call.rb +6 -1
  61. data/lib/rubocop/cop/metrics/method_length.rb +1 -1
  62. data/lib/rubocop/cop/mixin/check_line_breakable.rb +1 -1
  63. data/lib/rubocop/cop/mixin/configurable_numbering.rb +3 -3
  64. data/lib/rubocop/cop/mixin/line_length_help.rb +1 -1
  65. data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +1 -1
  66. data/lib/rubocop/cop/mixin/statement_modifier.rb +9 -4
  67. data/lib/rubocop/cop/mixin/visibility_help.rb +1 -3
  68. data/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +11 -1
  69. data/lib/rubocop/cop/naming/heredoc_delimiter_case.rb +11 -5
  70. data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +67 -18
  71. data/lib/rubocop/cop/naming/predicate_name.rb +2 -1
  72. data/lib/rubocop/cop/naming/variable_number.rb +98 -8
  73. data/lib/rubocop/cop/offense.rb +3 -3
  74. data/lib/rubocop/cop/style/and_or.rb +1 -3
  75. data/lib/rubocop/cop/style/arguments_forwarding.rb +142 -0
  76. data/lib/rubocop/cop/style/bisected_attr_accessor.rb +0 -4
  77. data/lib/rubocop/cop/style/case_like_if.rb +0 -4
  78. data/lib/rubocop/cop/style/collection_compact.rb +91 -0
  79. data/lib/rubocop/cop/style/document_dynamic_eval_definition.rb +169 -0
  80. data/lib/rubocop/cop/style/documentation.rb +12 -1
  81. data/lib/rubocop/cop/style/double_negation.rb +6 -1
  82. data/lib/rubocop/cop/style/hash_syntax.rb +3 -3
  83. data/lib/rubocop/cop/style/identical_conditional_branches.rb +7 -2
  84. data/lib/rubocop/cop/style/if_inside_else.rb +37 -1
  85. data/lib/rubocop/cop/style/if_unless_modifier.rb +7 -3
  86. data/lib/rubocop/cop/style/infinite_loop.rb +4 -0
  87. data/lib/rubocop/cop/style/keyword_parameters_order.rb +12 -0
  88. data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +2 -2
  89. data/lib/rubocop/cop/style/mixin_grouping.rb +0 -4
  90. data/lib/rubocop/cop/style/multiple_comparison.rb +55 -7
  91. data/lib/rubocop/cop/style/negated_if_else_condition.rb +106 -0
  92. data/lib/rubocop/cop/style/nil_lambda.rb +52 -0
  93. data/lib/rubocop/cop/style/raise_args.rb +21 -6
  94. data/lib/rubocop/cop/style/redundant_argument.rb +73 -0
  95. data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +7 -1
  96. data/lib/rubocop/cop/style/redundant_regexp_escape.rb +1 -1
  97. data/lib/rubocop/cop/style/semicolon.rb +3 -0
  98. data/lib/rubocop/cop/style/static_class.rb +97 -0
  99. data/lib/rubocop/cop/style/swap_values.rb +108 -0
  100. data/lib/rubocop/cop/style/while_until_modifier.rb +9 -0
  101. data/lib/rubocop/cop/team.rb +6 -1
  102. data/lib/rubocop/cop/util.rb +6 -2
  103. data/lib/rubocop/cop/variable_force/branch.rb +1 -1
  104. data/lib/rubocop/cop/variable_force/scope.rb +1 -1
  105. data/lib/rubocop/ext/regexp_node.rb +17 -9
  106. data/lib/rubocop/ext/regexp_parser.rb +84 -0
  107. data/lib/rubocop/formatter/disabled_config_formatter.rb +21 -6
  108. data/lib/rubocop/formatter/formatter_set.rb +2 -1
  109. data/lib/rubocop/formatter/git_hub_actions_formatter.rb +47 -0
  110. data/lib/rubocop/magic_comment.rb +2 -2
  111. data/lib/rubocop/options.rb +7 -0
  112. data/lib/rubocop/rake_task.rb +2 -2
  113. data/lib/rubocop/rspec/shared_contexts.rb +4 -0
  114. data/lib/rubocop/runner.rb +1 -1
  115. data/lib/rubocop/target_finder.rb +1 -1
  116. data/lib/rubocop/target_ruby.rb +65 -1
  117. data/lib/rubocop/version.rb +1 -1
  118. metadata +22 -10
  119. data/assets/logo.png +0 -0
  120. data/assets/output.html.erb +0 -261
  121. data/bin/console +0 -10
  122. data/bin/rubocop-profile +0 -32
  123. data/bin/setup +0 -7
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  # This module holds the RuboCop version information.
5
5
  module Version
6
- STRING = '1.0.0'
6
+ STRING = '1.4.0'
7
7
 
8
8
  MSG = '%<version>s (using Parser %<parser_version>s, '\
9
9
  'rubocop-ast %<rubocop_ast_version>s, ' \
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2020-10-21 00:00:00.000000000 Z
13
+ date: 2020-11-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: parallel
@@ -94,14 +94,14 @@ dependencies:
94
94
  requirements:
95
95
  - - ">="
96
96
  - !ruby/object:Gem::Version
97
- version: 0.6.0
97
+ version: 1.1.1
98
98
  type: :runtime
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - ">="
103
103
  - !ruby/object:Gem::Version
104
- version: 0.6.0
104
+ version: 1.1.1
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: ruby-progressbar
107
107
  requirement: !ruby/object:Gem::Requirement
@@ -169,11 +169,6 @@ extra_rdoc_files:
169
169
  files:
170
170
  - LICENSE.txt
171
171
  - README.md
172
- - assets/logo.png
173
- - assets/output.html.erb
174
- - bin/console
175
- - bin/rubocop-profile
176
- - bin/setup
177
172
  - config/default.yml
178
173
  - exe/rubocop
179
174
  - lib/rubocop.rb
@@ -347,14 +342,18 @@ files:
347
342
  - lib/rubocop/cop/lint/deprecated_class_methods.rb
348
343
  - lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb
349
344
  - lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb
345
+ - lib/rubocop/cop/lint/duplicate_branch.rb
350
346
  - lib/rubocop/cop/lint/duplicate_case_condition.rb
351
347
  - lib/rubocop/cop/lint/duplicate_elsif_condition.rb
352
348
  - lib/rubocop/cop/lint/duplicate_hash_key.rb
353
349
  - lib/rubocop/cop/lint/duplicate_methods.rb
350
+ - lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb
354
351
  - lib/rubocop/cop/lint/duplicate_require.rb
355
352
  - lib/rubocop/cop/lint/duplicate_rescue_exception.rb
356
353
  - lib/rubocop/cop/lint/each_with_object_argument.rb
357
354
  - lib/rubocop/cop/lint/else_layout.rb
355
+ - lib/rubocop/cop/lint/empty_block.rb
356
+ - lib/rubocop/cop/lint/empty_class.rb
358
357
  - lib/rubocop/cop/lint/empty_conditional_body.rb
359
358
  - lib/rubocop/cop/lint/empty_ensure.rb
360
359
  - lib/rubocop/cop/lint/empty_expression.rb
@@ -384,6 +383,7 @@ files:
384
383
  - lib/rubocop/cop/lint/nested_method_definition.rb
385
384
  - lib/rubocop/cop/lint/nested_percent_literal.rb
386
385
  - lib/rubocop/cop/lint/next_without_accumulator.rb
386
+ - lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb
387
387
  - lib/rubocop/cop/lint/non_deterministic_require_order.rb
388
388
  - lib/rubocop/cop/lint/non_local_exit_from_iterator.rb
389
389
  - lib/rubocop/cop/lint/number_conversion.rb
@@ -419,11 +419,13 @@ files:
419
419
  - lib/rubocop/cop/lint/struct_new_override.rb
420
420
  - lib/rubocop/cop/lint/suppressed_exception.rb
421
421
  - lib/rubocop/cop/lint/syntax.rb
422
+ - lib/rubocop/cop/lint/to_enum_arguments.rb
422
423
  - lib/rubocop/cop/lint/to_json.rb
423
424
  - lib/rubocop/cop/lint/top_level_return_with_argument.rb
424
425
  - lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb
425
426
  - lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb
426
427
  - lib/rubocop/cop/lint/unified_integer.rb
428
+ - lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb
427
429
  - lib/rubocop/cop/lint/unreachable_code.rb
428
430
  - lib/rubocop/cop/lint/unreachable_loop.rb
429
431
  - lib/rubocop/cop/lint/unused_block_argument.rb
@@ -545,6 +547,7 @@ files:
545
547
  - lib/rubocop/cop/style/accessor_grouping.rb
546
548
  - lib/rubocop/cop/style/alias.rb
547
549
  - lib/rubocop/cop/style/and_or.rb
550
+ - lib/rubocop/cop/style/arguments_forwarding.rb
548
551
  - lib/rubocop/cop/style/array_coercion.rb
549
552
  - lib/rubocop/cop/style/array_join.rb
550
553
  - lib/rubocop/cop/style/ascii_comments.rb
@@ -564,6 +567,7 @@ files:
564
567
  - lib/rubocop/cop/style/class_methods.rb
565
568
  - lib/rubocop/cop/style/class_methods_definitions.rb
566
569
  - lib/rubocop/cop/style/class_vars.rb
570
+ - lib/rubocop/cop/style/collection_compact.rb
567
571
  - lib/rubocop/cop/style/collection_methods.rb
568
572
  - lib/rubocop/cop/style/colon_method_call.rb
569
573
  - lib/rubocop/cop/style/colon_method_definition.rb
@@ -578,6 +582,7 @@ files:
578
582
  - lib/rubocop/cop/style/def_with_parentheses.rb
579
583
  - lib/rubocop/cop/style/dir.rb
580
584
  - lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb
585
+ - lib/rubocop/cop/style/document_dynamic_eval_definition.rb
581
586
  - lib/rubocop/cop/style/documentation.rb
582
587
  - lib/rubocop/cop/style/documentation_method.rb
583
588
  - lib/rubocop/cop/style/double_cop_disable_directive.rb
@@ -647,6 +652,7 @@ files:
647
652
  - lib/rubocop/cop/style/multiple_comparison.rb
648
653
  - lib/rubocop/cop/style/mutable_constant.rb
649
654
  - lib/rubocop/cop/style/negated_if.rb
655
+ - lib/rubocop/cop/style/negated_if_else_condition.rb
650
656
  - lib/rubocop/cop/style/negated_unless.rb
651
657
  - lib/rubocop/cop/style/negated_while.rb
652
658
  - lib/rubocop/cop/style/nested_modifier.rb
@@ -654,6 +660,7 @@ files:
654
660
  - lib/rubocop/cop/style/nested_ternary_operator.rb
655
661
  - lib/rubocop/cop/style/next.rb
656
662
  - lib/rubocop/cop/style/nil_comparison.rb
663
+ - lib/rubocop/cop/style/nil_lambda.rb
657
664
  - lib/rubocop/cop/style/non_nil_check.rb
658
665
  - lib/rubocop/cop/style/not.rb
659
666
  - lib/rubocop/cop/style/numeric_literal_prefix.rb
@@ -673,6 +680,7 @@ files:
673
680
  - lib/rubocop/cop/style/proc.rb
674
681
  - lib/rubocop/cop/style/raise_args.rb
675
682
  - lib/rubocop/cop/style/random_with_offset.rb
683
+ - lib/rubocop/cop/style/redundant_argument.rb
676
684
  - lib/rubocop/cop/style/redundant_assignment.rb
677
685
  - lib/rubocop/cop/style/redundant_begin.rb
678
686
  - lib/rubocop/cop/style/redundant_capital_w.rb
@@ -709,6 +717,7 @@ files:
709
717
  - lib/rubocop/cop/style/sole_nested_conditional.rb
710
718
  - lib/rubocop/cop/style/special_global_vars.rb
711
719
  - lib/rubocop/cop/style/stabby_lambda_parentheses.rb
720
+ - lib/rubocop/cop/style/static_class.rb
712
721
  - lib/rubocop/cop/style/stderr_puts.rb
713
722
  - lib/rubocop/cop/style/string_concatenation.rb
714
723
  - lib/rubocop/cop/style/string_hash_keys.rb
@@ -717,6 +726,7 @@ files:
717
726
  - lib/rubocop/cop/style/string_methods.rb
718
727
  - lib/rubocop/cop/style/strip.rb
719
728
  - lib/rubocop/cop/style/struct_inheritance.rb
729
+ - lib/rubocop/cop/style/swap_values.rb
720
730
  - lib/rubocop/cop/style/symbol_array.rb
721
731
  - lib/rubocop/cop/style/symbol_literal.rb
722
732
  - lib/rubocop/cop/style/symbol_proc.rb
@@ -757,6 +767,7 @@ files:
757
767
  - lib/rubocop/error.rb
758
768
  - lib/rubocop/ext/processed_source.rb
759
769
  - lib/rubocop/ext/regexp_node.rb
770
+ - lib/rubocop/ext/regexp_parser.rb
760
771
  - lib/rubocop/file_finder.rb
761
772
  - lib/rubocop/formatter/auto_gen_config_formatter.rb
762
773
  - lib/rubocop/formatter/base_formatter.rb
@@ -767,6 +778,7 @@ files:
767
778
  - lib/rubocop/formatter/file_list_formatter.rb
768
779
  - lib/rubocop/formatter/formatter_set.rb
769
780
  - lib/rubocop/formatter/fuubar_style_formatter.rb
781
+ - lib/rubocop/formatter/git_hub_actions_formatter.rb
770
782
  - lib/rubocop/formatter/html_formatter.rb
771
783
  - lib/rubocop/formatter/json_formatter.rb
772
784
  - lib/rubocop/formatter/junit_formatter.rb
@@ -805,7 +817,7 @@ metadata:
805
817
  homepage_uri: https://rubocop.org/
806
818
  changelog_uri: https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md
807
819
  source_code_uri: https://github.com/rubocop-hq/rubocop/
808
- documentation_uri: https://docs.rubocop.org/rubocop/1.0/
820
+ documentation_uri: https://docs.rubocop.org/rubocop/1.4/
809
821
  bug_tracker_uri: https://github.com/rubocop-hq/rubocop/issues
810
822
  post_install_message:
811
823
  rdoc_options: []
Binary file
@@ -1,261 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset='UTF-8' />
5
- <title>RuboCop 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">RuboCop 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>&nbsp;</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/rubocop-hq/rubocop">RuboCop</a>
258
- <span class="version"><%= RuboCop::Version::STRING %></span>
259
- </footer>
260
- </body>
261
- </html>
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'pry'
6
- require 'rubocop'
7
-
8
- ARGV.clear
9
-
10
- RuboCop.pry