shirobai 2026.0920.1100 → 2026.1011.1700
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.
- checksums.yaml +4 -4
- data/Cargo.lock +2 -2
- data/Cargo.toml +1 -1
- data/crates/shirobai-core/src/rules/abc_size.rs +1 -0
- data/crates/shirobai-core/src/rules/access_modifier_indentation.rs +2 -0
- data/crates/shirobai-core/src/rules/argument_alignment.rs +1 -0
- data/crates/shirobai-core/src/rules/arguments_forwarding.rs +2 -0
- data/crates/shirobai-core/src/rules/array_alignment.rs +1 -0
- data/crates/shirobai-core/src/rules/assignment_indentation.rs +1 -0
- data/crates/shirobai-core/src/rules/block_alignment.rs +1 -0
- data/crates/shirobai-core/src/rules/block_delimiters.rs +1 -0
- data/crates/shirobai-core/src/rules/block_length.rs +1 -0
- data/crates/shirobai-core/src/rules/block_nesting.rs +1 -0
- data/crates/shirobai-core/src/rules/bundle.rs +739 -403
- data/crates/shirobai-core/src/rules/class_length.rs +1 -0
- data/crates/shirobai-core/src/rules/closing_parenthesis_indentation.rs +1 -0
- data/crates/shirobai-core/src/rules/complexity.rs +1 -0
- data/crates/shirobai-core/src/rules/debugger.rs +1 -0
- data/crates/shirobai-core/src/rules/def_end_alignment.rs +2 -0
- data/crates/shirobai-core/src/rules/directive_scope.rs +124 -0
- data/crates/shirobai-core/src/rules/dot_position.rs +1 -0
- data/crates/shirobai-core/src/rules/duplicate_methods.rs +1 -0
- data/crates/shirobai-core/src/rules/else_alignment.rs +1 -0
- data/crates/shirobai-core/src/rules/empty_comment.rs +1 -0
- data/crates/shirobai-core/src/rules/empty_line_after_guard_clause.rs +1 -0
- data/crates/shirobai-core/src/rules/empty_line_after_magic_comment.rs +1 -0
- data/crates/shirobai-core/src/rules/empty_line_between_defs.rs +1 -0
- data/crates/shirobai-core/src/rules/empty_lines.rs +1 -0
- data/crates/shirobai-core/src/rules/empty_lines_around_arguments.rs +1 -0
- data/crates/shirobai-core/src/rules/empty_lines_around_body.rs +2 -0
- data/crates/shirobai-core/src/rules/end_alignment.rs +2 -0
- data/crates/shirobai-core/src/rules/file_null.rs +1 -0
- data/crates/shirobai-core/src/rules/first_argument_indentation.rs +1 -0
- data/crates/shirobai-core/src/rules/first_array_element_indentation.rs +1 -0
- data/crates/shirobai-core/src/rules/first_hash_element_indentation.rs +1 -0
- data/crates/shirobai-core/src/rules/hash_alignment.rs +1 -0
- data/crates/shirobai-core/src/rules/hash_each_methods.rs +1 -0
- data/crates/shirobai-core/src/rules/hash_syntax.rs +3 -1
- data/crates/shirobai-core/src/rules/hash_transform_keys.rs +1 -0
- data/crates/shirobai-core/src/rules/if_unless_modifier.rs +2 -0
- data/crates/shirobai-core/src/rules/indentation_consistency.rs +1 -0
- data/crates/shirobai-core/src/rules/indentation_width.rs +1 -0
- data/crates/shirobai-core/src/rules/leading_empty_lines.rs +1 -0
- data/crates/shirobai-core/src/rules/line_end_concatenation.rs +1 -0
- data/crates/shirobai-core/src/rules/line_length.rs +1 -0
- data/crates/shirobai-core/src/rules/line_length_breakable.rs +1 -0
- data/crates/shirobai-core/src/rules/method_length.rs +1 -0
- data/crates/shirobai-core/src/rules/method_name.rs +1 -0
- data/crates/shirobai-core/src/rules/misplaced_magic_comment.rs +232 -0
- data/crates/shirobai-core/src/rules/mod.rs +2 -0
- data/crates/shirobai-core/src/rules/module_length.rs +1 -0
- data/crates/shirobai-core/src/rules/multiline_method_call_brace_layout.rs +1 -0
- data/crates/shirobai-core/src/rules/multiline_method_call_indentation.rs +1 -0
- data/crates/shirobai-core/src/rules/multiline_operation_indentation.rs +1 -0
- data/crates/shirobai-core/src/rules/predicate_prefix.rs +1 -0
- data/crates/shirobai-core/src/rules/redundant_freeze.rs +1 -0
- data/crates/shirobai-core/src/rules/redundant_self.rs +1 -0
- data/crates/shirobai-core/src/rules/redundant_self_assignment.rs +1 -0
- data/crates/shirobai-core/src/rules/require_parentheses.rs +1 -0
- data/crates/shirobai-core/src/rules/safe_navigation_chain.rs +1 -0
- data/crates/shirobai-core/src/rules/self_assignment.rs +1 -0
- data/crates/shirobai-core/src/rules/semicolon.rs +1 -0
- data/crates/shirobai-core/src/rules/space_around_equals_in_parameter_default.rs +1 -0
- data/crates/shirobai-core/src/rules/space_around_keyword.rs +1 -0
- data/crates/shirobai-core/src/rules/space_around_method_call_operator.rs +1 -0
- data/crates/shirobai-core/src/rules/space_before_block_braces.rs +3 -1
- data/crates/shirobai-core/src/rules/space_inside_array_literal_brackets.rs +3 -1
- data/crates/shirobai-core/src/rules/space_inside_block_braces.rs +2 -1
- data/crates/shirobai-core/src/rules/space_inside_hash_literal_braces.rs +1 -0
- data/crates/shirobai-core/src/rules/space_inside_parens.rs +1 -0
- data/crates/shirobai-core/src/rules/space_inside_reference_brackets.rs +2 -1
- data/crates/shirobai-core/src/rules/space_inside_string_interpolation.rs +1 -0
- data/crates/shirobai-core/src/rules/stabby_lambda_parentheses.rs +1 -0
- data/crates/shirobai-core/src/rules/string_literals.rs +1 -0
- data/crates/shirobai-core/src/rules/string_literals_in_interpolation.rs +1 -0
- data/crates/shirobai-core/src/rules/trailing_comma.rs +1 -0
- data/crates/shirobai-core/src/rules/trailing_comma_in_arguments.rs +1 -0
- data/crates/shirobai-core/src/rules/trailing_empty_lines.rs +1 -0
- data/crates/shirobai-core/src/rules/useless_access_modifier.rs +1 -0
- data/crates/shirobai-core/src/rules/variable_number.rs +1 -0
- data/crates/shirobai-core/src/rules/void.rs +1 -0
- data/crates/shirobai-core/tests/bundle_slot_gate.rs +352 -0
- data/ext/shirobai/src/lib.rs +32 -1
- data/lib/shirobai/cop/lint/misplaced_magic_comment.rb +193 -0
- data/lib/shirobai/cop/style/directive_scope.rb +303 -0
- data/lib/shirobai/dispatch.rb +232 -8
- data/lib/shirobai/inject.rb +2 -0
- data/lib/shirobai/version.rb +1 -1
- metadata +6 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 97a258d6becce46c59a16ce1659d18d250d8892010e53b7209490c92bac0dcd8
|
|
4
|
+
data.tar.gz: 1bbeb45364147af576d9f9e8e5cbc5921744d810b6a728d66f6c4703d006b8af
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac3a9f7f093637230f0f1e5272994b8e39e70fc15b351fcca3352549480bd79767fc8f3f0a8de6697779b4b066a335010ab0af7b05f55a41552f127840ba03b1
|
|
7
|
+
data.tar.gz: 12762cd7df2a9be40e98236f569ac8ba1dda3e6ea6d3385129d94428063d0659b774a872dc74887d4065fe2c067a242fbb3dbf19d2c4ae1354ac99b0814e4d01
|
data/Cargo.lock
CHANGED
|
@@ -356,7 +356,7 @@ checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77"
|
|
|
356
356
|
|
|
357
357
|
[[package]]
|
|
358
358
|
name = "shirobai"
|
|
359
|
-
version = "2026.
|
|
359
|
+
version = "2026.1011.1700"
|
|
360
360
|
dependencies = [
|
|
361
361
|
"magnus",
|
|
362
362
|
"shirobai-core",
|
|
@@ -364,7 +364,7 @@ dependencies = [
|
|
|
364
364
|
|
|
365
365
|
[[package]]
|
|
366
366
|
name = "shirobai-core"
|
|
367
|
-
version = "2026.
|
|
367
|
+
version = "2026.1011.1700"
|
|
368
368
|
dependencies = [
|
|
369
369
|
"libc",
|
|
370
370
|
"ruby-prism",
|
data/Cargo.toml
CHANGED
|
@@ -7,7 +7,7 @@ resolver = "3"
|
|
|
7
7
|
# is crate 2026.709.0 -- cargo rejects leading zeros in numeric segments, and
|
|
8
8
|
# Gem::Version normalizes to the same integers, so the two stay value-equal).
|
|
9
9
|
[workspace.package]
|
|
10
|
-
version = "2026.
|
|
10
|
+
version = "2026.1011.1700"
|
|
11
11
|
|
|
12
12
|
# Release tuning. The hot path crosses crate boundaries (ext cdylib -> core
|
|
13
13
|
# check_* -> ruby-prism); without LTO the cross-crate calls are not inlined and
|
|
@@ -45,6 +45,7 @@ use super::complexity::{define_method_info, is_iterating};
|
|
|
45
45
|
/// Per-method ABC result. The Ruby side derives the score
|
|
46
46
|
/// (`Math.sqrt(a**2 + b**2 + c**2).round(2)`), the vector string and the
|
|
47
47
|
/// offense message, so floats never cross the FFI boundary.
|
|
48
|
+
#[derive(Debug)]
|
|
48
49
|
pub struct AbcMethod {
|
|
49
50
|
pub start_offset: usize,
|
|
50
51
|
pub end_offset: usize,
|
|
@@ -55,6 +55,7 @@ pub struct Config {
|
|
|
55
55
|
/// non-zero (the wrapper then emits an offense and an `AlignmentCorrector`
|
|
56
56
|
/// shift); `None` means the modifier already aligns with the configured style
|
|
57
57
|
/// (the wrapper calls `correct_style_detected`).
|
|
58
|
+
#[derive(Debug)]
|
|
58
59
|
pub struct AccessModifierIndentationRecord {
|
|
59
60
|
/// `bare_access_modifier?` send range (offense highlight).
|
|
60
61
|
pub start: usize,
|
|
@@ -63,6 +64,7 @@ pub struct AccessModifierIndentationRecord {
|
|
|
63
64
|
pub offense: Option<AccessModifierIndentationOffense>,
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
#[derive(Debug)]
|
|
66
68
|
pub struct AccessModifierIndentationOffense {
|
|
67
69
|
/// Formatted stock `MSG`: `"<Style> access modifiers like `<name>`."`.
|
|
68
70
|
pub message: String,
|
|
@@ -19,6 +19,7 @@ use super::line_index::LineIndex;
|
|
|
19
19
|
/// One misaligned argument. `column_delta` is `base_column - actual_column`
|
|
20
20
|
/// (display columns). `autocorrect` is false for offenses nested inside an
|
|
21
21
|
/// already-registered offense range (the mixin's `within?` rule).
|
|
22
|
+
#[derive(Debug)]
|
|
22
23
|
pub struct ArgAlignOffense {
|
|
23
24
|
pub start_offset: usize,
|
|
24
25
|
pub end_offset: usize,
|
|
@@ -61,6 +61,7 @@ pub struct Config {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/// One `add_offense` call in stock's order (range + message + corrector ops).
|
|
64
|
+
#[derive(Debug)]
|
|
64
65
|
pub struct AfOffense {
|
|
65
66
|
pub start: usize,
|
|
66
67
|
pub end: usize,
|
|
@@ -70,6 +71,7 @@ pub struct AfOffense {
|
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
/// A corrector op. `kind`: 0 replace, 1 remove, 2 insert_before, 3 insert_after.
|
|
74
|
+
#[derive(Debug)]
|
|
73
75
|
pub struct AfOp {
|
|
74
76
|
pub kind: u8,
|
|
75
77
|
pub start: usize,
|
|
@@ -35,6 +35,7 @@ use super::line_index::LineIndex;
|
|
|
35
35
|
/// One misaligned element. `column_delta` is `base_column - actual_column`
|
|
36
36
|
/// (display columns). `autocorrect` is false for offenses nested inside an
|
|
37
37
|
/// already-registered offense range (the mixin's `within?` rule).
|
|
38
|
+
#[derive(Debug)]
|
|
38
39
|
pub struct ArrayAlignOffense {
|
|
39
40
|
pub start_offset: usize,
|
|
40
41
|
pub end_offset: usize,
|
|
@@ -40,6 +40,7 @@ use super::line_index::LineIndex;
|
|
|
40
40
|
/// One misindented RHS first-line. `column_delta` is
|
|
41
41
|
/// `expected_column - actual_column` (positive => the RHS line must move
|
|
42
42
|
/// right). The message is fixed at `MSG`.
|
|
43
|
+
#[derive(Debug)]
|
|
43
44
|
pub struct AssignmentIndentationOffense {
|
|
44
45
|
/// `[rhs_start, rhs_end)` is the RHS's full source range. The offense
|
|
45
46
|
/// reports against this range; autocorrect shifts every line of it.
|
|
@@ -47,6 +47,7 @@ const STYLE_START_OF_BLOCK: u8 = 1;
|
|
|
47
47
|
const STYLE_START_OF_LINE: u8 = 2;
|
|
48
48
|
|
|
49
49
|
/// One checked block whose closing token is misaligned (an offense).
|
|
50
|
+
#[derive(Debug)]
|
|
50
51
|
pub struct BlockAlignmentOffense {
|
|
51
52
|
/// Closing token range (`end` or `}`) — the offense location.
|
|
52
53
|
pub end_start: usize,
|
|
@@ -62,6 +62,7 @@ pub struct Candidate {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/// The resolved (all-offenses-enabled) outcome for one source.
|
|
65
|
+
#[derive(Debug, Default)]
|
|
65
66
|
pub struct BlockDelimitersResult {
|
|
66
67
|
pub offenses: Vec<Candidate>,
|
|
67
68
|
/// Blocks ignored by `on_send`, for the wrapper's cross-pass bookkeeping.
|
|
@@ -8,6 +8,7 @@ use super::code_length::{CodeLength, Fold};
|
|
|
8
8
|
/// `AllowedMethods` exclusion (incl. receiver-qualified entries) is applied
|
|
9
9
|
/// here too; the regex-based `AllowedPatterns` filtering always stays on the
|
|
10
10
|
/// Ruby side, which has the exact regexp semantics.
|
|
11
|
+
#[derive(Debug)]
|
|
11
12
|
pub struct BlockLengthCandidate {
|
|
12
13
|
pub start_offset: usize,
|
|
13
14
|
pub end_offset: usize,
|
|
@@ -16,6 +16,7 @@ use ruby_prism::{Node, Visit};
|
|
|
16
16
|
/// One reportable offense: the byte range of the offending node. The highlight
|
|
17
17
|
/// is truncated to the first line by RuboCop's offense formatter, so only the
|
|
18
18
|
/// start offset (caret position) and first-line span matter.
|
|
19
|
+
#[derive(Debug)]
|
|
19
20
|
pub struct BlockNestingOffense {
|
|
20
21
|
pub start_offset: usize,
|
|
21
22
|
pub end_offset: usize,
|