runger_style 5.0.1 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dccf9a541e8c8fecee3ac2e58f2af64712b64b42d26082a03fe200d0bc8ca3a8
|
4
|
+
data.tar.gz: 864f847dc6eaaf64f9b5dc1c7688fc6b8c77b7b19ac439e53da6bccacd9d4d54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18aeee3a6f58039e1d00bbf3a73eeea93331e3dddf35e85e7838edb98f4d82ccbb089f546de08bede5e48c697d380794f8fb471f4ed9c35887f05055e5885d47
|
7
|
+
data.tar.gz: c98d787a96ce2043a713d98d93cbe9e4f316c289e01852b0c901fc15216d014bc6a6260376e2449ffa22743b5ab743123894f5bcf590391dbb50c02b41f48078
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## v5.1.0 (2025-02-12)
|
2
|
+
- Monkeypatch `RuboCop::Cop::MultilineElementLineBreaks` so that arrays will be considered multiline if the array brackets are on separate lines (even if all elements are on a single line).
|
3
|
+
|
1
4
|
## v5.0.1 (2025-02-11)
|
2
5
|
- Fix `RungerStyle/MultilineHashValueIndentation` false positive on multiline keys.
|
3
6
|
|
data/Gemfile.lock
CHANGED
@@ -9,7 +9,7 @@ GIT
|
|
9
9
|
PATH
|
10
10
|
remote: .
|
11
11
|
specs:
|
12
|
-
runger_style (5.0
|
12
|
+
runger_style (5.1.0)
|
13
13
|
prism (>= 0.24.0)
|
14
14
|
rubocop (>= 1.68.0)
|
15
15
|
|
@@ -67,7 +67,7 @@ GEM
|
|
67
67
|
date
|
68
68
|
stringio
|
69
69
|
racc (1.8.1)
|
70
|
-
rack (3.1.
|
70
|
+
rack (3.1.10)
|
71
71
|
rainbow (3.1.1)
|
72
72
|
rake (13.2.1)
|
73
73
|
rdoc (6.12.0)
|
@@ -188,7 +188,7 @@ CHECKSUMS
|
|
188
188
|
pry-byebug (3.10.1)
|
189
189
|
psych (5.2.3) sha256=84a54bb952d14604fea22d99938348814678782f58b12648fcdfa4d2fce859ee
|
190
190
|
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
191
|
-
rack (3.1.
|
191
|
+
rack (3.1.10) sha256=5e873127d04704c8121528b1ce04c551b5493a78291cace896b059a2a44bcb12
|
192
192
|
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
193
193
|
rake (13.2.1) sha256=46cb38dae65d7d74b6020a4ac9d48afed8eb8149c040eccf0523bec91907059d
|
194
194
|
rdoc (6.12.0) sha256=7d6f706e070bffa5d18a448f24076cbfb34923a99c1eab842aa18e6ca69f56e0
|
@@ -211,7 +211,7 @@ CHECKSUMS
|
|
211
211
|
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
212
212
|
runger_byebug (11.4.0) sha256=569e22ba2215f57e7f69e145fcb63be401e29fcd312f7936d813e12d0c7bbee6
|
213
213
|
runger_release_assistant (2.0.0) sha256=f4f5708291eaeef1b881208f87a494877fe768739d6e96b7293fc335b28a3865
|
214
|
-
runger_style (5.0
|
214
|
+
runger_style (5.1.0)
|
215
215
|
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
|
216
216
|
slop (4.10.1) sha256=844322b5ffcf17ed4815fdb173b04a20dd82b4fd93e3744c88c8fafea696d9c7
|
217
217
|
stringio (3.1.2) sha256=204f1828f85cdb39d57cac4abc6dc44b04505a223f131587f2e20ae3729ba131
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RungerStyle::MultilineElementLineBreaksPatches
|
4
|
+
private
|
5
|
+
|
6
|
+
def check_line_breaks(node, children, ignore_last: false)
|
7
|
+
return if single_line?(node, children, ignore_last:)
|
8
|
+
|
9
|
+
last_seen_line = -1
|
10
|
+
children.each do |child|
|
11
|
+
if last_seen_line >= child.first_line
|
12
|
+
add_offense(child) do |corrector|
|
13
|
+
RuboCop::Cop::EmptyLineCorrector.insert_before(corrector, child)
|
14
|
+
end
|
15
|
+
else
|
16
|
+
last_seen_line = child.last_line
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def single_line?(node, children, ignore_last: false)
|
22
|
+
if node.array_type?
|
23
|
+
node.first_line == node.last_line
|
24
|
+
else
|
25
|
+
all_on_same_line?(children, ignore_last:)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
RuboCop::Cop::MultilineElementLineBreaks.prepend(
|
31
|
+
RungerStyle::MultilineElementLineBreaksPatches,
|
32
|
+
)
|
data/lib/runger_style/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runger_style
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Runger
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-02-
|
10
|
+
date: 2025-02-13 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: prism
|
@@ -71,6 +71,8 @@ files:
|
|
71
71
|
- lib/runger_style/cops/multiline_hash_value_indentation.rb
|
72
72
|
- lib/runger_style/cops/multiline_method_arguments_line_breaks.rb
|
73
73
|
- lib/runger_style/cops/require_all_custom_cops.rb
|
74
|
+
- lib/runger_style/cops/require_all_monkeypatches.rb
|
75
|
+
- lib/runger_style/monkeypatches/multiline_element_line_breaks.rb
|
74
76
|
- lib/runger_style/version.rb
|
75
77
|
- rulesets/capybara.yml
|
76
78
|
- rulesets/default.yml
|