rubocop-socketry 0.1.0 → 0.1.2
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
- checksums.yaml.gz.sig +0 -0
- data/lib/rubocop/socketry/config.yaml +9 -0
- data/lib/rubocop/socketry/layout/consistent_blank_line_indentation.rb +20 -2
- data/lib/rubocop/socketry/plugin.rb +1 -1
- data/lib/rubocop/socketry/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd9a6a737fa0bd9a1c5a345b97f80a3c5f7446989637a009d60dc75f2a8c8d27
|
4
|
+
data.tar.gz: 3b09366eebd423d6e6f7415d37f5611f1f9c150e4cc14bf10d0ef7ef7ba309d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d730ded733718d3b8f467fd44f914178bc1ddb56d99527e1166e52264e58ff6ee2fd1918461a9e80dcd34efa0de6e099530706a4cc69bb2e1cd36041fd25695d
|
7
|
+
data.tar.gz: 44fd9c7673c2bac0e3ded94eb219dc5a707edc2e7fe89bba51e5a8d491c5f45558eff2837941eb3f86fd4ed406bced0057a8a3a35bd4dfba998b4bd7a22a477a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This is the default configuration file for rubocop-ioquatix.
|
4
|
+
# You can override any of these settings in your .rubocop.yml file.
|
5
|
+
|
6
|
+
Layout/ConsistentBlankLineIndentation:
|
7
|
+
Description: "Ensures that blank lines have the same indentation as the previous non-blank line."
|
8
|
+
Enabled: true
|
9
|
+
VersionAdded: "0.1.0"
|
@@ -53,6 +53,11 @@ module RuboCop
|
|
53
53
|
processed_source.lines.each_with_index do |line, index|
|
54
54
|
line_number = index + 1
|
55
55
|
|
56
|
+
unless delta = indentation_deltas[line_number]
|
57
|
+
# Skip this line (e.g., non-squiggly heredoc content):
|
58
|
+
next
|
59
|
+
end
|
60
|
+
|
56
61
|
# Check blank lines for correct indentation:
|
57
62
|
if line.strip.empty?
|
58
63
|
expected_indentation = indentation(current_level)
|
@@ -69,8 +74,6 @@ module RuboCop
|
|
69
74
|
end
|
70
75
|
end
|
71
76
|
|
72
|
-
# Apply indentation delta for this line:
|
73
|
-
delta = indentation_deltas[line_number] || 0
|
74
77
|
current_level += delta
|
75
78
|
end
|
76
79
|
end
|
@@ -99,6 +102,21 @@ module RuboCop
|
|
99
102
|
deltas[location.line] += 1
|
100
103
|
deltas[location.last_line] -= 1
|
101
104
|
end
|
105
|
+
when :dstr
|
106
|
+
if location = node.location
|
107
|
+
if body = location.heredoc_body
|
108
|
+
if location.expression.source.start_with?("<<~")
|
109
|
+
# Squiggly heredoc - indentation is significant, add deltas
|
110
|
+
deltas[body.line] += 1
|
111
|
+
deltas[body.last_line] -= 1
|
112
|
+
else
|
113
|
+
# Non-squiggly heredoc - ignore indentation on these lines
|
114
|
+
(body.line..body.last_line).each do |line|
|
115
|
+
deltas[line] = nil
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
102
120
|
end
|
103
121
|
|
104
122
|
node.children.each do |child|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-socketry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -72,6 +72,7 @@ extra_rdoc_files: []
|
|
72
72
|
files:
|
73
73
|
- agent.md
|
74
74
|
- lib/rubocop/socketry.rb
|
75
|
+
- lib/rubocop/socketry/config.yaml
|
75
76
|
- lib/rubocop/socketry/layout/consistent_blank_line_indentation.rb
|
76
77
|
- lib/rubocop/socketry/plugin.rb
|
77
78
|
- lib/rubocop/socketry/version.rb
|
metadata.gz.sig
CHANGED
Binary file
|