rubocop 1.59.0 → 1.65.1

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 (255) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/README.md +3 -4
  4. data/assets/output.css.erb +159 -0
  5. data/assets/output.html.erb +1 -160
  6. data/config/default.yml +93 -17
  7. data/lib/rubocop/cached_data.rb +11 -3
  8. data/lib/rubocop/cli/command/auto_generate_config.rb +12 -3
  9. data/lib/rubocop/cli/command/lsp.rb +2 -2
  10. data/lib/rubocop/cli/command/show_docs_url.rb +2 -2
  11. data/lib/rubocop/cli.rb +10 -1
  12. data/lib/rubocop/config.rb +36 -12
  13. data/lib/rubocop/config_finder.rb +12 -2
  14. data/lib/rubocop/config_loader.rb +1 -2
  15. data/lib/rubocop/config_loader_resolver.rb +9 -3
  16. data/lib/rubocop/config_obsoletion.rb +1 -1
  17. data/lib/rubocop/config_validator.rb +14 -7
  18. data/lib/rubocop/cop/autocorrect_logic.rb +6 -1
  19. data/lib/rubocop/cop/base.rb +63 -16
  20. data/lib/rubocop/cop/bundler/gem_version.rb +3 -5
  21. data/lib/rubocop/cop/cop.rb +22 -4
  22. data/lib/rubocop/cop/correctors/each_to_for_corrector.rb +4 -8
  23. data/lib/rubocop/cop/correctors/for_to_each_corrector.rb +5 -13
  24. data/lib/rubocop/cop/documentation.rb +16 -6
  25. data/lib/rubocop/cop/exclude_limit.rb +1 -1
  26. data/lib/rubocop/cop/force.rb +12 -0
  27. data/lib/rubocop/cop/gemspec/add_runtime_dependency.rb +38 -0
  28. data/lib/rubocop/cop/gemspec/dependency_version.rb +3 -5
  29. data/lib/rubocop/cop/gemspec/duplicated_assignment.rb +2 -2
  30. data/lib/rubocop/cop/gemspec/required_ruby_version.rb +5 -1
  31. data/lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb +3 -3
  32. data/lib/rubocop/cop/internal_affairs/example_description.rb +6 -5
  33. data/lib/rubocop/cop/internal_affairs/method_name_end_with.rb +8 -6
  34. data/lib/rubocop/cop/internal_affairs/node_matcher_directive.rb +122 -28
  35. data/lib/rubocop/cop/internal_affairs/redundant_expect_offense_arguments.rb +34 -0
  36. data/lib/rubocop/cop/internal_affairs.rb +1 -0
  37. data/lib/rubocop/cop/layout/assignment_indentation.rb +3 -2
  38. data/lib/rubocop/cop/layout/case_indentation.rb +1 -1
  39. data/lib/rubocop/cop/layout/comment_indentation.rb +1 -1
  40. data/lib/rubocop/cop/layout/condition_position.rb +0 -4
  41. data/lib/rubocop/cop/layout/empty_comment.rb +3 -1
  42. data/lib/rubocop/cop/layout/empty_line_after_magic_comment.rb +14 -7
  43. data/lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb +1 -1
  44. data/lib/rubocop/cop/layout/end_alignment.rb +8 -2
  45. data/lib/rubocop/cop/layout/first_argument_indentation.rb +2 -2
  46. data/lib/rubocop/cop/layout/first_array_element_indentation.rb +18 -1
  47. data/lib/rubocop/cop/layout/heredoc_indentation.rb +1 -1
  48. data/lib/rubocop/cop/layout/indentation_width.rb +1 -1
  49. data/lib/rubocop/cop/layout/line_continuation_leading_space.rb +1 -1
  50. data/lib/rubocop/cop/layout/line_length.rb +20 -20
  51. data/lib/rubocop/cop/layout/redundant_line_break.rb +14 -2
  52. data/lib/rubocop/cop/layout/space_around_operators.rb +3 -0
  53. data/lib/rubocop/cop/layout/space_before_block_braces.rb +19 -10
  54. data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +1 -1
  55. data/lib/rubocop/cop/layout/space_inside_string_interpolation.rb +3 -4
  56. data/lib/rubocop/cop/legacy/corrector.rb +12 -2
  57. data/lib/rubocop/cop/lint/ambiguous_block_association.rb +0 -2
  58. data/lib/rubocop/cop/lint/ambiguous_operator.rb +0 -2
  59. data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +0 -2
  60. data/lib/rubocop/cop/lint/assignment_in_condition.rb +2 -2
  61. data/lib/rubocop/cop/lint/boolean_symbol.rb +0 -2
  62. data/lib/rubocop/cop/lint/circular_argument_reference.rb +0 -13
  63. data/lib/rubocop/cop/lint/debugger.rb +27 -6
  64. data/lib/rubocop/cop/lint/deprecated_class_methods.rb +1 -1
  65. data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +0 -10
  66. data/lib/rubocop/cop/lint/duplicate_case_condition.rb +1 -5
  67. data/lib/rubocop/cop/lint/duplicate_hash_key.rb +0 -4
  68. data/lib/rubocop/cop/lint/duplicate_methods.rb +0 -10
  69. data/lib/rubocop/cop/lint/each_with_object_argument.rb +0 -4
  70. data/lib/rubocop/cop/lint/else_layout.rb +0 -2
  71. data/lib/rubocop/cop/lint/empty_conditional_body.rb +2 -2
  72. data/lib/rubocop/cop/lint/empty_ensure.rb +1 -11
  73. data/lib/rubocop/cop/lint/empty_interpolation.rb +0 -4
  74. data/lib/rubocop/cop/lint/empty_when.rb +1 -3
  75. data/lib/rubocop/cop/lint/ensure_return.rb +1 -6
  76. data/lib/rubocop/cop/lint/erb_new_arguments.rb +21 -14
  77. data/lib/rubocop/cop/lint/float_comparison.rb +3 -1
  78. data/lib/rubocop/cop/lint/float_out_of_range.rb +0 -4
  79. data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +0 -10
  80. data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +15 -12
  81. data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +0 -7
  82. data/lib/rubocop/cop/lint/interpolation_check.rb +0 -4
  83. data/lib/rubocop/cop/lint/literal_as_condition.rb +1 -1
  84. data/lib/rubocop/cop/lint/literal_assignment_in_condition.rb +13 -6
  85. data/lib/rubocop/cop/lint/literal_in_interpolation.rb +0 -4
  86. data/lib/rubocop/cop/lint/loop.rb +6 -12
  87. data/lib/rubocop/cop/lint/mixed_case_range.rb +9 -4
  88. data/lib/rubocop/cop/lint/nested_method_definition.rb +1 -7
  89. data/lib/rubocop/cop/lint/next_without_accumulator.rb +0 -4
  90. data/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb +0 -5
  91. data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +1 -1
  92. data/lib/rubocop/cop/lint/percent_string_array.rb +0 -4
  93. data/lib/rubocop/cop/lint/percent_symbol_array.rb +0 -4
  94. data/lib/rubocop/cop/lint/rand_one.rb +0 -4
  95. data/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb +3 -1
  96. data/lib/rubocop/cop/lint/redundant_safe_navigation.rb +14 -9
  97. data/lib/rubocop/cop/lint/redundant_splat_expansion.rb +1 -1
  98. data/lib/rubocop/cop/lint/redundant_string_coercion.rb +0 -4
  99. data/lib/rubocop/cop/lint/redundant_with_index.rb +4 -0
  100. data/lib/rubocop/cop/lint/require_parentheses.rb +0 -4
  101. data/lib/rubocop/cop/lint/rescue_exception.rb +0 -4
  102. data/lib/rubocop/cop/lint/rescue_type.rb +1 -3
  103. data/lib/rubocop/cop/lint/return_in_void_context.rb +0 -2
  104. data/lib/rubocop/cop/lint/safe_navigation_chain.rb +0 -4
  105. data/lib/rubocop/cop/lint/script_permission.rb +3 -3
  106. data/lib/rubocop/cop/lint/shadowed_argument.rb +1 -0
  107. data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +6 -10
  108. data/lib/rubocop/cop/lint/syntax.rb +6 -3
  109. data/lib/rubocop/cop/lint/to_enum_arguments.rb +1 -3
  110. data/lib/rubocop/cop/lint/unified_integer.rb +0 -4
  111. data/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb +1 -0
  112. data/lib/rubocop/cop/lint/unreachable_code.rb +4 -7
  113. data/lib/rubocop/cop/lint/unreachable_loop.rb +8 -2
  114. data/lib/rubocop/cop/lint/useless_assignment.rb +1 -5
  115. data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +0 -4
  116. data/lib/rubocop/cop/lint/useless_setter_call.rb +0 -4
  117. data/lib/rubocop/cop/lint/useless_times.rb +1 -1
  118. data/lib/rubocop/cop/lint/void.rb +11 -1
  119. data/lib/rubocop/cop/metrics/block_nesting.rb +19 -7
  120. data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +5 -5
  121. data/lib/rubocop/cop/mixin/alignment.rb +5 -1
  122. data/lib/rubocop/cop/mixin/allowed_methods.rb +7 -1
  123. data/lib/rubocop/cop/mixin/allowed_pattern.rb +15 -3
  124. data/lib/rubocop/cop/mixin/code_length.rb +12 -1
  125. data/lib/rubocop/cop/mixin/configurable_formatting.rb +1 -0
  126. data/lib/rubocop/cop/mixin/configurable_max.rb +5 -1
  127. data/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb +9 -2
  128. data/lib/rubocop/cop/mixin/method_complexity.rb +15 -6
  129. data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +1 -1
  130. data/lib/rubocop/cop/mixin/rescue_node.rb +4 -0
  131. data/lib/rubocop/cop/mixin/safe_assignment.rb +1 -1
  132. data/lib/rubocop/cop/naming/block_forwarding.rb +32 -5
  133. data/lib/rubocop/cop/naming/file_name.rb +2 -2
  134. data/lib/rubocop/cop/naming/inclusive_language.rb +1 -2
  135. data/lib/rubocop/cop/naming/predicate_name.rb +54 -28
  136. data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +10 -1
  137. data/lib/rubocop/cop/registry.rb +1 -1
  138. data/lib/rubocop/cop/security/compound_hash.rb +2 -2
  139. data/lib/rubocop/cop/security/open.rb +2 -2
  140. data/lib/rubocop/cop/style/access_modifier_declarations.rb +50 -0
  141. data/lib/rubocop/cop/style/alias.rb +1 -0
  142. data/lib/rubocop/cop/style/arguments_forwarding.rb +89 -17
  143. data/lib/rubocop/cop/style/case_like_if.rb +1 -1
  144. data/lib/rubocop/cop/style/class_vars.rb +3 -3
  145. data/lib/rubocop/cop/style/collection_compact.rb +14 -5
  146. data/lib/rubocop/cop/style/commented_keyword.rb +5 -2
  147. data/lib/rubocop/cop/style/conditional_assignment.rb +6 -7
  148. data/lib/rubocop/cop/style/copyright.rb +31 -21
  149. data/lib/rubocop/cop/style/def_with_parentheses.rb +0 -2
  150. data/lib/rubocop/cop/style/documentation.rb +24 -24
  151. data/lib/rubocop/cop/style/documentation_method.rb +20 -0
  152. data/lib/rubocop/cop/style/each_for_simple_loop.rb +7 -8
  153. data/lib/rubocop/cop/style/eval_with_location.rb +15 -23
  154. data/lib/rubocop/cop/style/exact_regexp_match.rb +2 -1
  155. data/lib/rubocop/cop/style/file_read.rb +2 -5
  156. data/lib/rubocop/cop/style/file_write.rb +2 -5
  157. data/lib/rubocop/cop/style/for.rb +2 -0
  158. data/lib/rubocop/cop/style/format_string.rb +9 -9
  159. data/lib/rubocop/cop/style/global_std_stream.rb +7 -1
  160. data/lib/rubocop/cop/style/hash_each_methods.rb +29 -8
  161. data/lib/rubocop/cop/style/hash_except.rb +8 -5
  162. data/lib/rubocop/cop/style/hash_syntax.rb +24 -2
  163. data/lib/rubocop/cop/style/identical_conditional_branches.rb +4 -1
  164. data/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb +5 -4
  165. data/lib/rubocop/cop/style/inverse_methods.rb +8 -8
  166. data/lib/rubocop/cop/style/invertible_unless_condition.rb +46 -4
  167. data/lib/rubocop/cop/style/map_compact_with_conditional_block.rb +81 -50
  168. data/lib/rubocop/cop/style/map_into_array.rb +175 -0
  169. data/lib/rubocop/cop/style/map_to_hash.rb +10 -6
  170. data/lib/rubocop/cop/style/map_to_set.rb +1 -1
  171. data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +18 -5
  172. data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +2 -4
  173. data/lib/rubocop/cop/style/missing_else.rb +0 -4
  174. data/lib/rubocop/cop/style/multiline_method_signature.rb +10 -1
  175. data/lib/rubocop/cop/style/multiline_ternary_operator.rb +5 -3
  176. data/lib/rubocop/cop/style/multiline_when_then.rb +0 -4
  177. data/lib/rubocop/cop/style/nil_comparison.rb +2 -0
  178. data/lib/rubocop/cop/style/numeric_literal_prefix.rb +1 -1
  179. data/lib/rubocop/cop/style/numeric_predicate.rb +10 -2
  180. data/lib/rubocop/cop/style/object_then.rb +5 -3
  181. data/lib/rubocop/cop/style/one_line_conditional.rb +1 -1
  182. data/lib/rubocop/cop/style/parallel_assignment.rb +3 -5
  183. data/lib/rubocop/cop/style/parentheses_around_condition.rb +8 -0
  184. data/lib/rubocop/cop/style/quoted_symbols.rb +1 -1
  185. data/lib/rubocop/cop/style/raise_args.rb +4 -1
  186. data/lib/rubocop/cop/style/redundant_argument.rb +25 -2
  187. data/lib/rubocop/cop/style/redundant_assignment.rb +10 -2
  188. data/lib/rubocop/cop/style/redundant_begin.rb +1 -1
  189. data/lib/rubocop/cop/style/redundant_condition.rb +0 -1
  190. data/lib/rubocop/cop/style/redundant_current_directory_in_path.rb +5 -4
  191. data/lib/rubocop/cop/style/redundant_each.rb +7 -4
  192. data/lib/rubocop/cop/style/redundant_file_extension_in_require.rb +1 -1
  193. data/lib/rubocop/cop/style/redundant_filter_chain.rb +1 -1
  194. data/lib/rubocop/cop/style/redundant_line_continuation.rb +17 -2
  195. data/lib/rubocop/cop/style/redundant_parentheses.rb +18 -2
  196. data/lib/rubocop/cop/style/redundant_percent_q.rb +1 -1
  197. data/lib/rubocop/cop/style/redundant_regexp_escape.rb +8 -24
  198. data/lib/rubocop/cop/style/redundant_return.rb +6 -0
  199. data/lib/rubocop/cop/style/require_order.rb +1 -1
  200. data/lib/rubocop/cop/style/sample.rb +1 -3
  201. data/lib/rubocop/cop/style/send.rb +4 -4
  202. data/lib/rubocop/cop/style/send_with_literal_method_name.rb +104 -0
  203. data/lib/rubocop/cop/style/slicing_with_range.rb +76 -10
  204. data/lib/rubocop/cop/style/sole_nested_conditional.rb +21 -2
  205. data/lib/rubocop/cop/style/special_global_vars.rb +1 -2
  206. data/lib/rubocop/cop/style/super_arguments.rb +174 -0
  207. data/lib/rubocop/cop/style/symbol_proc.rb +75 -5
  208. data/lib/rubocop/cop/style/top_level_method_definition.rb +1 -1
  209. data/lib/rubocop/cop/style/while_until_do.rb +0 -2
  210. data/lib/rubocop/cop/style/while_until_modifier.rb +0 -1
  211. data/lib/rubocop/cop/style/zero_length_predicate.rb +32 -24
  212. data/lib/rubocop/cop/team.rb +13 -0
  213. data/lib/rubocop/cop/util.rb +7 -1
  214. data/lib/rubocop/cop/utils/regexp_ranges.rb +1 -1
  215. data/lib/rubocop/cop/variable_force.rb +13 -1
  216. data/lib/rubocop/cops_documentation_generator.rb +16 -4
  217. data/lib/rubocop/core_ext/string.rb +2 -6
  218. data/lib/rubocop/directive_comment.rb +10 -8
  219. data/lib/rubocop/ext/regexp_node.rb +18 -35
  220. data/lib/rubocop/ext/regexp_parser.rb +4 -21
  221. data/lib/rubocop/formatter/clang_style_formatter.rb +3 -7
  222. data/lib/rubocop/formatter/disabled_config_formatter.rb +23 -8
  223. data/lib/rubocop/formatter/formatter_set.rb +7 -1
  224. data/lib/rubocop/formatter/html_formatter.rb +32 -10
  225. data/lib/rubocop/formatter/json_formatter.rb +0 -1
  226. data/lib/rubocop/formatter/offense_count_formatter.rb +12 -2
  227. data/lib/rubocop/formatter/tap_formatter.rb +3 -7
  228. data/lib/rubocop/formatter.rb +1 -1
  229. data/lib/rubocop/lockfile.rb +56 -7
  230. data/lib/rubocop/lsp/logger.rb +1 -1
  231. data/lib/rubocop/lsp/routes.rb +12 -15
  232. data/lib/rubocop/lsp/runtime.rb +1 -1
  233. data/lib/rubocop/lsp/server.rb +7 -2
  234. data/lib/rubocop/lsp/severity.rb +1 -1
  235. data/lib/rubocop/lsp.rb +36 -0
  236. data/lib/rubocop/magic_comment.rb +1 -1
  237. data/lib/rubocop/options.rb +17 -12
  238. data/lib/rubocop/path_util.rb +6 -2
  239. data/lib/rubocop/rake_task.rb +1 -1
  240. data/lib/rubocop/rspec/cop_helper.rb +8 -2
  241. data/lib/rubocop/rspec/expect_offense.rb +16 -8
  242. data/lib/rubocop/rspec/shared_contexts.rb +73 -16
  243. data/lib/rubocop/rspec/support.rb +3 -0
  244. data/lib/rubocop/runner.rb +14 -3
  245. data/lib/rubocop/server/cache.rb +11 -2
  246. data/lib/rubocop/server/client_command/exec.rb +2 -3
  247. data/lib/rubocop/server/client_command/start.rb +1 -1
  248. data/lib/rubocop/server/core.rb +4 -0
  249. data/lib/rubocop/server/server_command/exec.rb +0 -1
  250. data/lib/rubocop/target_finder.rb +84 -78
  251. data/lib/rubocop/target_ruby.rb +82 -80
  252. data/lib/rubocop/version.rb +19 -4
  253. data/lib/rubocop.rb +9 -0
  254. metadata +18 -11
  255. /data/lib/rubocop/formatter/{git_hub_actions_formatter.rb → github_actions_formatter.rb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 236fd46f4a118eb34ff38fce1a147a116b2d30a7bf849ca809ece40aecabc694
4
- data.tar.gz: 550ecc4682d191a6a429a6af299212a42aa459e0aee04d5f7cb6a20ded419ff4
3
+ metadata.gz: 5ff6bd1def6f2fc502a83cef45c2031e812de416bf82ee6805ed3c8a4aa4ec08
4
+ data.tar.gz: 3fc581f44db6ecb7a31a16b58799151c941184b3d972d11716215165c071d672
5
5
  SHA512:
6
- metadata.gz: 5c7cfaa0f6573e566bbbac89a993889cd0f0944ab5c012e0286da61021e2d3da6ed51f68fbbf6c71afd4b6d81c577d15228b7a6a2d93aed59d2dfcba61a9be63
7
- data.tar.gz: 5cbb4256ff218ab5744fc3065f56061e5b0eab787d21dc30f3ded5972b789ffc2c24cd977fbaf3acbcc84abf36c5e3537a2eeb328dabb3becf29268eccaa81f8
6
+ metadata.gz: 07e4e645df882074e88da46ca8a69d7b1d12ec0d83bf4dfaaef6d799dcdb49c584b904d9f186e59278e663bbebe3db8e3950a6d4219fa73487978261c72fded6
7
+ data.tar.gz: 2d8d8ad60a022ee9df6cb9d164486044787a3a41da8bee073cabb528299d9f62968b8f90fc18a1cba0dbb581968912a478ddda85c1f02c336eb92dbd83092b14
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-23 Bozhidar Batsov
1
+ Copyright (c) 2012-24 Bozhidar Batsov
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,11 +1,10 @@
1
1
  <p align="center">
2
- <img src="https://raw.githubusercontent.com/rubocop/rubocop/master/logo/rubo-logo-horizontal.png" alt="RuboCop Logo"/>
2
+ <img src="https://raw.githubusercontent.com/rubocop/rubocop/master/logo/rubo-logo-horizontal-white.png" alt="RuboCop Logo"/>
3
3
  </p>
4
4
 
5
5
  ----------
6
6
  [![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop)
7
7
  [![Gem Version](https://badge.fury.io/rb/rubocop.svg)](https://badge.fury.io/rb/rubocop)
8
- [![CircleCI Status](https://circleci.com/gh/rubocop/rubocop/tree/master.svg?style=svg)](https://circleci.com/gh/rubocop/rubocop/tree/master)
9
8
  [![Actions Status](https://github.com/rubocop/rubocop/workflows/CI/badge.svg?branch=master)](https://github.com/rubocop/rubocop/actions?query=workflow%3ACI)
10
9
  [![Test Coverage](https://api.codeclimate.com/v1/badges/d2d67f728e88ea84ac69/test_coverage)](https://codeclimate.com/github/rubocop/rubocop/test_coverage)
11
10
  [![Maintainability](https://api.codeclimate.com/v1/badges/d2d67f728e88ea84ac69/maintainability)](https://codeclimate.com/github/rubocop/rubocop/maintainability)
@@ -53,7 +52,7 @@ To prevent an unwanted RuboCop update you might want to use a conservative versi
53
52
  in your `Gemfile`:
54
53
 
55
54
  ```rb
56
- gem 'rubocop', '~> 1.59', require: false
55
+ gem 'rubocop', '~> 1.65', require: false
57
56
  ```
58
57
 
59
58
  See [our versioning policy](https://docs.rubocop.org/rubocop/versioning.html) for further details.
@@ -248,5 +247,5 @@ RuboCop's changelog is available [here](CHANGELOG.md).
248
247
 
249
248
  ## Copyright
250
249
 
251
- Copyright (c) 2012-2023 Bozhidar Batsov. See [LICENSE.txt](LICENSE.txt) for
250
+ Copyright (c) 2012-2024 Bozhidar Batsov. See [LICENSE.txt](LICENSE.txt) for
252
251
  further details.
@@ -0,0 +1,159 @@
1
+ * {
2
+ -webkit-box-sizing: border-box;
3
+ -moz-box-sizing: border-box;
4
+ box-sizing: border-box;
5
+ }
6
+
7
+ body, html {
8
+ font-size: 62.5%;
9
+ }
10
+ body {
11
+ background-color: #ecedf0;
12
+ font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
13
+ margin: 0;
14
+ }
15
+ code {
16
+ font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
17
+ font-size: 85%;
18
+ }
19
+ #header {
20
+ background: #f9f9f9;
21
+ color: #333;
22
+ border-bottom: 3px solid #ccc;
23
+ height: 50px;
24
+ padding: 0;
25
+ }
26
+ #header .logo {
27
+ float: left;
28
+ margin: 5px 12px 7px 20px;
29
+ width: 38px;
30
+ height: 38px;
31
+ }
32
+ #header .title {
33
+ display: inline-block;
34
+ float: left;
35
+ height: 50px;
36
+ font-size: 2.4rem;
37
+ letter-spacing: normal;
38
+ line-height: 50px;
39
+ margin: 0;
40
+ }
41
+
42
+ .information, #offenses {
43
+ width: 100%;
44
+ padding: 20px;
45
+ color: #333;
46
+ }
47
+ #offenses {
48
+ padding: 0 20px;
49
+ }
50
+
51
+ .information .infobox {
52
+ border-left: 3px solid;
53
+ border-radius: 4px;
54
+ background-color: #fff;
55
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
56
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
57
+ padding: 15px;
58
+ border-color: #0088cc;
59
+ font-size: 1.4rem;
60
+ }
61
+ .information .infobox .info-title {
62
+ font-size: 1.8rem;
63
+ line-height: 2.2rem;
64
+ margin: 0 0 0.5em;
65
+ }
66
+ .information .offenses-list li {
67
+ line-height: 1.8rem
68
+ }
69
+ .information .offenses-list {
70
+ padding-left: 20px;
71
+ margin-bottom: 0;
72
+ }
73
+
74
+ #offenses .offense-box {
75
+ border-radius: 4px;
76
+ margin-bottom: 20px;
77
+ background-color: #fff;
78
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
79
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
80
+ }
81
+ .fixed .box-title {
82
+ position: fixed;
83
+ top: 0;
84
+ z-index: 10;
85
+ width: 100%;
86
+ }
87
+ .box-title-placeholder {
88
+ display: none;
89
+ }
90
+ .fixed .box-title-placeholder {
91
+ display: block;
92
+ }
93
+ #offenses .offense-box .box-title h3, #offenses .offense-box .box-title-placeholder h3 {
94
+ color: #33353f;
95
+ background-color: #f6f6f6;
96
+ font-size: 2rem;
97
+ line-height: 2rem;
98
+ display: block;
99
+ padding: 15px;
100
+ border-radius: 5px;
101
+ margin: 0;
102
+ }
103
+ #offenses .offense-box .offense-reports {
104
+ padding: 0 15px;
105
+ }
106
+ #offenses .offense-box .offense-reports .report {
107
+ border-bottom: 1px dotted #ddd;
108
+ padding: 15px 0px;
109
+ position: relative;
110
+ font-size: 1.3rem;
111
+ }
112
+ #offenses .offense-box .offense-reports .report:last-child {
113
+ border-bottom: none;
114
+ }
115
+ #offenses .offense-box .offense-reports .report pre code {
116
+ display: block;
117
+ background: #000;
118
+ color: #fff;
119
+ padding: 10px 15px;
120
+ border-radius: 5px;
121
+ line-height: 1.6rem;
122
+ }
123
+ #offenses .offense-box .offense-reports .report .location {
124
+ font-weight: bold;
125
+ }
126
+ #offenses .offense-box .offense-reports .report .message code {
127
+ padding: 0.3em;
128
+ background-color: rgba(0,0,0,0.07);
129
+ border-radius: 3px;
130
+ }
131
+ .severity {
132
+ text-transform: capitalize;
133
+ font-weight: bold;
134
+ }
135
+ .highlight {
136
+ padding: 2px;
137
+ border-radius: 2px;
138
+ font-weight: bold;
139
+ }
140
+ <%- SEVERITY_COLORS.each do |severity, color| %>
141
+ .severity.<%= severity %> {
142
+ color: <%= color %>;
143
+ }
144
+ .highlight.<%= severity %> {
145
+ background-color: <%= color.fade_out(0.4) %>;
146
+ border: 1px solid <%= color.fade_out(0.6) %>;
147
+ }
148
+ <%- end %>
149
+ footer {
150
+ margin-bottom: 20px;
151
+ margin-right: 20px;
152
+ font-size: 1.3rem;
153
+ color: #777;
154
+ text-align: right;
155
+ }
156
+ .extra-code {
157
+ color: #ED9C28
158
+ }
159
+
@@ -3,168 +3,9 @@
3
3
  <head>
4
4
  <meta charset='UTF-8' />
5
5
  <title>RuboCop Inspection Report</title>
6
- <%# TODO: Clean up the messy markup and style definitions. %>
7
6
  <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
- }
7
+ <%= render_css %>
166
8
  </style>
167
-
168
9
  <script>
169
10
  (function() {
170
11
  // floating headers. requires classList support.