yaml-sort 2.0.1 → 2.0.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
- data/CHANGELOG.md +10 -2
- data/lib/yaml/sort/parser.rb +50 -51
- data/lib/yaml/sort/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 125cdbf70a136c2968ab9c18f99cbfaa62e3f4117a577187a37f43298910a7c9
|
4
|
+
data.tar.gz: 58ed8f15a8cd027871e17dbc8ccd8293fd1be1e3242e2b12012ea1efc9f50c87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e2580f860075dd74a69c5e5a31097d906cbba4c9293a8f3181ee6fbf72cc931ca371cbf3b5258ed5ac93d356d2ed82f2805477f039799ea4cd293a39458a236
|
7
|
+
data.tar.gz: 00d35a112f355e53e0fca7d3bc63349dc6c1da2b87fc8195af480754b1e81f31049da97282679eef282d412c42d2ec7788689879c915a6697860408d01f9f5cd
|
data/CHANGELOG.md
CHANGED
@@ -3,9 +3,17 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
4
4
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
5
5
|
|
6
|
-
## [2.0.
|
6
|
+
## [2.0.2](https://github.com/smortex/yaml-sort/tree/2.0.2) (2022-06-10)
|
7
7
|
|
8
|
-
[Full Changelog](https://github.com/smortex/yaml-sort/compare/v2.0.
|
8
|
+
[Full Changelog](https://github.com/smortex/yaml-sort/compare/v2.0.1...2.0.2)
|
9
|
+
|
10
|
+
**Fixed bugs:**
|
11
|
+
|
12
|
+
- Fix infinite loops when processing files with trailing whitespace [\#9](https://github.com/smortex/yaml-sort/pull/9) ([smortex](https://github.com/smortex))
|
13
|
+
|
14
|
+
## [v2.0.1](https://github.com/smortex/yaml-sort/tree/v2.0.1) (2022-06-01)
|
15
|
+
|
16
|
+
[Full Changelog](https://github.com/smortex/yaml-sort/compare/v2.0.0...v2.0.1)
|
9
17
|
|
10
18
|
**Fixed bugs:**
|
11
19
|
|
data/lib/yaml/sort/parser.rb
CHANGED
@@ -30,43 +30,42 @@ def scan(text)
|
|
30
30
|
|
31
31
|
until s.eos?
|
32
32
|
if scan_value
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
break
|
51
|
-
end
|
52
|
-
end
|
53
|
-
emit(:VALUE, match)
|
54
|
-
when s.scan(/'/)
|
55
|
-
match = s.matched
|
56
|
-
loop do
|
57
|
-
match += s.scan_until(/'/)
|
58
|
-
break unless s.match?(/'/)
|
59
|
-
match += s.scan(/'/)
|
60
|
-
end
|
61
|
-
emit(:VALUE, match)
|
62
|
-
when s.scan(/\S+/)
|
63
|
-
match = s.matched
|
64
|
-
until s.match?(/[\n]/) || s.eos?
|
65
|
-
match += s.scan(/[^\n]+/)
|
33
|
+
@position += s.matched_size if s.scan(/[[:blank:]]*/)
|
34
|
+
case
|
35
|
+
when s.scan(/[|>][-+]?(?=\n)/)
|
36
|
+
match = s.matched
|
37
|
+
|
38
|
+
while s.match?("\n" + last_indent_value + " ")
|
39
|
+
match += s.scan(/\n[^\n]+(?=\n)/)
|
40
|
+
end
|
41
|
+
emit(:VALUE, match)
|
42
|
+
when s.scan(/"/)
|
43
|
+
match = s.matched
|
44
|
+
loop do
|
45
|
+
match += s.scan_until(/"|\\/)
|
46
|
+
if match[-1] == "\\"
|
47
|
+
match += s.scan(/.|\n/)
|
48
|
+
else
|
49
|
+
break
|
66
50
|
end
|
67
|
-
emit(:VALUE, match)
|
68
51
|
end
|
52
|
+
emit(:VALUE, match)
|
53
|
+
when s.scan(/'/)
|
54
|
+
match = s.matched
|
55
|
+
loop do
|
56
|
+
match += s.scan_until(/'/)
|
57
|
+
break unless s.match?(/'/)
|
58
|
+
match += s.scan(/'/)
|
59
|
+
end
|
60
|
+
emit(:VALUE, match)
|
61
|
+
when s.scan(/\S+/)
|
62
|
+
match = s.matched
|
63
|
+
until s.match?(/[\n]/) || s.eos?
|
64
|
+
match += s.scan(/[^\n]+/)
|
65
|
+
end
|
66
|
+
emit(:VALUE, match)
|
69
67
|
end
|
68
|
+
s.scan(/[[:blank:]]*/)
|
70
69
|
scan_value = false
|
71
70
|
else
|
72
71
|
case
|
@@ -88,23 +87,23 @@ def scan(text)
|
|
88
87
|
when s.match?(/./)
|
89
88
|
scan_value = true
|
90
89
|
else
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
90
|
+
message = if @lines[@lineno - 1][@position] == "\n"
|
91
|
+
<<~MESSAGE
|
92
|
+
#{@filename}:#{@lineno + 1}: unexpected content
|
93
|
+
#{@lines[@lineno].chomp}
|
94
|
+
^#{"~" * (@lines[@lineno].chomp.length - 1)}
|
95
|
+
MESSAGE
|
96
|
+
else
|
97
|
+
<<~MESSAGE
|
98
|
+
#{@filename}:#{@lineno}: unexpected content
|
99
|
+
#{@lines[@lineno - 1].chomp}
|
100
|
+
#{" " * @position}^
|
101
|
+
MESSAGE
|
102
|
+
end
|
103
|
+
raise(Racc::ParseError, message)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
108
107
|
|
109
108
|
unindent
|
110
109
|
|
data/lib/yaml/sort/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaml-sort
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Romain Tartière
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cri
|