sonicop 26.8.102 → 26.8.104

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 (703) hide show
  1. checksums.yaml +4 -4
  2. data/CONFORMANCE.md +189 -40
  3. data/Cargo.lock +1 -1
  4. data/Cargo.toml +8 -1
  5. data/README.ja.md +49 -26
  6. data/README.md +37 -32
  7. data/lib/sonicop/version.rb +1 -1
  8. data/src/cli.rs +70 -2
  9. data/src/config/loader.rs +76 -1
  10. data/src/config/mod.rs +39 -25
  11. data/src/config/paths.rs +19 -0
  12. data/src/diagnostic.rs +54 -5
  13. data/src/directives.rs +1080 -55
  14. data/src/display_width.rs +58 -0
  15. data/src/engine.rs +1205 -77
  16. data/src/formatter.rs +1661 -106
  17. data/src/lib.rs +3 -0
  18. data/src/magic_comment.rs +94 -21
  19. data/src/nul_bytes.rs +103 -0
  20. data/src/profile.rs +129 -0
  21. data/src/rules/bundler/duplicated_gem.rs +106 -0
  22. data/src/rules/bundler/duplicated_group.rs +105 -0
  23. data/src/rules/bundler/gem_comment.rs +242 -0
  24. data/src/rules/bundler/gem_filename.rs +45 -0
  25. data/src/rules/bundler/gem_version.rs +35 -0
  26. data/src/rules/bundler/insecure_protocol_source.rs +46 -0
  27. data/src/rules/bundler/mod.rs +15 -0
  28. data/src/rules/bundler/ordered_gems.rs +30 -0
  29. data/src/rules/bundler/support.rs +32 -0
  30. data/src/rules/gemspec/add_runtime_dependency.rs +40 -0
  31. data/src/rules/gemspec/attribute_assignment.rs +104 -0
  32. data/src/rules/gemspec/dependency_version.rs +67 -0
  33. data/src/rules/gemspec/deprecated_attribute_assignment.rs +173 -0
  34. data/src/rules/gemspec/development_dependencies.rs +44 -0
  35. data/src/rules/gemspec/duplicated_assignment.rs +140 -0
  36. data/src/rules/gemspec/mod.rs +19 -0
  37. data/src/rules/gemspec/ordered_dependencies.rs +63 -0
  38. data/src/rules/gemspec/require_mfa.rs +292 -0
  39. data/src/rules/gemspec/required_ruby_version.rs +176 -0
  40. data/src/rules/gemspec/ruby_version_globals_usage.rs +53 -0
  41. data/src/rules/gemspec/support.rs +154 -0
  42. data/src/rules/layout/access_modifier_indentation.rs +101 -0
  43. data/src/rules/layout/alignment.rs +409 -0
  44. data/src/rules/layout/argument_alignment.rs +160 -0
  45. data/src/rules/layout/array_alignment.rs +165 -0
  46. data/src/rules/layout/assignment_indentation.rs +76 -0
  47. data/src/rules/layout/begin_end_alignment.rs +34 -0
  48. data/src/rules/layout/block_alignment.rs +496 -0
  49. data/src/rules/layout/block_end_newline.rs +161 -0
  50. data/src/rules/layout/case_indentation.rs +107 -0
  51. data/src/rules/layout/class_structure.rs +439 -0
  52. data/src/rules/layout/closing_heredoc_indentation.rs +185 -0
  53. data/src/rules/layout/closing_parenthesis_indentation.rs +211 -0
  54. data/src/rules/layout/comment_indentation.rs +193 -0
  55. data/src/rules/layout/condition_position.rs +78 -0
  56. data/src/rules/layout/def_end_alignment.rs +92 -0
  57. data/src/rules/layout/dot_position.rs +144 -0
  58. data/src/rules/layout/element_line_breaks.rs +319 -0
  59. data/src/rules/layout/else_alignment.rs +248 -0
  60. data/src/rules/layout/empty_comment.rs +92 -0
  61. data/src/rules/layout/empty_line_after_guard_clause.rs +381 -0
  62. data/src/rules/layout/empty_line_after_multiline_condition.rs +201 -0
  63. data/src/rules/layout/empty_line_between_defs.rs +254 -0
  64. data/src/rules/layout/empty_lines.rs +85 -0
  65. data/src/rules/layout/empty_lines_after_module_inclusion.rs +197 -0
  66. data/src/rules/layout/empty_lines_around_access_modifier.rs +362 -0
  67. data/src/rules/layout/empty_lines_around_arguments.rs +183 -0
  68. data/src/rules/layout/empty_lines_around_attribute_accessor.rs +178 -0
  69. data/src/rules/layout/empty_lines_around_begin_body.rs +19 -0
  70. data/src/rules/layout/empty_lines_around_block_body.rs +39 -0
  71. data/src/rules/layout/empty_lines_around_body.rs +372 -0
  72. data/src/rules/layout/empty_lines_around_class_body.rs +30 -0
  73. data/src/rules/layout/empty_lines_around_exception_handling_keywords.rs +130 -0
  74. data/src/rules/layout/empty_lines_around_method_body.rs +80 -0
  75. data/src/rules/layout/empty_lines_around_module_body.rs +21 -0
  76. data/src/rules/layout/end_alignment.rs +258 -0
  77. data/src/rules/layout/extra_spacing.rs +297 -0
  78. data/src/rules/layout/first_argument_indentation.rs +364 -0
  79. data/src/rules/layout/first_array_element_indentation.rs +189 -0
  80. data/src/rules/layout/first_array_element_line_break.rs +41 -0
  81. data/src/rules/layout/first_hash_element_indentation.rs +229 -0
  82. data/src/rules/layout/first_hash_element_line_break.rs +21 -0
  83. data/src/rules/layout/first_method_argument_line_break.rs +38 -0
  84. data/src/rules/layout/first_method_parameter_line_break.rs +24 -0
  85. data/src/rules/layout/first_parameter_indentation.rs +78 -0
  86. data/src/rules/layout/hash_alignment.rs +593 -0
  87. data/src/rules/layout/heredoc_argument_closing_parenthesis.rs +386 -0
  88. data/src/rules/layout/heredoc_indentation.rs +238 -0
  89. data/src/rules/layout/indentation_consistency.rs +122 -0
  90. data/src/rules/layout/indentation_style.rs +96 -0
  91. data/src/rules/layout/indentation_width.rs +673 -0
  92. data/src/rules/layout/initial_indentation.rs +62 -0
  93. data/src/rules/layout/leading_comment_space.rs +127 -0
  94. data/src/rules/layout/leading_empty_lines.rs +35 -0
  95. data/src/rules/layout/line_continuation_leading_space.rs +151 -0
  96. data/src/rules/layout/line_continuation_spacing.rs +135 -0
  97. data/src/rules/layout/line_end_string_concatenation_indentation.rs +163 -0
  98. data/src/rules/layout/line_length.rs +69 -57
  99. data/src/rules/layout/mod.rs +100 -0
  100. data/src/rules/layout/multiline_array_brace_layout.rs +34 -0
  101. data/src/rules/layout/multiline_array_line_breaks.rs +13 -0
  102. data/src/rules/layout/multiline_assignment_layout.rs +154 -0
  103. data/src/rules/layout/multiline_block_layout.rs +178 -0
  104. data/src/rules/layout/multiline_brace.rs +365 -0
  105. data/src/rules/layout/multiline_expression.rs +1053 -0
  106. data/src/rules/layout/multiline_hash_brace_layout.rs +43 -0
  107. data/src/rules/layout/multiline_hash_key_line_breaks.rs +15 -0
  108. data/src/rules/layout/multiline_method_argument_line_breaks.rs +30 -0
  109. data/src/rules/layout/multiline_method_call_brace_layout.rs +48 -0
  110. data/src/rules/layout/multiline_method_call_indentation.rs +812 -0
  111. data/src/rules/layout/multiline_method_definition_brace_layout.rs +36 -0
  112. data/src/rules/layout/multiline_method_parameter_line_breaks.rs +17 -0
  113. data/src/rules/layout/multiline_operation_indentation.rs +144 -0
  114. data/src/rules/layout/parameter_alignment.rs +50 -0
  115. data/src/rules/layout/redundant_line_break.rs +398 -0
  116. data/src/rules/layout/rescue_ensure_alignment.rs +232 -0
  117. data/src/rules/layout/single_line_block_chain.rs +74 -0
  118. data/src/rules/layout/space_after_colon.rs +68 -0
  119. data/src/rules/layout/space_after_comma.rs +2 -1
  120. data/src/rules/layout/space_after_method_name.rs +30 -0
  121. data/src/rules/layout/space_after_not.rs +34 -0
  122. data/src/rules/layout/space_after_semicolon.rs +53 -0
  123. data/src/rules/layout/space_around_block_parameters.rs +193 -0
  124. data/src/rules/layout/space_around_equals_in_parameter_default.rs +97 -0
  125. data/src/rules/layout/space_around_keyword.rs +330 -0
  126. data/src/rules/layout/space_around_method_call_operator.rs +102 -0
  127. data/src/rules/layout/space_around_operators.rs +30 -369
  128. data/src/rules/layout/space_before_block_braces.rs +86 -0
  129. data/src/rules/layout/space_before_brackets.rs +73 -0
  130. data/src/rules/layout/space_before_comma.rs +54 -0
  131. data/src/rules/layout/space_before_comment.rs +34 -0
  132. data/src/rules/layout/space_before_first_arg.rs +105 -0
  133. data/src/rules/layout/space_before_semicolon.rs +67 -0
  134. data/src/rules/layout/space_in_lambda_literal.rs +61 -0
  135. data/src/rules/layout/space_inside_array_literal_brackets.rs +430 -0
  136. data/src/rules/layout/space_inside_array_percent_literal.rs +76 -0
  137. data/src/rules/layout/space_inside_block_braces.rs +397 -0
  138. data/src/rules/layout/space_inside_hash_literal_braces.rs +282 -0
  139. data/src/rules/layout/space_inside_percent_literal_delimiters.rs +100 -0
  140. data/src/rules/layout/space_inside_range_literal.rs +157 -0
  141. data/src/rules/layout/space_inside_reference_brackets.rs +205 -0
  142. data/src/rules/layout/space_inside_string_interpolation.rs +117 -0
  143. data/src/rules/layout/support.rs +856 -1
  144. data/src/rules/layout/tokens.rs +358 -0
  145. data/src/rules/layout/trailing_whitespace.rs +2 -1
  146. data/src/rules/lint/access_modifier.rs +262 -0
  147. data/src/rules/lint/ambiguity.rs +117 -0
  148. data/src/rules/lint/ambiguous_assignment.rs +69 -0
  149. data/src/rules/lint/ambiguous_block_association.rs +285 -0
  150. data/src/rules/lint/ambiguous_operator.rs +39 -0
  151. data/src/rules/lint/ambiguous_operator_precedence.rs +81 -0
  152. data/src/rules/lint/ambiguous_range.rs +115 -0
  153. data/src/rules/lint/ambiguous_regexp_literal.rs +18 -0
  154. data/src/rules/lint/array_literal_in_regexp.rs +108 -0
  155. data/src/rules/lint/assignment_in_condition.rs +234 -0
  156. data/src/rules/lint/big_decimal_new.rs +57 -0
  157. data/src/rules/lint/binary_operator_with_identical_operands.rs +61 -0
  158. data/src/rules/lint/blocks.rs +114 -0
  159. data/src/rules/lint/boolean_symbol.rs +112 -0
  160. data/src/rules/lint/circular_argument_reference.rs +72 -0
  161. data/src/rules/lint/conditions.rs +87 -0
  162. data/src/rules/lint/constant_definition_in_block.rs +62 -0
  163. data/src/rules/lint/constant_overwritten_in_rescue.rs +41 -0
  164. data/src/rules/lint/constant_reassignment.rs +293 -0
  165. data/src/rules/lint/constant_resolution.rs +132 -0
  166. data/src/rules/lint/cop_directive_syntax.rs +15 -0
  167. data/src/rules/lint/cop_directives.rs +168 -0
  168. data/src/rules/lint/data_define_override.rs +98 -0
  169. data/src/rules/lint/debugger.rs +224 -0
  170. data/src/rules/lint/deprecated_class_methods.rs +155 -0
  171. data/src/rules/lint/deprecated_constants.rs +85 -0
  172. data/src/rules/lint/deprecated_open_ssl_constant.rs +229 -0
  173. data/src/rules/lint/deprecated_reference.rs +17 -0
  174. data/src/rules/lint/disjunctive_assignment_in_constructor.rs +65 -0
  175. data/src/rules/lint/duplicate_branch.rs +292 -0
  176. data/src/rules/lint/duplicate_case_condition.rs +43 -0
  177. data/src/rules/lint/duplicate_elsif_condition.rs +33 -0
  178. data/src/rules/lint/duplicate_hash_key.rs +31 -0
  179. data/src/rules/lint/duplicate_magic_comment.rs +58 -0
  180. data/src/rules/lint/duplicate_match_pattern.rs +80 -0
  181. data/src/rules/lint/duplicate_methods.rs +69 -68
  182. data/src/rules/lint/duplicate_regexp_character_class_element.rs +46 -0
  183. data/src/rules/lint/duplicate_require.rs +162 -0
  184. data/src/rules/lint/duplicate_rescue_exception.rs +53 -0
  185. data/src/rules/lint/duplicate_set_element.rs +127 -0
  186. data/src/rules/lint/each_with_object_argument.rs +60 -0
  187. data/src/rules/lint/else_layout.rs +114 -0
  188. data/src/rules/lint/empty_block.rs +73 -0
  189. data/src/rules/lint/empty_class.rs +31 -0
  190. data/src/rules/lint/empty_conditional_body.rs +166 -0
  191. data/src/rules/lint/empty_ensure.rs +28 -0
  192. data/src/rules/lint/empty_expression.rs +16 -0
  193. data/src/rules/lint/empty_file.rs +22 -0
  194. data/src/rules/lint/empty_in_pattern.rs +101 -0
  195. data/src/rules/lint/empty_interpolation.rs +53 -0
  196. data/src/rules/lint/empty_when.rs +102 -0
  197. data/src/rules/lint/ensure_return.rs +69 -0
  198. data/src/rules/lint/erb_new_arguments.rs +157 -0
  199. data/src/rules/lint/exception_hierarchy.rs +451 -0
  200. data/src/rules/lint/flip_flop.rs +16 -0
  201. data/src/rules/lint/float_comparison.rs +250 -0
  202. data/src/rules/lint/float_out_of_range.rs +40 -0
  203. data/src/rules/lint/flow.rs +167 -0
  204. data/src/rules/lint/format_parameter_mismatch.rs +275 -0
  205. data/src/rules/lint/format_string.rs +328 -0
  206. data/src/rules/lint/hash_compare_by_identity.rs +76 -0
  207. data/src/rules/lint/hash_new_with_keyword_arguments_as_default.rs +60 -0
  208. data/src/rules/lint/heredoc_method_call_position.rs +134 -0
  209. data/src/rules/lint/identity_comparison.rs +83 -0
  210. data/src/rules/lint/implicit_string_concatenation.rs +126 -0
  211. data/src/rules/lint/incompatible_io_select_with_fiber_scheduler.rs +117 -0
  212. data/src/rules/lint/ineffective_access_modifier.rs +137 -0
  213. data/src/rules/lint/inherit_exception.rs +111 -0
  214. data/src/rules/lint/interpolation_check.rs +132 -0
  215. data/src/rules/lint/it_without_arguments_in_block.rs +75 -0
  216. data/src/rules/lint/lambda_without_literal_block.rs +57 -0
  217. data/src/rules/lint/literal_as_condition.rs +484 -0
  218. data/src/rules/lint/literal_assignment_in_condition.rs +148 -0
  219. data/src/rules/lint/literal_in_interpolation.rs +362 -0
  220. data/src/rules/lint/literals.rs +252 -0
  221. data/src/rules/lint/locals.rs +65 -0
  222. data/src/rules/lint/loop.rs +76 -0
  223. data/src/rules/lint/missing_cop_enable_directive.rs +62 -0
  224. data/src/rules/lint/missing_super.rs +150 -0
  225. data/src/rules/lint/mixed_case_range.rs +119 -0
  226. data/src/rules/lint/mixed_regexp_capture_types.rs +21 -0
  227. data/src/rules/lint/mod.rs +197 -2
  228. data/src/rules/lint/multiple_comparison.rs +59 -0
  229. data/src/rules/lint/name_typo.rs +14 -0
  230. data/src/rules/lint/nested_method_definition.rs +112 -0
  231. data/src/rules/lint/nested_percent_literal.rs +35 -0
  232. data/src/rules/lint/next_without_accumulator.rs +70 -0
  233. data/src/rules/lint/nil_methods.rs +93 -0
  234. data/src/rules/lint/no_return_in_begin_end_blocks.rs +94 -0
  235. data/src/rules/lint/node_equality.rs +317 -0
  236. data/src/rules/lint/non_atomic_file_operation.rs +336 -0
  237. data/src/rules/lint/non_deterministic_require_order.rs +232 -0
  238. data/src/rules/lint/non_local_exit_from_iterator.rs +95 -0
  239. data/src/rules/lint/number_conversion.rs +264 -0
  240. data/src/rules/lint/numbered_parameter_assignment.rs +44 -0
  241. data/src/rules/lint/numeric_operation_with_constant_result.rs +149 -0
  242. data/src/rules/lint/or_assignment_to_constant.rs +54 -0
  243. data/src/rules/lint/ordered_magic_comments.rs +73 -0
  244. data/src/rules/lint/out_of_range_regexp_ref.rs +247 -0
  245. data/src/rules/lint/parameters.rs +68 -0
  246. data/src/rules/lint/parentheses_as_grouped_expression.rs +81 -0
  247. data/src/rules/lint/percent_literal.rs +34 -0
  248. data/src/rules/lint/percent_string_array.rs +73 -0
  249. data/src/rules/lint/percent_symbol_array.rs +52 -0
  250. data/src/rules/lint/raise_exception.rs +108 -0
  251. data/src/rules/lint/rand_one.rs +48 -0
  252. data/src/rules/lint/ranges.rs +22 -0
  253. data/src/rules/lint/redundant_cop_disable_directive.rs +472 -0
  254. data/src/rules/lint/redundant_cop_enable_directive.rs +238 -0
  255. data/src/rules/lint/redundant_dir_glob_sort.rs +117 -0
  256. data/src/rules/lint/redundant_regexp_quantifiers.rs +137 -0
  257. data/src/rules/lint/redundant_require_statement.rs +91 -0
  258. data/src/rules/lint/redundant_safe_navigation.rs +227 -0
  259. data/src/rules/lint/redundant_splat_expansion.rs +266 -0
  260. data/src/rules/lint/redundant_string_coercion.rs +108 -0
  261. data/src/rules/lint/redundant_type_conversion.rs +203 -0
  262. data/src/rules/lint/redundant_with_index.rs +94 -0
  263. data/src/rules/lint/redundant_with_object.rs +79 -0
  264. data/src/rules/lint/refinement_import_methods.rs +72 -0
  265. data/src/rules/lint/regexp.rs +130 -0
  266. data/src/rules/lint/regexp_as_condition.rs +45 -0
  267. data/src/rules/lint/regexp_source.rs +113 -0
  268. data/src/rules/lint/regexp_tree.rs +985 -0
  269. data/src/rules/lint/require_parentheses.rs +69 -0
  270. data/src/rules/lint/require_range_parentheses.rs +153 -0
  271. data/src/rules/lint/require_relative_self_path.rs +64 -0
  272. data/src/rules/lint/rescue_clause.rs +76 -0
  273. data/src/rules/lint/rescue_exception.rs +24 -0
  274. data/src/rules/lint/rescue_type.rs +68 -0
  275. data/src/rules/lint/return_in_void_context.rs +80 -0
  276. data/src/rules/lint/safe_navigation_chain.rs +306 -0
  277. data/src/rules/lint/safe_navigation_consistency.rs +234 -0
  278. data/src/rules/lint/safe_navigation_with_empty.rs +61 -0
  279. data/src/rules/lint/script_permission.rs +42 -0
  280. data/src/rules/lint/self_assignment.rs +413 -0
  281. data/src/rules/lint/send_with_mixin_argument.rs +81 -0
  282. data/src/rules/lint/shadowed_argument.rs +212 -0
  283. data/src/rules/lint/shadowed_exception.rs +147 -0
  284. data/src/rules/lint/shadowing_outer_local_variable.rs +290 -0
  285. data/src/rules/lint/shared_mutable_default.rs +75 -0
  286. data/src/rules/lint/statements.rs +174 -0
  287. data/src/rules/lint/struct_new_override.rs +176 -0
  288. data/src/rules/lint/suppressed_exception.rs +51 -0
  289. data/src/rules/lint/suppressed_exception_in_number_conversion.rs +142 -0
  290. data/src/rules/lint/symbol_conversion.rs +251 -0
  291. data/src/rules/lint/syntax.rs +46 -43
  292. data/src/rules/lint/to_enum_arguments.rs +241 -0
  293. data/src/rules/lint/to_json.rs +38 -0
  294. data/src/rules/lint/top_level_return_with_argument.rs +36 -0
  295. data/src/rules/lint/trailing_comma_in_attribute_declaration.rs +48 -0
  296. data/src/rules/lint/triple_quotes.rs +50 -0
  297. data/src/rules/lint/underscore_prefixed_variable_name.rs +32 -0
  298. data/src/rules/lint/unescaped_bracket_in_regexp.rs +140 -0
  299. data/src/rules/lint/unexpected_block_arity.rs +56 -0
  300. data/src/rules/lint/unified_integer.rs +51 -0
  301. data/src/rules/lint/unmodified_reduce_accumulator.rs +361 -0
  302. data/src/rules/lint/unreachable_code.rs +63 -0
  303. data/src/rules/lint/unreachable_loop.rs +313 -0
  304. data/src/rules/lint/unreachable_pattern_branch.rs +66 -0
  305. data/src/rules/lint/unused_block_argument.rs +17 -9
  306. data/src/rules/lint/unused_method_argument.rs +254 -0
  307. data/src/rules/lint/unused_private_method.rs +14 -0
  308. data/src/rules/lint/uri_escape_unescape.rs +54 -0
  309. data/src/rules/lint/uri_regexp.rs +61 -0
  310. data/src/rules/lint/useless_access_modifier.rs +299 -0
  311. data/src/rules/lint/useless_assignment.rs +38 -37
  312. data/src/rules/lint/useless_constant_scoping.rs +70 -0
  313. data/src/rules/lint/useless_default_value_argument.rs +96 -0
  314. data/src/rules/lint/useless_defined.rs +59 -0
  315. data/src/rules/lint/useless_else_without_rescue.rs +39 -0
  316. data/src/rules/lint/useless_method_definition.rs +134 -0
  317. data/src/rules/lint/useless_numeric_operation.rs +139 -0
  318. data/src/rules/lint/useless_or.rs +105 -0
  319. data/src/rules/lint/useless_rescue.rs +111 -0
  320. data/src/rules/lint/useless_ruby2_keywords.rs +123 -0
  321. data/src/rules/lint/useless_setter_call.rs +235 -0
  322. data/src/rules/lint/useless_times.rs +288 -0
  323. data/src/rules/lint/variable_force.rs +184 -128
  324. data/src/rules/lint/void.rs +653 -0
  325. data/src/rules/metrics/abc_size.rs +277 -0
  326. data/src/rules/metrics/block_length.rs +8 -7
  327. data/src/rules/metrics/block_nesting.rs +146 -0
  328. data/src/rules/metrics/class_length.rs +9 -8
  329. data/src/rules/metrics/collection_literal_length.rs +134 -0
  330. data/src/rules/metrics/complexity.rs +1202 -0
  331. data/src/rules/metrics/cyclomatic_complexity.rs +71 -0
  332. data/src/rules/metrics/fragments.rs +198 -0
  333. data/src/rules/metrics/locals.rs +634 -0
  334. data/src/rules/metrics/method_length.rs +6 -5
  335. data/src/rules/metrics/mod.rs +11 -0
  336. data/src/rules/metrics/module_length.rs +9 -8
  337. data/src/rules/metrics/parameter_lists.rs +25 -24
  338. data/src/rules/metrics/perceived_complexity.rs +160 -0
  339. data/src/rules/metrics/support.rs +14 -13
  340. data/src/rules/migration/department_name.rs +196 -0
  341. data/src/rules/migration/mod.rs +6 -0
  342. data/src/rules/mod.rs +229 -9
  343. data/src/rules/naming/accessor_method_name.rs +41 -0
  344. data/src/rules/naming/ascii_identifiers.rs +5 -4
  345. data/src/rules/naming/binary_operator_parameter_name.rs +102 -0
  346. data/src/rules/naming/block_forwarding.rs +341 -0
  347. data/src/rules/naming/block_parameter_name.rs +17 -0
  348. data/src/rules/naming/class_and_module_camel_case.rs +32 -0
  349. data/src/rules/naming/constant_name.rs +40 -39
  350. data/src/rules/naming/file_name.rs +98 -0
  351. data/src/rules/naming/heredoc_delimiter_case.rs +49 -0
  352. data/src/rules/naming/heredoc_delimiter_naming.rs +37 -0
  353. data/src/rules/naming/inclusive_language.rs +414 -0
  354. data/src/rules/naming/memoized_instance_variable_name.rs +373 -0
  355. data/src/rules/naming/method_name.rs +19 -95
  356. data/src/rules/naming/method_parameter_name.rs +17 -0
  357. data/src/rules/naming/mod.rs +18 -1
  358. data/src/rules/naming/predicate_method.rs +520 -0
  359. data/src/rules/naming/predicate_prefix.rs +129 -0
  360. data/src/rules/naming/rescued_exceptions_variable_name.rs +277 -0
  361. data/src/rules/naming/support.rs +495 -16
  362. data/src/rules/naming/uncommunicative.rs +93 -0
  363. data/src/rules/naming/variable_name.rs +4 -3
  364. data/src/rules/naming/variable_number.rs +212 -0
  365. data/src/rules/node_ext.rs +190 -0
  366. data/src/rules/ordered_gem.rs +165 -0
  367. data/src/rules/regex_cache.rs +59 -0
  368. data/src/rules/ruby_literal.rs +177 -0
  369. data/src/rules/security/compound_hash.rs +205 -0
  370. data/src/rules/security/eval.rs +12 -11
  371. data/src/rules/security/io_methods.rs +55 -0
  372. data/src/rules/security/json_load.rs +55 -0
  373. data/src/rules/security/marshal_load.rs +48 -0
  374. data/src/rules/security/mod.rs +6 -0
  375. data/src/rules/security/open.rs +138 -0
  376. data/src/rules/security/yaml_load.rs +42 -0
  377. data/src/rules/send_node.rs +253 -0
  378. data/src/rules/single_line.rs +238 -0
  379. data/src/rules/style/access_modifier_declarations.rs +459 -0
  380. data/src/rules/style/accessor_grouping.rs +351 -0
  381. data/src/rules/style/alias.rs +266 -0
  382. data/src/rules/style/ambiguous_endless_method_definition.rs +73 -0
  383. data/src/rules/style/and_or.rs +319 -0
  384. data/src/rules/style/arguments_forwarding.rs +889 -0
  385. data/src/rules/style/array_coercion.rs +127 -0
  386. data/src/rules/style/array_first_last.rs +107 -0
  387. data/src/rules/style/array_intersect.rs +228 -0
  388. data/src/rules/style/array_intersect_with_single_element.rs +90 -0
  389. data/src/rules/style/array_join.rs +42 -0
  390. data/src/rules/style/ascii_comments.rs +45 -0
  391. data/src/rules/style/attr.rs +98 -0
  392. data/src/rules/style/auto_resource_cleanup.rs +77 -0
  393. data/src/rules/style/bare_percent_literals.rs +43 -0
  394. data/src/rules/style/begin_block.rs +13 -0
  395. data/src/rules/style/bisected_attr_accessor.rs +262 -0
  396. data/src/rules/style/bitwise_predicate.rs +146 -0
  397. data/src/rules/style/block_args.rs +59 -0
  398. data/src/rules/style/block_comments.rs +85 -0
  399. data/src/rules/style/block_delimiters.rs +484 -0
  400. data/src/rules/style/case_equality.rs +167 -0
  401. data/src/rules/style/case_like_if.rs +328 -0
  402. data/src/rules/style/character_literal.rs +50 -0
  403. data/src/rules/style/class_and_module_children.rs +276 -0
  404. data/src/rules/style/class_check.rs +39 -0
  405. data/src/rules/style/class_equality_comparison.rs +218 -0
  406. data/src/rules/style/class_methods.rs +72 -0
  407. data/src/rules/style/class_methods_definitions.rs +202 -0
  408. data/src/rules/style/class_vars.rs +61 -0
  409. data/src/rules/style/collection_compact.rs +219 -0
  410. data/src/rules/style/collection_methods.rs +75 -0
  411. data/src/rules/style/collection_querying.rs +144 -0
  412. data/src/rules/style/colon_method_call.rs +57 -0
  413. data/src/rules/style/colon_method_definition.rs +31 -0
  414. data/src/rules/style/combinable_defined.rs +167 -0
  415. data/src/rules/style/combinable_loops.rs +215 -0
  416. data/src/rules/style/command_literal.rs +105 -0
  417. data/src/rules/style/comment_annotation.rs +138 -0
  418. data/src/rules/style/commented_keyword.rs +102 -0
  419. data/src/rules/style/comments.rs +249 -0
  420. data/src/rules/style/comparable_between.rs +90 -0
  421. data/src/rules/style/comparable_clamp.rs +209 -0
  422. data/src/rules/style/concat_array_literals.rs +152 -0
  423. data/src/rules/style/conditional.rs +138 -0
  424. data/src/rules/style/conditional_assignment.rs +599 -0
  425. data/src/rules/style/constant_visibility.rs +137 -0
  426. data/src/rules/style/copyright.rs +81 -0
  427. data/src/rules/style/data_inheritance.rs +119 -0
  428. data/src/rules/style/date_time.rs +94 -0
  429. data/src/rules/style/def_with_parentheses.rs +58 -0
  430. data/src/rules/style/dig_chain.rs +113 -0
  431. data/src/rules/style/dir.rs +63 -0
  432. data/src/rules/style/dir_empty.rs +118 -0
  433. data/src/rules/style/disable_cops_within_source_code_directive.rs +130 -0
  434. data/src/rules/style/document_dynamic_eval_definition.rs +233 -0
  435. data/src/rules/style/documentation.rs +343 -0
  436. data/src/rules/style/documentation_method.rs +84 -0
  437. data/src/rules/style/double_cop_disable_directive.rs +65 -0
  438. data/src/rules/style/double_negation.rs +260 -0
  439. data/src/rules/style/each_for_simple_loop.rs +110 -0
  440. data/src/rules/style/each_with_object.rs +242 -0
  441. data/src/rules/style/empty_block_parameter.rs +37 -0
  442. data/src/rules/style/empty_case_condition.rs +224 -0
  443. data/src/rules/style/empty_class_definition.rs +125 -0
  444. data/src/rules/style/empty_else.rs +129 -0
  445. data/src/rules/style/empty_heredoc.rs +75 -0
  446. data/src/rules/style/empty_lambda_parameter.rs +31 -0
  447. data/src/rules/style/empty_literal.rs +222 -0
  448. data/src/rules/style/empty_method.rs +104 -0
  449. data/src/rules/style/empty_string_inside_interpolation.rs +141 -0
  450. data/src/rules/style/encoding.rs +52 -0
  451. data/src/rules/style/end_block.rs +22 -0
  452. data/src/rules/style/endless.rs +53 -0
  453. data/src/rules/style/endless_method.rs +168 -0
  454. data/src/rules/style/env_home.rs +100 -0
  455. data/src/rules/style/eval_with_location.rs +382 -0
  456. data/src/rules/style/even_odd.rs +110 -0
  457. data/src/rules/style/exact_regexp_match.rs +102 -0
  458. data/src/rules/style/expand_path_arguments.rs +230 -0
  459. data/src/rules/style/explicit_block_argument.rs +215 -0
  460. data/src/rules/style/exponential_notation.rs +126 -0
  461. data/src/rules/style/fetch_env_var.rs +280 -0
  462. data/src/rules/style/file_empty.rs +168 -0
  463. data/src/rules/style/file_null.rs +66 -0
  464. data/src/rules/style/file_open.rs +63 -0
  465. data/src/rules/style/file_open_call.rs +105 -0
  466. data/src/rules/style/file_read.rs +70 -0
  467. data/src/rules/style/file_touch.rs +63 -0
  468. data/src/rules/style/file_write.rs +134 -0
  469. data/src/rules/style/float_division.rs +225 -0
  470. data/src/rules/style/for.rs +145 -0
  471. data/src/rules/style/format_sequences.rs +329 -0
  472. data/src/rules/style/format_string.rs +288 -0
  473. data/src/rules/style/format_string_token.rs +357 -0
  474. data/src/rules/style/frozen_string.rs +87 -0
  475. data/src/rules/style/frozen_string_literal_comment.rs +23 -13
  476. data/src/rules/style/global_std_stream.rs +91 -0
  477. data/src/rules/style/global_vars.rs +34 -0
  478. data/src/rules/style/guard_clause.rs +622 -0
  479. data/src/rules/style/hash_as_last_array_item.rs +188 -0
  480. data/src/rules/style/hash_conversion.rs +303 -0
  481. data/src/rules/style/hash_each_methods.rs +403 -0
  482. data/src/rules/style/hash_except.rs +15 -0
  483. data/src/rules/style/hash_fetch_chain.rs +125 -0
  484. data/src/rules/style/hash_like_case.rs +164 -0
  485. data/src/rules/style/hash_lookup_method.rs +144 -0
  486. data/src/rules/style/hash_slice.rs +16 -0
  487. data/src/rules/style/hash_subset.rs +282 -0
  488. data/src/rules/style/hash_syntax.rs +8 -7
  489. data/src/rules/style/hash_transform.rs +472 -0
  490. data/src/rules/style/hash_transform_keys.rs +6 -0
  491. data/src/rules/style/hash_transform_values.rs +6 -0
  492. data/src/rules/style/identical_conditional_branches.rs +368 -0
  493. data/src/rules/style/if_inside_else.rs +264 -0
  494. data/src/rules/style/if_unless_modifier.rs +844 -0
  495. data/src/rules/style/if_unless_modifier_of_if_unless.rs +63 -0
  496. data/src/rules/style/if_with_boolean_literal_branches.rs +202 -0
  497. data/src/rules/style/if_with_semicolon.rs +327 -0
  498. data/src/rules/style/implicit_runtime_error.rs +45 -0
  499. data/src/rules/style/in_pattern_then.rs +68 -0
  500. data/src/rules/style/infinite_loop.rs +199 -0
  501. data/src/rules/style/inline_comment.rs +34 -0
  502. data/src/rules/style/inverse_methods.rs +390 -0
  503. data/src/rules/style/invertible_unless_condition.rs +346 -0
  504. data/src/rules/style/ip_addresses.rs +108 -0
  505. data/src/rules/style/it_assignment.rs +56 -0
  506. data/src/rules/style/it_block_parameter.rs +260 -0
  507. data/src/rules/style/keyword_arguments_merging.rs +100 -0
  508. data/src/rules/style/keyword_parameters_order.rs +159 -0
  509. data/src/rules/style/lambda.rs +352 -0
  510. data/src/rules/style/lambda_call.rs +80 -0
  511. data/src/rules/style/line_end_concatenation.rs +124 -0
  512. data/src/rules/style/line_length_help.rs +262 -0
  513. data/src/rules/style/literal.rs +465 -0
  514. data/src/rules/style/magic_comment_format.rs +229 -0
  515. data/src/rules/style/map_chain.rs +47 -0
  516. data/src/rules/style/map_compact_with_conditional_block.rs +284 -0
  517. data/src/rules/style/map_into_array.rs +407 -0
  518. data/src/rules/style/map_join.rs +132 -0
  519. data/src/rules/style/map_to_hash.rs +91 -0
  520. data/src/rules/style/map_to_set.rs +63 -0
  521. data/src/rules/style/method_call_with_args_parentheses.rs +831 -0
  522. data/src/rules/style/method_call_without_args_parentheses.rs +154 -0
  523. data/src/rules/style/method_called_on_do_end_block.rs +71 -0
  524. data/src/rules/style/method_def_parentheses.rs +120 -0
  525. data/src/rules/style/method_preference.rs +30 -0
  526. data/src/rules/style/min_max.rs +67 -0
  527. data/src/rules/style/min_max_comparison.rs +117 -0
  528. data/src/rules/style/missing_else.rs +114 -0
  529. data/src/rules/style/missing_respond_to_missing.rs +69 -0
  530. data/src/rules/style/mixin_grouping.rs +163 -0
  531. data/src/rules/style/mixin_usage.rs +66 -0
  532. data/src/rules/style/mod.rs +316 -0
  533. data/src/rules/style/module_function.rs +76 -0
  534. data/src/rules/style/module_member_existence_check.rs +140 -0
  535. data/src/rules/style/multiline_block_chain.rs +64 -0
  536. data/src/rules/style/multiline_if_modifier.rs +107 -0
  537. data/src/rules/style/multiline_if_then.rs +42 -0
  538. data/src/rules/style/multiline_in_pattern_then.rs +56 -0
  539. data/src/rules/style/multiline_memoization.rs +107 -0
  540. data/src/rules/style/multiline_method_signature.rs +151 -0
  541. data/src/rules/style/multiline_ternary_operator.rs +157 -0
  542. data/src/rules/style/multiline_when_then.rs +42 -0
  543. data/src/rules/style/multiple_comparison.rs +231 -0
  544. data/src/rules/style/mutable_constant.rs +509 -0
  545. data/src/rules/style/negated_if.rs +95 -0
  546. data/src/rules/style/negated_if_else_condition.rs +176 -0
  547. data/src/rules/style/negated_unless.rs +54 -0
  548. data/src/rules/style/negated_while.rs +77 -0
  549. data/src/rules/style/negative_array_index.rs +257 -0
  550. data/src/rules/style/nested_file_dirname.rs +101 -0
  551. data/src/rules/style/nested_modifier.rs +161 -0
  552. data/src/rules/style/nested_parenthesized_calls.rs +133 -0
  553. data/src/rules/style/nested_ternary_operator.rs +112 -0
  554. data/src/rules/style/next.rs +380 -0
  555. data/src/rules/style/nil_comparison.rs +117 -0
  556. data/src/rules/style/nil_lambda.rs +135 -0
  557. data/src/rules/style/nodes.rs +129 -0
  558. data/src/rules/style/non_nil_check.rs +109 -0
  559. data/src/rules/style/not.rs +109 -0
  560. data/src/rules/style/numbered_parameters.rs +42 -0
  561. data/src/rules/style/numbered_parameters_limit.rs +89 -0
  562. data/src/rules/style/numeric_literal_prefix.rs +136 -0
  563. data/src/rules/style/numeric_literals.rs +7 -6
  564. data/src/rules/style/numeric_predicate.rs +260 -0
  565. data/src/rules/style/object_then.rs +59 -0
  566. data/src/rules/style/one_class_per_file.rs +44 -0
  567. data/src/rules/style/one_line_conditional.rs +245 -0
  568. data/src/rules/style/open_struct_use.rs +78 -0
  569. data/src/rules/style/operator_method_call.rs +185 -0
  570. data/src/rules/style/option_hash.rs +95 -0
  571. data/src/rules/style/optional_arguments.rs +42 -0
  572. data/src/rules/style/optional_boolean_parameter.rs +43 -0
  573. data/src/rules/style/or_assignment.rs +136 -0
  574. data/src/rules/style/parallel_assignment.rs +375 -0
  575. data/src/rules/style/parameters.rs +97 -0
  576. data/src/rules/style/parens.rs +123 -0
  577. data/src/rules/style/parentheses_around_condition.rs +210 -0
  578. data/src/rules/style/partition_instead_of_double_select.rs +401 -0
  579. data/src/rules/style/percent.rs +132 -0
  580. data/src/rules/style/percent_array.rs +326 -0
  581. data/src/rules/style/percent_literal_delimiters.rs +99 -0
  582. data/src/rules/style/percent_q_literals.rs +80 -0
  583. data/src/rules/style/perl_backrefs.rs +70 -0
  584. data/src/rules/style/predicate_with_kind.rs +118 -0
  585. data/src/rules/style/preferred_hash_methods.rs +43 -0
  586. data/src/rules/style/proc.rs +41 -0
  587. data/src/rules/style/quoted_symbols.rs +218 -0
  588. data/src/rules/style/raise_args.rs +183 -0
  589. data/src/rules/style/random_with_offset.rs +169 -0
  590. data/src/rules/style/ranges.rs +32 -0
  591. data/src/rules/style/reduce_to_hash.rs +236 -0
  592. data/src/rules/style/redundant_argument.rs +133 -0
  593. data/src/rules/style/redundant_array_constructor.rs +80 -0
  594. data/src/rules/style/redundant_array_flatten.rs +81 -0
  595. data/src/rules/style/redundant_assignment.rs +165 -0
  596. data/src/rules/style/redundant_begin.rs +463 -0
  597. data/src/rules/style/redundant_capital_w.rs +47 -0
  598. data/src/rules/style/redundant_condition.rs +651 -0
  599. data/src/rules/style/redundant_conditional.rs +97 -0
  600. data/src/rules/style/redundant_constant_base.rs +56 -0
  601. data/src/rules/style/redundant_current_directory_in_path.rs +75 -0
  602. data/src/rules/style/redundant_double_splat_hash_braces.rs +196 -0
  603. data/src/rules/style/redundant_each.rs +150 -0
  604. data/src/rules/style/redundant_exception.rs +133 -0
  605. data/src/rules/style/redundant_fetch_block.rs +145 -0
  606. data/src/rules/style/redundant_file_extension_in_require.rs +60 -0
  607. data/src/rules/style/redundant_filter_chain.rs +106 -0
  608. data/src/rules/style/redundant_format.rs +859 -0
  609. data/src/rules/style/redundant_freeze.rs +210 -0
  610. data/src/rules/style/redundant_heredoc_delimiter_quotes.rs +119 -0
  611. data/src/rules/style/redundant_initialize.rs +161 -0
  612. data/src/rules/style/redundant_interpolation.rs +171 -0
  613. data/src/rules/style/redundant_interpolation_unfreeze.rs +121 -0
  614. data/src/rules/style/redundant_line_continuation.rs +327 -0
  615. data/src/rules/style/redundant_min_max_by.rs +88 -0
  616. data/src/rules/style/redundant_parentheses.rs +1105 -0
  617. data/src/rules/style/redundant_percent_q.rs +118 -0
  618. data/src/rules/style/redundant_regexp_argument.rs +192 -0
  619. data/src/rules/style/redundant_regexp_character_class.rs +376 -0
  620. data/src/rules/style/redundant_regexp_constructor.rs +75 -0
  621. data/src/rules/style/redundant_regexp_escape.rs +195 -0
  622. data/src/rules/style/redundant_return.rs +25 -24
  623. data/src/rules/style/redundant_self.rs +523 -0
  624. data/src/rules/style/redundant_self_assignment.rs +137 -0
  625. data/src/rules/style/redundant_self_assignment_branch.rs +109 -0
  626. data/src/rules/style/redundant_sort.rs +172 -0
  627. data/src/rules/style/redundant_sort_by.rs +70 -0
  628. data/src/rules/style/redundant_string_escape.rs +245 -0
  629. data/src/rules/style/redundant_struct_keyword_init.rs +132 -0
  630. data/src/rules/style/regexp_literal.rs +224 -0
  631. data/src/rules/style/require_order.rs +182 -0
  632. data/src/rules/style/rescue_modifier.rs +109 -0
  633. data/src/rules/style/rescue_standard_error.rs +66 -0
  634. data/src/rules/style/return_nil.rs +100 -0
  635. data/src/rules/style/return_nil_in_predicate_method_definition.rs +127 -0
  636. data/src/rules/style/reverse_find.rs +90 -0
  637. data/src/rules/style/safe_navigation.rs +1007 -0
  638. data/src/rules/style/safe_navigation_chain_length.rs +78 -0
  639. data/src/rules/style/sample.rs +245 -0
  640. data/src/rules/style/select_by.rs +269 -0
  641. data/src/rules/style/select_by_kind.rs +78 -0
  642. data/src/rules/style/select_by_range.rs +147 -0
  643. data/src/rules/style/select_by_regexp.rs +152 -0
  644. data/src/rules/style/self_assignment.rs +108 -0
  645. data/src/rules/style/semicolon.rs +4 -3
  646. data/src/rules/style/send.rs +26 -0
  647. data/src/rules/style/send_with_literal_method_name.rs +101 -0
  648. data/src/rules/style/signal_exception.rs +108 -0
  649. data/src/rules/style/single_argument_dig.rs +105 -0
  650. data/src/rules/style/single_line_block_params.rs +137 -0
  651. data/src/rules/style/single_line_do_end_block.rs +226 -0
  652. data/src/rules/style/single_line_methods.rs +373 -0
  653. data/src/rules/style/slicing_with_range.rs +263 -0
  654. data/src/rules/style/sole_nested_conditional.rs +503 -0
  655. data/src/rules/style/special_global_vars.rs +329 -0
  656. data/src/rules/style/stabby_lambda_parentheses.rs +71 -0
  657. data/src/rules/style/static_class.rs +172 -0
  658. data/src/rules/style/stderr_puts.rs +46 -0
  659. data/src/rules/style/string_chars.rs +49 -0
  660. data/src/rules/style/string_concatenation.rs +503 -0
  661. data/src/rules/style/string_hash_keys.rs +158 -0
  662. data/src/rules/style/string_literals.rs +14 -13
  663. data/src/rules/style/string_literals_in_interpolation.rs +45 -0
  664. data/src/rules/style/string_methods.rs +36 -0
  665. data/src/rules/style/strip.rs +53 -0
  666. data/src/rules/style/struct_inheritance.rs +178 -0
  667. data/src/rules/style/super_arguments.rs +278 -0
  668. data/src/rules/style/super_with_args_parentheses.rs +51 -0
  669. data/src/rules/style/swap_values.rs +103 -0
  670. data/src/rules/style/symbol_array.rs +170 -0
  671. data/src/rules/style/symbol_literal.rs +43 -0
  672. data/src/rules/style/symbol_proc.rs +356 -0
  673. data/src/rules/style/tally_method.rs +289 -0
  674. data/src/rules/style/ternary_parentheses.rs +288 -0
  675. data/src/rules/style/top_level_method_definition.rs +44 -0
  676. data/src/rules/style/trailing_body.rs +103 -0
  677. data/src/rules/style/trailing_body_on_class.rs +10 -0
  678. data/src/rules/style/trailing_body_on_method_definition.rs +20 -0
  679. data/src/rules/style/trailing_body_on_module.rs +10 -0
  680. data/src/rules/style/trailing_comma.rs +119 -0
  681. data/src/rules/style/trailing_comma_in_arguments.rs +72 -0
  682. data/src/rules/style/trailing_comma_in_array_literal.rs +24 -0
  683. data/src/rules/style/trailing_comma_in_block_args.rs +66 -0
  684. data/src/rules/style/trailing_comma_in_hash_literal.rs +25 -0
  685. data/src/rules/style/trailing_method_end_statement.rs +38 -0
  686. data/src/rules/style/trailing_underscore_variable.rs +151 -0
  687. data/src/rules/style/trivial_accessors.rs +339 -0
  688. data/src/rules/style/unless_else.rs +72 -0
  689. data/src/rules/style/unless_logical_operators.rs +102 -0
  690. data/src/rules/style/unpack_first.rs +91 -0
  691. data/src/rules/style/variable_interpolation.rs +45 -0
  692. data/src/rules/style/when_then.rs +46 -0
  693. data/src/rules/style/while_until_do.rs +39 -0
  694. data/src/rules/style/while_until_modifier.rs +288 -0
  695. data/src/rules/style/word_array.rs +188 -0
  696. data/src/rules/style/yaml_file_read.rs +88 -0
  697. data/src/rules/style/yoda_condition.rs +154 -0
  698. data/src/rules/style/yoda_expression.rs +110 -0
  699. data/src/rules/style/zero_length_predicate.rs +185 -0
  700. data/src/rules/support.rs +791 -1
  701. data/src/rules/visibility.rs +119 -0
  702. data/src/source.rs +31 -0
  703. metadata +649 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea2dfe101378c37802dfe7e5cf3a4e3c3595942c75c91c9f25ade094ab11e632
4
- data.tar.gz: 01e5d99dcd5989fee69f66403712918e792d0c268ea3b82096ec260dcfd3f176
3
+ metadata.gz: 267d186a55418ccb97a890bcea5da9eda428dd6567ae4282b61755779783d6e2
4
+ data.tar.gz: baa0dfdcff20c0a1888222298deab0fd2af37fd9fcd25ef8beb2871bb89083fc
5
5
  SHA512:
6
- metadata.gz: 726107889fe04bf60cf2f056c8ca7d34c5c825650426120281e9afa88d2c819d38d7342d99cdc45dd0b81a942011e5d130f6745fd7ee6cc6c5249663526d159d
7
- data.tar.gz: 51b76434f05a2b35cecc62eda0e3636592f7058ff123ab936872f577082502301a5c609828fc5d0659abd94f3d67291aa3dbc71ddd6ffc0be2fc344a13e0bf51
6
+ metadata.gz: 1f983d82729522d8a18d1155a4d9b1b6d020b837e987abc2d5bbf14558587997f1abf8808e69ae1e36132b6d15f8cac0d0cf440f116cb9280b98397d7b8f3c03
7
+ data.tar.gz: 2ffd0dd8db704b600fda62f08c1f61455fc36310f1adc33d4ae6f1bc1b2a53998c8034103a871e4e9e2b239f798a181a66982dafbda3d9b6ae0f5b74845d0887
data/CONFORMANCE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # RuboCop conformance
2
2
 
3
- Snapshot date: 2026-08-12
3
+ Snapshot date: 2026-08-14
4
4
  Reference: RuboCop 1.89.0 on Ruby 4.0.6
5
5
  Configuration: RuboCop 1.89.0 built-in defaults (`--force-default-config`) on both sides
6
6
 
@@ -9,32 +9,43 @@ Re-fetch it with `scripts/sync_default_yml.sh <rubocop-version>`.
9
9
 
10
10
  ## What is measured
11
11
 
12
- Five Ruby projects, 18,244 target files between them, are linted by both tools and compared offense
12
+ Five Ruby projects, 18,251 target files between them, are linted by both tools and compared offense
13
13
  by offense. An offense is keyed by cop name, path, line and column; at each shared key the last
14
14
  line, last column, length, message, severity and correctability are compared as well.
15
15
 
16
16
  | Corpus | Commit | Target files | Reference offenses |
17
17
  |---|---|---:|---:|
18
- | rubocop/rubocop | `e82df38` | 1,765 | 4,142 |
19
- | rails/rails | `729d2e9` | 3,550 | 117,541 |
20
- | ruby/ruby | `52975b7` | 7,465 | 603,331 |
21
- | Homebrew/brew | `5d49126` | 2,175 | 38,742 |
22
- | mastodon/mastodon | `e5db3aa` | 3,289 | 7,610 |
18
+ | rubocop/rubocop | `f009b33` | 1,765 | 5,766 |
19
+ | rails/rails | `62b5458` | 3,551 | 167,760 |
20
+ | ruby/ruby | `3349f41` | 7,466 | 761,578 |
21
+ | Homebrew/brew | `38ee325` | 2,179 | 49,920 |
22
+ | mastodon/mastodon | `fad3685` | 3,290 | 15,286 |
23
+
24
+ The commits are pinned because the numbers move with them: check the corpora out at these before
25
+ comparing, or a difference in the corpus will read as a difference in the port.
26
+
27
+ ruby/ruby's reference had to be assembled from chunked runs, and two files are excluded from it.
28
+ `test/ruby/test_regexp.rb` cannot be inspected at all — RuboCop's lexer raises `invalid byte
29
+ sequence in UTF-8` on it — and `test/ruby/test_file_exhaustive.rb` holds an offense whose text is
30
+ not valid UTF-8, which stops the JSON formatter from emitting a document. The comparison for that
31
+ corpus therefore covers 7,464 of its 7,466 files.
23
32
 
24
33
  The **target file lists match exactly** on all five — not just the counts but the paths. That is
25
34
  worth stating separately because file discovery is where a port silently diverges first: RuboCop
26
35
  never reads `.gitignore`, applies a shebang test only to extensionless files, descends through
27
36
  directory symlinks, and treats a hidden path by its *first* component rather than by any dot in it.
28
37
 
29
- Only the cops Sonicop implements are compared; the reference process is restricted to them with
30
- `--only`. RuboCop's extension plugins are not installed, so this measures the range that can be
31
- checked without them.
38
+ Sonicop implements **all 609 of RuboCop's cops**, matched name for name, with nothing extra on either
39
+ side. That includes the 159 RuboCop ships as `Enabled: pending` and the 56 it ships as
40
+ `Enabled: false`, neither of which a default run reaches — checking those means naming them with
41
+ `--only` or switching them on in a configuration, exactly as with RuboCop.
32
42
 
33
- ```bash
34
- cops=$(sonicop --show-cops --force-default-config \
35
- | grep -B3 'Implemented: true' | grep '^[A-Z].*:$' | tr -d ':' | paste -sd, -)
43
+ Because the two cop sets are identical, neither side is restricted with `--only`; the plain run is
44
+ already like for like. RuboCop's extension plugins are not installed, so this measures the range
45
+ that can be checked without them.
36
46
 
37
- rubocop --force-default-config --cache false --only "$cops" -f json
47
+ ```bash
48
+ rubocop --force-default-config --cache false -f json
38
49
  sonicop --force-default-config --format json
39
50
  ```
40
51
 
@@ -45,19 +56,48 @@ sonicop --force-default-config --format json
45
56
  | rubocop/rubocop | 0 | 0 | none |
46
57
  | rails/rails | 0 | 0 | none |
47
58
  | mastodon/mastodon | 0 | 0 | none |
48
- | Homebrew/brew | 253 | 996 | none |
49
- | ruby/ruby | 89 | 346 | 1 |
50
-
51
- Homebrew's remaining difference is entirely `Lint/Syntax`; every other cop matches exactly. Most of
52
- ruby/ruby's is too — 117 of the 346 missing and 70 of the 89 excess are `Lint/Syntax` itself. The
53
- rest follows from it: a file the two disagree about is inspected by one tool and skipped by the
54
- other, so every offense in it lands on one side of the ledger. Both are explained under
55
- *Known divergences*.
56
-
57
- Autocorrect is compared the same way, byte for byte over the whole tree: run `-a` (and separately
58
- `-A`) with both tools from a clean checkout and diff the results. On all four corpora measured this way —
59
- rubocop/rubocop, rails/rails, Homebrew/brew and mastodon/mastodon the corrected trees are
60
- **identical**.
59
+ | Homebrew/brew | 263 | 997 | none |
60
+ | ruby/ruby | 142 | 585 | 5 |
61
+
62
+ Three of the five agree offense for offense RuboCop's own tree, Rails and Mastodon — with no
63
+ excess, no shortfall and no metadata differences anywhere.
64
+
65
+ Homebrew's remaining difference is entirely `Lint/Syntax`; every other cop matches exactly. Much of
66
+ ruby/ruby's is too, with 117 of the 585 missing and 44 of the 142 excess being `Lint/Syntax` itself,
67
+ and the rest follows from it: a file the two disagree about is inspected by one tool and skipped by
68
+ the other, so every offense in it lands on one side of the ledger. Counting that through, 635 of the
69
+ 727 differences sit in files one tool or the other calls a syntax error, and they are spread thinly
70
+ across the Layout department rather than sitting in one cop. Of the 92 that do not, 77 are the
71
+ `Style/RedundantParentheses` case under *Differences that should not be closed*, which leaves 15 —
72
+ ten of them in TRICK entries or encoding fixtures. Both are explained under *Known divergences*.
73
+
74
+ ruby/ruby also carries five differences at positions both tools reported: two `correctable` flags and
75
+ one `last_column`/`length` pair, all on indentation cops inside files the two parse differently, plus
76
+ one `Lint/Syntax` message naming a different token (`tLCURLY` where RuboCop says `tLAMBEG`).
77
+
78
+ Autocorrect is compared the same way, byte for byte over the whole tree: run `-A` with both tools
79
+ from a clean checkout and diff the results.
80
+
81
+ | Corpus | Corrected tree |
82
+ |---|---|
83
+ | rubocop/rubocop | **identical** |
84
+ | mastodon/mastodon | **identical** |
85
+ | Homebrew/brew | 2 files differ |
86
+ | rails/rails | 25 files differ |
87
+ | ruby/ruby | not measurable |
88
+
89
+ RuboCop's own tree and Mastodon are the hard line: a change that breaks byte equality on either is a
90
+ regression to be fixed, not a new known divergence to be recorded.
91
+
92
+ The rails/rails residue is one shape, and Homebrew contributes one more of it: the body of a
93
+ `begin`/`rescue`/`end` ends up indented two columns off. It appears only in a full `-A` run — the
94
+ first-pass detection matches exactly, and reducing the case to a single file reproduces nothing —
95
+ because what differs is which correction pass a nested indentation fix lands in. Homebrew's other
96
+ file pairs a `disable`/`enable` around `Lint/EmptyBlock`, a cop RuboCop ships as pending; the
97
+ upstream run leaves both comments alone and Sonicop removes them.
98
+
99
+ ruby/ruby cannot be measured this way at all: RuboCop's own run does not finish on it (see *Reading a
100
+ measurement*), so there is no complete reference tree to diff against.
61
101
 
62
102
  Run the comparison on a copy of the corpus. Autocorrect rewrites the tree in place, so a run that
63
103
  shares a checkout with anything else — another comparison, a lint measurement — has both tools
@@ -70,13 +110,36 @@ Two traps make a run look better or worse than it is, and both have produced wro
70
110
  **Counts cancel out.** Comparing offense totals hides an excess and a shortfall of the same size.
71
111
  Compare the *set* of locations, then compare fields at the locations both tools produced.
72
112
 
73
- **RuboCop can stop early and still emit valid JSON.** On ruby/ruby its parser raises
74
- `invalid byte sequence in UTF-8` on `test/ruby/test_regexp.rb` and the whole run unwinds; the JSON
75
- formatter still writes a well-formed document from an `ensure` block. The result reports 6,924 of
76
- 7,465 files inspected, and the 541 files after that one in sort order were never looked at — so
77
- every offense Sonicop found in them counts as "excess". Check `summary.inspected_file_count`
78
- against `summary.target_file_count` on every run. To get a complete reference for that corpus, split
79
- the file list into chunks and re-run each chunk past the file that killed it.
113
+ **RuboCop can stop early.** On ruby/ruby its lexer raises `invalid byte sequence in UTF-8` on
114
+ `test/ruby/test_regexp.rb` and the whole run unwinds. A single-invocation run reports 6,909 of 7,466
115
+ files inspected, and the 557 files after that one in sort order were never looked at — so every
116
+ offense Sonicop found in them counts as "excess". Check `summary.inspected_file_count` against
117
+ `summary.target_file_count` on every run. To get a complete reference for that corpus, split the file
118
+ list into chunks and re-run each chunk past the file that killed it.
119
+
120
+ Read those two counts with `-f offenses`, not `-f json`: with the full cop set the JSON formatter
121
+ never gets to write them (see below), and the run looks like a crash rather than a truncation.
122
+
123
+ **And sometimes it emits nothing at all.** `test/ruby/test_file_exhaustive.rb` holds an offense whose
124
+ text is not valid UTF-8, and `JSONFormatter#finished` raises `source sequence is illegal/malformed
125
+ utf-8` while serializing — before a single byte reaches stdout. The failure is not per-file but
126
+ per-document: one such file discards the JSON for the entire run, summary included, which is why the
127
+ counts above have to come from another formatter.
128
+
129
+ Two things about this are easy to get backwards. **What matters is the encoding of the offense text,
130
+ not of the source.** `test/ruby/enc/test_euc_jp.rb` and `test/ruby/enc/test_shift_jis.rb` do hold
131
+ bytes that are not valid UTF-8, yet both serialize fine on their own — their magic comments make
132
+ RuboCop read them in their declared encoding — while `test_file_exhaustive.rb` is valid UTF-8 as a
133
+ file. **And which files are affected depends on the cop set, not on the corpus.** Running the full
134
+ 609 excludes two files from ruby/ruby; running `--only Lint/LiteralAsCondition,Layout/IndentationWidth`
135
+ excludes one, because neither of those two cops produces an offense whose text is ill-formed. A
136
+ recorded exclusion count is part of a measurement's conditions, not a property of the corpus.
137
+
138
+ A chunked reference run has to tell this apart from the case above: retrying one file at a time is
139
+ right when a file killed the parser, and useless when the run never had a chance to start. Two other
140
+ stdout notices break JSON the same way — `--parallel` being ignored under `--cache false`, and the
141
+ plugin suggestions RuboCop prints after a run — so a reference reader should skip to the first `{`
142
+ rather than trust byte zero.
80
143
 
81
144
  ## Known divergences
82
145
 
@@ -88,25 +151,72 @@ but no longer reproduces fails the test, and so does one that appears without be
88
151
  RuboCop parses with `parser`, an LALR parser that recovers from an error and keeps going, emitting
89
152
  further diagnostics from the recovered state. Sonicop parses with tree-sitter, which does not model
90
153
  that recovery, so the follow-on diagnostics cannot be reproduced. On Homebrew this accounts for the
91
- 996 missing `Lint/Syntax` offenses: `class definition in method body`, `dynamic constant assignment`,
154
+ 997 missing `Lint/Syntax` offenses: `class definition in method body`, `dynamic constant assignment`,
92
155
  `cannot assign to a keyword`, and repeated `unexpected token` inside one multi-line hash.
93
156
 
94
- The first diagnostic in each file does match, which is what decides whether the file is inspected at
95
- all: RuboCop runs no cop other than `Lint/Syntax` on a file that does not parse, and Sonicop does the
96
- same.
157
+ What the divergence does not change is **which** files are held to be unparseable, and that is what
158
+ decides whether a file is inspected at all: RuboCop runs no cop other than `Lint/Syntax` on a file
159
+ that does not parse, and Sonicop does the same. On Homebrew the two agree on the *set*, not merely on
160
+ its size: 569 files, with the difference in either direction empty. This is why every cop other than
161
+ `Lint/Syntax` matches exactly there despite the 1,260 offenses of difference.
162
+
163
+ The agreement is not universal. On ruby/ruby the sets differ by six files: 56 agree, five are flagged
164
+ only by Sonicop and one only by RuboCop. The five are TRICK contest entries — deliberately obfuscated
165
+ programs, one of which is English prose that happens to parse as Ruby — where tree-sitter reports an
166
+ error and `parser` does not. Those five hold 465 of that corpus's 773 differences.
167
+
168
+ Within Homebrew's 569 files the agreement is partial, as recovery cannot be reproduced: 499 report the
169
+ same first diagnostic (position and message), and 222 report an identical list end to end. The 277
170
+ files in between are the divergence in its purest form — the two agree on where the file first goes
171
+ wrong and part company on what follows. The 70
172
+ files whose first diagnostic differs follow one shape — an endless method definition (`def to_s =
173
+ to_str`, valid from Ruby 3.0, rejected by the default `TargetRubyVersion: 2.7`) leaves `parser`'s
174
+ method context open, so the enclosing `class` emits `class definition in method body` when it is
175
+ finally reduced. The diagnostic is reported at the `class` keyword, far above the line that actually
176
+ failed, which puts it first in source order.
177
+
178
+ ### What is left on ruby/ruby
179
+
180
+ ruby/ruby is the only corpus with a residue that is not one shape, so it is worth taking apart. Of
181
+ its 727 differences:
182
+
183
+ | | Count | |
184
+ |---|---:|---|
185
+ | in files one tool calls a syntax error | 635 | the recovery difference above |
186
+ | `Style/RedundantParentheses` in one file | 77 | RuboCop's defect, see below |
187
+ | everything else | 15 | |
188
+
189
+ The last 15 are the honest remainder. Ten of them sit in TRICK entries or encoding fixtures —
190
+ `Layout/SpaceInsideParens` five times in one obfuscated program, `Layout/TrailingWhitespace` and
191
+ `Layout/LeadingCommentSpace` on a UTF-16 fixture that holds no BOM. Three are the `"…"%[…]` lexing
192
+ gap described under *Grammar gaps*. That leaves two — `Lint/NestedMethodDefinition` on
193
+ `def (obj.bar = Object.new).baz` and `Style/MixinUsage` on a top-level `include RbConfig` — which
194
+ have not been investigated.
195
+
196
+ Naming that number is the point. It was 138 before the cop fixes that landed with the 609th cop, and
197
+ every step down came from taking one shape at a time rather than from a general improvement.
97
198
 
98
199
  ### Grammar gaps
99
200
 
100
201
  Where tree-sitter rejects code that Ruby accepts, Sonicop reports a syntax error and — following the
101
202
  rule above — reports nothing else for that file. One such gap costs every offense in the file at
102
203
  once, which makes them worth hunting: fixing eight lexer rules in the grammar fork took ruby/ruby
103
- from 24 affected files to 5, and the offenses Sonicop was missing there from 2,457 to 346.
204
+ from 24 affected files to 5, and cut the offenses Sonicop was missing there by more than sevenfold.
205
+ What is left moves with how many cops are implemented — one unparseable file costs every offense
206
+ every cop would have reported in it — so the shortfall grows as coverage does.
104
207
 
105
208
  What remains are constructs whose ambiguity Ruby resolves with information a grammar does not have.
106
209
  `$a?0:1` is the clearest: whether `?0` is a character literal or the start of a ternary depends on
107
210
  whether the token before it completed an expression, which in turn depends on knowing that `a` is a
108
211
  local variable rather than a method call.
109
212
 
213
+ A gap does not have to reject the file to cost offenses. `"%3d %s"%[l+1, line]` parses, but not as
214
+ Ruby reads it: a `%` written against a string literal can only be the operator, while tree-sitter
215
+ takes `%[…]` for a percent-literal string and yields two adjacent strings instead of a binary
216
+ operation. Nothing downstream can recover it — the operator node the cop would report on is not in
217
+ the tree — so `Layout/SpaceAroundOperators` misses both the `%` and the `+` nested inside the
218
+ brackets. Three offenses on ruby/ruby come from this, all on one line of `libexec/erb`.
219
+
110
220
  ### Encoding — the one deliberate difference
111
221
 
112
222
  RuboCop's autocorrect ends in a plain `File.write`, so a corrected Shift_JIS file is written back as
@@ -117,11 +227,43 @@ cp932 and you get mojibake, not the source you had.
117
227
  when the correction holds a character that encoding cannot represent, leaving the file untouched
118
228
  rather than substituting something else. Drop-in compatibility reaches a long way, but not as far as
119
229
  reproducing data loss on purpose. This is the only place Sonicop knowingly differs, and it only
120
- shows up on files that declare a non-UTF-8 encoding — 8 of the 18,244 files measured here.
230
+ shows up on files that declare a non-UTF-8 encoding — 8 of the 18,251 files measured here.
121
231
 
122
232
  A source declaring `ASCII-8BIT` or `binary` needs no such treatment: Ruby measures it one byte at a
123
233
  time, so Sonicop reads it that way too and the bytes go back out unchanged.
124
234
 
235
+ ## Differences that should not be closed
236
+
237
+ Everything above records a place Sonicop has not reached. This section records the opposite: a
238
+ difference where RuboCop is the one that is wrong, and matching it would mean discarding a correct
239
+ report. The two are worth separating, because a table that mixes them reads as though every
240
+ difference counts against the port.
241
+
242
+ On ruby/ruby's `test/-ext-/bignum/test_pack.rb`, `Style/RedundantParentheses` finds 3 offenses in
243
+ RuboCop and 79 in Sonicop. The 76 are real: they are `(-n)`, `(-n+1)` and `(+n-1)` written as method
244
+ arguments, the same shape RuboCop reports elsewhere in the same file and in a file of its own.
245
+
246
+ RuboCop drops them because of an unrelated line further down. Truncating the file shows it exactly:
247
+
248
+ ```
249
+ first 82 lines + a closing end → RuboCop reports 8
250
+ first 83 lines + a closing end → RuboCop reports 0 ← the 8 already reported are withdrawn
251
+ line 83 with \xFF changed to \x00 → RuboCop reports 9
252
+ ```
253
+
254
+ Line 83 is `assert_equal([-1, "\xFF"], Bug::Bignum.test_pack((-0x0FF), 1, 1, 0, BIG_ENDIAN))`, in a
255
+ file whose first line is `# coding: ASCII-8BIT`. Reading that far makes RuboCop abandon
256
+ `Style/RedundantParentheses` for the whole file, silently:
257
+
258
+ - it is specific to that cop — `Style/StringLiterals` still reports its 10 offenses in the same file
259
+ - it is not the cop-error path — `--raise-cop-error` says nothing
260
+ - the file is inspected — the run reports `inspected: 1` and simply finds no offense of that cop
261
+ - it is not a parse failure — neither tool emits `Lint/Syntax`, and `ruby -c` accepts the file
262
+ - a synthesised minimum does not reproduce it; the surrounding file is part of the trigger
263
+
264
+ Sonicop reports all 79. Bringing that down to 3 would mean suppressing correct output to match a
265
+ defect, so the difference stands as it is.
266
+
125
267
  ## Limits
126
268
 
127
269
  A clean run is a property of the corpora, not a general claim. `known_divergences.yml` carries the
@@ -129,6 +271,13 @@ current list of what these corpora never exercise; the main ones are non-default
129
271
  values, extension plugins, and Windows line endings. Cops that never fire contribute nothing to a
130
272
  match count, and their silence is indistinguishable from agreement.
131
273
 
274
+ The 215 cops RuboCop ships switched off are a limit of a different kind. They are implemented, but a
275
+ default run never reaches them, so the corpus numbers above say nothing about them. What stands
276
+ behind those is a separate measurement: the same corpora linted with all 609 cops switched on, on
277
+ both sides, and the residue classified. That is weaker evidence than it sounds — a cop that never
278
+ fires on these corpora contributes nothing either way — and the residue is not yet zero. The figures
279
+ for that run are tracked in `known_divergences.yml` rather than here, because they are still moving.
280
+
132
281
  Closing that gap properly means porting RuboCop's own spec suite, which exercises each cop against
133
282
  inputs written to break it. Until that lands, this document records what was measured.
134
283
 
data/Cargo.lock CHANGED
@@ -742,7 +742,7 @@ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
742
742
 
743
743
  [[package]]
744
744
  name = "sonicop"
745
- version = "26.8.102"
745
+ version = "26.8.104"
746
746
  dependencies = [
747
747
  "anyhow",
748
748
  "assert_cmd",
data/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "sonicop"
3
- version = "26.8.102"
3
+ version = "26.8.104"
4
4
  edition = "2024"
5
5
  rust-version = "1.85"
6
6
  description = "A fast, native RuboCop-compatible Ruby linter and formatter"
@@ -38,3 +38,10 @@ assert_cmd = "2.2.2"
38
38
  lto = "thin"
39
39
  codegen-units = 1
40
40
  strip = true
41
+
42
+ # `cargo build --profile profiling` keeps the symbols a sampling profiler needs while
43
+ # generating exactly the code `--release` does.
44
+ [profile.profiling]
45
+ inherits = "release"
46
+ debug = 1
47
+ strip = "none"
data/README.ja.md CHANGED
@@ -32,17 +32,18 @@ CI へ最小限の変更で導入できます。
32
32
 
33
33
  ## 主な機能
34
34
 
35
- Layout、Lint、Metrics、Naming、Security、Style の各部門の Cop を実装しています。
36
- 実装済みの Cop はリリースごとに増えるため、一覧はバイナリ自身が正本です。
35
+ Bundler、Gemspec、Layout、Lint、Metrics、Migration、Naming、Security、Style の各部門の Cop を実装しています。
36
+ 一覧はバイナリ自身が正本です。
37
37
 
38
38
  ```bash
39
39
  # 認識済み Cop と実装状況の一覧
40
40
  sonicop --show-cops
41
41
  ```
42
42
 
43
- RuboCop 1.89 の全 609 Cop を同梱設定として認識します。実装済み Cop は検査を実行し、
44
- 認識済みで未実装の Cop は既存設定を壊さず `--debug` で一覧表示します。本家にも存在しない
45
- Cop 名だけをエラーにし、必要なら `--ignore-unrecognized-cops` で続行できます。
43
+ **RuboCop 1.89 の全 609 Cop を実装しています。** 本家のレジストリと名前まで一致しており、
44
+ `Enabled: pending` 159 個と `Enabled: false` の 56 個も含みます。この 215 個は本家でも
45
+ 既定の実行では走らないので、`--only` で名指しするか設定で有効にしてください。本家にも
46
+ 存在しない Cop 名だけをエラーにし、必要なら `--ignore-unrecognized-cops` で続行できます。
46
47
 
47
48
  ## インストール
48
49
 
@@ -107,29 +108,47 @@ Ruby プラグイン実行、キャッシュ再利用、カスタム Cop、実
107
108
 
108
109
  ### 適合性
109
110
 
110
- 実装済み Cop は、正規化した JSON offense を使って RuboCop 1.89 との一致を検証済みです。
111
- 本家の全 1,759 ファイルを本家既定設定で検査した現在のスナップショットは、参照 4,052 件中
112
- 4,052 件すべての位置が一致(**recall 100%**)し、**誤検出とメタデータ差もともに 0 件**です。コマンド、比較範囲、測定結果は
113
- [CONFORMANCE.md](CONFORMANCE.md) にまとめています。Rails では Ruby 対象 3,453 ファイルと
114
- ルート/`guides/` の有効 Cop 一覧が完全一致し、全体の誤検出は 0 件です。
111
+ 実装済み Cop は、RuboCop 自身・Rails・Ruby・Homebrew・Mastodon 5 プロジェクト
112
+ 18,251 ファイルに対して、両者とも本家既定設定で検証しています。offense Cop 名・パス・
113
+ 行・桁・終端行・終端桁・長さ・メッセージ・重大度・修正可否のすべてで突き合わせます。
114
+
115
+ 5 つのうち 3 つが**完全一致**です。RuboCop 自身のツリー(5,766 件)、Rails(167,760 件)、
116
+ Mastodon(15,286 件)で、過剰も不足もメタデータ差もありません。対象ファイル一覧は 5 つすべてで
117
+ 一致します。残る差分は `Lint/Syntax` に集中しており、本家の LALR パーサが構文エラーから回復して
118
+ 出す追加診断を tree-sitter では再現できないことによるものです。autocorrect は RuboCop 自身のツリーと
119
+ Mastodon でバイト単位に一致します。この 2 つは死守ラインとして扱い、バイト一致が崩れた場合は
120
+ 既知差分ではなく退行として直します。
121
+
122
+ コマンド、コーパスごとの数値、この種の計測が誤った結論を導く 2 つの罠は
123
+ [CONFORMANCE.md](CONFORMANCE.md) にまとめています。
115
124
 
116
125
  ### 性能
117
126
 
118
- Rails 8.2.0.alpha のソースツリーで測定しました。両者とも同梱の既定設定
119
- (`--force-default-config`)で走らせているため Rails の `.rubocop.yml` は読まず、
120
- **対象ファイルは 3,550 件で完全に一致**しています。
127
+ 適合性検証に使う 5 コーパスすべてで測定しました。両者とも同梱の既定設定
128
+ (`--force-default-config`)で走らせているためプロジェクト側の `.rubocop.yml` は読まず、
129
+ どのコーパスでも**対象ファイル一覧は完全に一致**しています。
130
+
131
+ 両者とも既定の全 Cop で走らせています。**同じ 394 Cop** が名前まで一致しているため、
132
+ どちらも絞る必要がなく、素の実行がそのまま対等な比較になります。
133
+ 各値は暖機後 2 回の最速値です。
134
+
135
+ | コーパス | ファイル | RuboCop 並列 | Sonicop 並列 | RuboCop 単一 | Sonicop 単一 |
136
+ |---|---:|---:|---:|---:|---:|
137
+ | rubocop/rubocop | 1,765 | 11.49 秒 | **3.45 秒** | 42.49 秒 | **16.39 秒** |
138
+ | mastodon/mastodon | 3,290 | 27.26 秒 | **6.03 秒** | 42.07 秒 | **19.53 秒** |
139
+ | Homebrew/brew | 2,179 | 20.37 秒 | **5.36 秒** | 45.08 秒 | **16.03 秒** |
140
+ | rails/rails | 3,551 | 45.89 秒 | **18.96 秒** | 99.56 秒 | **44.61 秒** |
141
+ | ruby/ruby | 7,466 | 117.79 秒 | **54.97 秒** | 215.87 秒 | **100.62 秒** |
121
142
 
122
- | 実行条件 | RuboCop 1.89.0 | Sonicop 26.8.101 | 比 |
123
- |---|---:|---:|---:|
124
- | 同一の 28 Cop・並列 | 10.44 秒 | **2.78 秒** | 3.8 倍 |
125
- | 同一の 28 Cop・単一プロセス | 33.82 | **10.17 秒** | 3.3 倍 |
126
- | 各ツールが既定で有効にする全 Cop | 22.52 秒 *(394 Cop・並列)* | **2.78 秒** *(28 Cop・並列)* | — |
143
+ 差は並列で 2.1〜4.5 倍、単一プロセスで 2.1〜2.8 倍と幅があり、1 コーパスでは代表できません。
144
+ **単一プロセスの列を読み、並列は目安として扱ってください。** 同じ 2 つのバイナリを 1 日に
145
+ 3 回測ったところ、単一プロセスの値は毎回 16% 以内に収まったのに対し、RuboCop 自身のツリーでの
146
+ 並列の倍率は、マシンが他に何をしていたかだけで 3.3 倍から 9.2 倍まで動きました。単一プロセスは
147
+ エンジンを測っていますが、並列はエンジンに加えて「その実行でスケジューリングがそのツリーに
148
+ どれだけ噛み合ったか」を測っています。
127
149
 
128
- 最後の行は素で叩いたときの実測ですが、**対等な比較ではありません**。Sonicop RuboCop
129
- 609 Cop のうち 28 個しか実装しておらず、答えている問いがそもそも小さいためです。
130
- 上 2 行は RuboCop を同じ 28 Cop に絞ったもので、エンジンの速度差はこちらが実態を表します。
131
- この 28 Cop での検出数は 117,541 件中 243 件(0.2%)しか違わないため、
132
- 仕事を省いて速いわけではありません。
150
+ 仕事を省いて速いわけではありません。この同じ 394 Cop について、RuboCop 自身のツリーと
151
+ Mastodon では**すべての offense が一致**し、autocorrect もバイト単位で一致します。
133
152
 
134
153
  再現時に注意が必要な点が 2 つあります。RuboCop は **`--cache false` と併用すると
135
154
  `--parallel` を黙って無効化します**。そのためここでの並列実行はキャッシュを有効にしたうえで
@@ -138,16 +157,20 @@ Rails 8.2.0.alpha のソースツリーで測定しました。両者とも同
138
157
  Sonicop は `--no-parallel` を渡さない限り並列です。
139
158
 
140
159
  ```bash
141
- # RuboCop(並列・キャッシュは毎回空・Sonicop の実装済み Cop に限定)
160
+ # RuboCop(並列・キャッシュは毎回空・既定の全 394 Cop
142
161
  rubocop --force-default-config --cache true --cache-root "$(mktemp -d)" \
143
- --no-color --parallel --only "$COPS" -f quiet
162
+ --no-color --parallel -f quiet
144
163
 
145
164
  # Sonicop
146
165
  sonicop --force-default-config --format quiet
147
166
  ```
148
167
 
149
168
  測定機は Apple M2(8 コア)、Ruby 4.0.6(YJIT 利用可)、RubyGems 導入の RuboCop 1.89.0。
150
- 各値は暖機後 2〜3 回の最速値です。
169
+ 1 分平均のロードアベレージは、計測開始時が 3.6、終了時が 9.6 でした。**アイドル状態ではありません**。
170
+ 両者を同じ条件で測っているため倍率は保たれますが、秒数そのものは下限ではなく、静かなマシンなら
171
+ より速く出ます。コアを奪い合うものが動いていると両者とも膨らみ、その度合いは一致しません。それが
172
+ 並列の列があれだけ動く理由です。秒数そのものが重要なときは、他に負荷のない状態で測り、**実行の
173
+ 前後でロードアベレージを記録してください** — その情報が無い数値は、別の数値と比べられません。
151
174
 
152
175
  ## 開発
153
176
 
data/README.md CHANGED
@@ -32,17 +32,18 @@ existing editor and CI integrations with minimal changes.
32
32
 
33
33
  ## Features
34
34
 
35
- Sonicop implements cops in the Layout, Lint, Metrics, Naming, Security, and Style departments.
36
- The implemented set grows with each release, so the binary itself is the authoritative list:
35
+ Sonicop implements cops in the Bundler, Gemspec, Layout, Lint, Metrics, Migration, Naming,
36
+ Security, and Style departments. The binary itself is the authoritative list:
37
37
 
38
38
  ```bash
39
39
  # Every recognized cop and its implementation status
40
40
  sonicop --show-cops
41
41
  ```
42
42
 
43
- The bundled upstream configuration recognizes all 609 RuboCop 1.89 cops. Implemented cops run
44
- normally; recognized but not-yet-implemented cops remain configuration-compatible and are
45
- reported by `--debug`. Truly unknown cop names still fail validation unless
43
+ **All 609 RuboCop 1.89 cops are implemented**, matched name for name against the upstream registry.
44
+ That includes the 159 shipped as `Enabled: pending` and the 56 shipped as `Enabled: false`, which a
45
+ default run does not reach on either side name them with `--only` or switch them on in a
46
+ configuration, exactly as with RuboCop. Unknown cop names still fail validation unless
46
47
  `--ignore-unrecognized-cops` is supplied.
47
48
 
48
49
  ## Installation
@@ -117,15 +118,16 @@ reuse, custom Ruby cops, or cops outside the implemented set.
117
118
  ### Conformance
118
119
 
119
120
  The implemented cops are verified against RuboCop 1.89.0 over five Ruby projects — RuboCop itself,
120
- Rails, Ruby, Homebrew and Mastodon — totalling 18,244 files, with the upstream default
121
+ Rails, Ruby, Homebrew and Mastodon — totalling 18,251 files, with the upstream default
121
122
  configuration on both sides. Every offense is compared by cop, path, line, column, last line, last
122
123
  column, length, message, severity and correctability.
123
124
 
124
- Three of the five match **exactly**: RuboCop's own tree (4,142 offenses), Rails (117,541) and
125
- Mastodon (7,610), with no excess, no shortfall and no metadata differences. The target file lists
125
+ Three of the five match **exactly**: RuboCop's own tree (5,766 offenses), Rails (167,760) and
126
+ Mastodon (15,286), with no excess, no shortfall and no metadata differences. The target file lists
126
127
  match exactly on all five. What remains is concentrated in `Lint/Syntax`, where RuboCop's LALR
127
128
  parser recovers from an error and emits diagnostics a tree-sitter parse cannot reconstruct.
128
- Autocorrect is byte-identical on every corpus it was run against.
129
+ Autocorrect is byte-identical on RuboCop's own tree and on Mastodon, the two corpora held as a hard
130
+ line: a change that breaks byte equality there is a regression, not a new known divergence.
129
131
 
130
132
  See [CONFORMANCE.md](CONFORMANCE.md) for the commands, the per-corpus numbers, and the two ways a
131
133
  measurement of this kind can mislead you.
@@ -136,28 +138,27 @@ Measured over all five conformance corpora. Both tools were given their own bund
136
138
  configuration (`--force-default-config`), so neither reads the project's `.rubocop.yml`, and on every
137
139
  corpus the two resolve **the same file list**.
138
140
 
139
- RuboCop is restricted to the 28 cops Sonicop implements, which is the only like-for-like comparison
140
- available. Times are the fastest of two warmed runs.
141
+ Both tools run their full default set — **the same 394 cops**, matched name for name so neither
142
+ side is restricted and the comparison is like-for-like as it stands. Times are the fastest of two
143
+ warmed runs.
141
144
 
142
145
  | Corpus | Files | RuboCop parallel | Sonicop parallel | RuboCop single | Sonicop single |
143
146
  |---|---:|---:|---:|---:|---:|
144
- | rubocop/rubocop | 1,765 | 5.30 s | **1.41 s** | 20.88 s | **6.22 s** |
145
- | mastodon/mastodon | 3,289 | 3.77 s | **1.54 s** | 11.18 s | **5.67 s** |
146
- | Homebrew/brew | 2,175 | 8.52 s | **1.47 s** | 19.26 s | **5.20 s** |
147
- | rails/rails | 3,550 | 10.62 s | **5.07 s** | 32.89 s | **15.58 s** |
148
- | ruby/ruby | 7,465 | 27.31 s | **11.19 s** | 96.19 s | **34.85 s** |
149
-
150
- The gap is 2.1x to 5.8x in parallel and 2.0x to 3.7x single-process, so no single corpus summarizes
151
- it. The single-process column is the steadier of the two it measures the engines rather than how
152
- well each one's parallelism happens to fit the tree it was pointed at.
153
-
154
- Out of the box the two commands do different amounts of work RuboCop enables 394 cops by default
155
- against Sonicop's 28 so that comparison is **not** like-for-like. For the record, RuboCop's default
156
- parallel run takes 10.46 s on its own tree, 9.91 s on Mastodon, 10.83 s on Homebrew, 20.73 s on
157
- Rails and 75.05 s on Ruby.
158
-
159
- Over the 28 shared cops the two agree on **every offense** on RuboCop's own tree, on Rails and on
160
- Mastodon, so the speed is not bought by skipping work.
147
+ | rubocop/rubocop | 1,765 | 11.49 s | **3.45 s** | 42.49 s | **16.39 s** |
148
+ | mastodon/mastodon | 3,290 | 27.26 s | **6.03 s** | 42.07 s | **19.53 s** |
149
+ | Homebrew/brew | 2,179 | 20.37 s | **5.36 s** | 45.08 s | **16.03 s** |
150
+ | rails/rails | 3,551 | 45.89 s | **18.96 s** | 99.56 s | **44.61 s** |
151
+ | ruby/ruby | 7,466 | 117.79 s | **54.97 s** | 215.87 s | **100.62 s** |
152
+
153
+ The gap is 2.1x to 4.5x in parallel and 2.1x to 2.8x single-process, so no single corpus summarizes
154
+ it. **Read the single-process column and treat the parallel one as indicative.** Measuring the same
155
+ two binaries three times over a day put the single-process figures within 16% of each other every
156
+ time, while the parallel ratio on RuboCop's own tree moved between 3.3x and 9.2x purely with what
157
+ else the machine was doing. Single-process measures the engines; parallel measures the engines plus
158
+ how well each one's scheduling happens to fit that tree on that run.
159
+
160
+ The speed is not bought by skipping work: over those same 394 cops the two agree on **every offense**
161
+ on RuboCop's own tree and on Mastodon, and autocorrect there is byte-identical.
161
162
 
162
163
  Two details matter for reproducing this. RuboCop **silently turns `--parallel` off when combined
163
164
  with `--cache false`**, so its parallel runs here use a cache directory that is deleted before each
@@ -166,17 +167,21 @@ overstates the difference. RuboCop's default is a single process, while Sonicop
166
167
  `--no-parallel` is passed.
167
168
 
168
169
  ```bash
169
- # RuboCop, parallel, cold cache, restricted to the cops Sonicop implements
170
+ # RuboCop, parallel, cold cache, its full default set of 394 cops
170
171
  rubocop --force-default-config --cache true --cache-root "$(mktemp -d)" \
171
- --no-color --parallel --only "$COPS" -f quiet
172
+ --no-color --parallel -f quiet
172
173
 
173
174
  # Sonicop
174
175
  sonicop --force-default-config --format quiet
175
176
  ```
176
177
 
177
178
  Machine: Apple M2 (8 cores), Ruby 4.0.6 with YJIT available, RubyGems-installed RuboCop 1.89.0.
178
- Measure on an otherwise idle machine: anything else competing for cores inflates both sides
179
- unevenly, and a contended run here reported RuboCop's Rails time as 21 s rather than 10.6 s.
179
+ The one-minute load average was 3.6 when the run started and 9.6 when it finished — the machine was
180
+ in use, not idle. Both tools ran under the same conditions, so the ratios hold, but the absolute
181
+ seconds are not a floor: expect better on a quiet machine. Anything competing for cores inflates
182
+ both sides, and not by the same factor on each, which is what makes the parallel column move as much
183
+ as it does. If the absolute numbers matter to you, measure on an idle machine and record the load
184
+ either side of the run — a figure without that context cannot be compared with another one.
180
185
 
181
186
  ## Development
182
187
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Generated from Cargo.toml by `rake version:sync`. Do not edit by hand.
4
4
  module Sonicop
5
- VERSION = '26.8.102'
5
+ VERSION = '26.8.104'
6
6
  end