rufo 0.6.1 → 0.7.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 +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/rufo/file_finder.rb +1 -0
- data/lib/rufo/formatter.rb +16 -8
- data/lib/rufo/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: 4651dcdf170f65e4e0da813add1f99623939ab8704b78c48572188a65de85252
|
|
4
|
+
data.tar.gz: 0d846bca50b9f15142e94894866280afb1a7963b9c729d0de84d3f469c7c0aad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: af569cb8f398b61616546c2ba098e3fbe6ff576b0c7e0b467ef5bd181e6df90d4edae49f3e72a05b45de52c875e01cd9ed88ce2343af19a889efba571cdc4207
|
|
7
|
+
data.tar.gz: 75caf9bd7891406ee099eb8d707744ecf29f557a925b6c6b7d9108b7196ae52e793c7b53566af358f7676566e492c61b7a74af4ffbece87c6fb6c1b24b7f0e98
|
data/CHANGELOG.md
CHANGED
|
@@ -8,10 +8,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
8
8
|
|
|
9
9
|
### Fixed
|
|
10
10
|
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
11
13
|
### Added
|
|
12
14
|
|
|
15
|
+
## [0.7.0] - 2019-04-28
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
- Argument align with splat (issue [123](https://github.com/ruby-formatter/rufo/issues/123))
|
|
19
|
+
|
|
13
20
|
### Changed
|
|
14
21
|
|
|
22
|
+
### Added
|
|
23
|
+
- Support jbuilder files (issue [173](https://github.com/ruby-formatter/rufo/issues/173))
|
|
24
|
+
|
|
15
25
|
## [0.6.1] - 2019-04-27
|
|
16
26
|
|
|
17
27
|
### Fixed
|
data/lib/rufo/file_finder.rb
CHANGED
data/lib/rufo/formatter.rb
CHANGED
|
@@ -1513,24 +1513,32 @@ class Rufo::Formatter
|
|
|
1513
1513
|
# [:args_add_star, args, star, post_args]
|
|
1514
1514
|
_, args, star, *post_args = node
|
|
1515
1515
|
|
|
1516
|
+
if newline? || comment?
|
|
1517
|
+
needs_indent = true
|
|
1518
|
+
base_column = next_indent
|
|
1519
|
+
else
|
|
1520
|
+
base_column = @column
|
|
1521
|
+
end
|
|
1516
1522
|
if !args.empty? && args[0] == :args_add_star
|
|
1517
1523
|
# arg1, ..., *star
|
|
1518
1524
|
visit args
|
|
1519
|
-
|
|
1525
|
+
elsif !args.empty?
|
|
1520
1526
|
visit_comma_separated_list args
|
|
1527
|
+
else
|
|
1528
|
+
consume_end_of_line if needs_indent
|
|
1521
1529
|
end
|
|
1522
1530
|
|
|
1523
1531
|
skip_space
|
|
1524
1532
|
|
|
1525
1533
|
write_params_comma if comma?
|
|
1526
|
-
|
|
1534
|
+
write_indent(base_column) if needs_indent
|
|
1527
1535
|
consume_op "*"
|
|
1528
1536
|
skip_space_or_newline
|
|
1529
1537
|
visit star
|
|
1530
1538
|
|
|
1531
1539
|
if post_args && !post_args.empty?
|
|
1532
1540
|
write_params_comma
|
|
1533
|
-
visit_comma_separated_list post_args
|
|
1541
|
+
visit_comma_separated_list post_args, needs_indent: needs_indent, base_column: base_column
|
|
1534
1542
|
end
|
|
1535
1543
|
end
|
|
1536
1544
|
|
|
@@ -1747,16 +1755,16 @@ class Rufo::Formatter
|
|
|
1747
1755
|
end
|
|
1748
1756
|
end
|
|
1749
1757
|
|
|
1750
|
-
def visit_comma_separated_list(nodes)
|
|
1751
|
-
needs_indent = false
|
|
1752
|
-
|
|
1758
|
+
def visit_comma_separated_list(nodes, needs_indent: false, base_column: nil)
|
|
1753
1759
|
if newline? || comment?
|
|
1754
1760
|
indent { consume_end_of_line }
|
|
1755
1761
|
needs_indent = true
|
|
1756
1762
|
base_column = next_indent
|
|
1757
1763
|
write_indent(base_column)
|
|
1764
|
+
elsif needs_indent
|
|
1765
|
+
write_indent(base_column)
|
|
1758
1766
|
else
|
|
1759
|
-
base_column
|
|
1767
|
+
base_column ||= @column
|
|
1760
1768
|
end
|
|
1761
1769
|
|
|
1762
1770
|
nodes = to_ary(nodes)
|
|
@@ -1775,7 +1783,7 @@ class Rufo::Formatter
|
|
|
1775
1783
|
check :on_comma
|
|
1776
1784
|
write ","
|
|
1777
1785
|
next_token
|
|
1778
|
-
skip_space_or_newline_using_setting(:one, base_column
|
|
1786
|
+
skip_space_or_newline_using_setting(:one, base_column)
|
|
1779
1787
|
end
|
|
1780
1788
|
end
|
|
1781
1789
|
|
data/lib/rufo/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rufo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ary Borenszweig
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-04-
|
|
11
|
+
date: 2019-04-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|