Skip to content

Commit 0de68fd

Browse files
committed
Use a git submodule for the mustache spec tests
- Bump Mustache spec support from 1.4.1 to 1.4.2 - Update readme to reflect changes
1 parent 9091c4d commit 0de68fd

File tree

8 files changed

+142
-233
lines changed

8 files changed

+142
-233
lines changed

.github/workflows/msrv.yml

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
steps:
1818
- name: Fetch Repository
1919
uses: actions/checkout@v4
20+
with:
21+
submodules: true
2022

2123
- name: Install stable toolchain
2224
uses: actions-rust-lang/setup-rust-toolchain@v1
@@ -50,6 +52,8 @@ jobs:
5052
steps:
5153
- name: Fetch Repository
5254
uses: actions/checkout@v4
55+
with:
56+
submodules: true
5357

5458
- run: git pull
5559

.github/workflows/test.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ jobs:
1515
name: Test
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v4
18+
- name: Checkout repo and submodules
19+
uses: actions/checkout@v4
20+
with:
21+
submodules: true
1922
- uses: actions-rust-lang/setup-rust-toolchain@v1
2023
- uses: actions/cache@v4
2124
with:

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "ribboncurls/vendor/github.com/mustache/spec"]
2+
path = ribboncurls/vendor/github.com/mustache/spec
3+
url = https://github.com/mustache/spec.git

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ test_cli: build
1010
@echo "Running cli tests and lint"
1111
@echo "--------------------------"
1212
cargo fmt -p ribboncurls-cli --check || { echo "Formatting check failed"; exit 1; }
13+
git submodule update --init
1314
cargo test -p ribboncurls-cli --release
1415

1516
test_lib: build
1617
@echo "--------------------------"
1718
@echo "Running lib tests and lint"
1819
@echo "--------------------------"
1920
cargo fmt -p ribboncurls --check || { echo "Formatting check failed"; exit 1; }
21+
git submodule update --init
2022
cargo test -p ribboncurls --release
2123

2224
build: install

README.md

+29-145
Original file line numberDiff line numberDiff line change
@@ -12,154 +12,37 @@
1212

1313
Ribboncurls is a [Mustache] template rendering engine written in [Rust].
1414

15-
There is both a Rust [Ribboncurls library] and [Ribboncurls CLI tool], depending
16-
on your needs. You can read more about those specific projects in their
17-
respective README.md files.
15+
There is both a Rust [Ribboncurls library] and [Ribboncurls CLI tool],
16+
depending on your needs. You can read more about those specific projects
17+
in their respective README.md files.
1818

1919
**Note**: Ribboncurls library public API is subject to change, so use
2020
with caution.
2121

22-
## Mustache spec tests
23-
24-
We run the [mustache spec tests] against the Ribboncurls lib and we are
25-
passing all 133 of 133 tests.
26-
27-
<details><summary>Tests</summary>
28-
✅ comments::inline<br>
29-
✅ comments::standalone<br>
30-
✅ comments::multiline_standalone<br>
31-
✅ comments::variable_name_collision<br>
32-
✅ comments::multiline<br>
33-
✅ comments::indented_inline<br>
34-
✅ comments::indented_standalone<br>
35-
✅ comments::indented_multiline_standalone<br>
36-
✅ comments::surrounding_whitespace<br>
37-
✅ comments::standalone_line_endings<br>
38-
✅ comments::standalone_without_previous_line<br>
39-
✅ comments::standalone_without_newline<br>
40-
✅ delimiters::pair_behavior<br>
41-
✅ delimiters::pair_with_padding<br>
42-
✅ delimiters::indented_standalone_tag<br>
43-
✅ delimiters::outlying_whitespace_inline<br>
44-
✅ delimiters::special_characters<br>
45-
✅ delimiters::standalone_tag<br>
46-
✅ interpolation::ampersand_context_miss_interpolation<br>
47-
✅ delimiters::surrounding_whitespace<br>
48-
✅ delimiters::standalone_without_newline<br>
49-
✅ delimiters::standalone_without_previous_line<br>
50-
✅ interpolation::ampersand<br>
51-
✅ delimiters::inverted_sections<br>
52-
✅ delimiters::standalone_line_endings<br>
53-
✅ delimiters::post_partial_behavior<br>
54-
✅ interpolation::ampersand_integer_interpolation<br>
55-
✅ delimiters::sections<br>
56-
✅ interpolation::ampersand_standalone<br>
57-
✅ interpolation::ampersand_decimal_interpolation<br>
58-
✅ interpolation::ampersand_with_padding<br>
59-
✅ interpolation::ampersand_null_interpolation<br>
60-
✅ interpolation::basic_context_miss_interpolation<br>
61-
✅ interpolation::ampersand_surrounding_whitespace<br>
62-
✅ interpolation::basic_null_interpolation<br>
63-
✅ interpolation::dotted_names_broken_chain_resolution<br>
64-
✅ interpolation::basic_decimal_interpolation<br>
65-
✅ interpolation::basic_integer_interpolation<br>
66-
✅ interpolation::dotted_names_arbitrary_depth<br>
67-
✅ interpolation::dotted_names_broken_chains<br>
68-
✅ interpolation::dotted_names_ampersand_interpolation<br>
69-
✅ interpolation::basic_interpolation<br>
70-
✅ delimiters::partial_inheritence<br>
71-
✅ interpolation::dotted_names_basic_interpolation<br>
72-
✅ interpolation::dotted_names_context_precedence<br>
73-
✅ interpolation::implicit_iterators_basic_integer_interpolation<br>
74-
✅ interpolation::html_escaping<br>
75-
✅ interpolation::dotted_names_initial_resolution<br>
76-
✅ interpolation::implicit_iterators_triple_mustache<br>
77-
✅ interpolation::interpolation_surrounding_whitespace<br>
78-
✅ interpolation::implicit_iterators_ampersand<br>
79-
✅ interpolation::dotted_names_triple_mustache_interpolation<br>
80-
✅ interpolation::interpolation_standalone<br>
81-
✅ interpolation::implicit_iterators_basic_interpolation<br>
82-
✅ interpolation::interpolation_with_padding<br>
83-
✅ interpolation::implicit_iterators_html_escaping<br>
84-
✅ interpolation::triple_mustache<br>
85-
✅ interpolation::no_interpolation<br>
86-
✅ interpolation::triple_mustache_surrounding_whitespace<br>
87-
✅ interpolation::triple_mustache_context_miss_interpolation<br>
88-
✅ interpolation::triple_mustache_standalone<br>
89-
✅ interpolation::triple_mustache_integer_interpolation<br>
90-
✅ interpolation::triple_mustache_null_interpolation<br>
91-
✅ interpolation::triple_mustache_with_padding<br>
92-
✅ interpolation::triple_mustache_decimal_interpolation<br>
93-
✅ inverted::context_misses<br>
94-
✅ inverted::context<br>
95-
✅ inverted::dotted_names_truthy<br>
96-
✅ inverted::falsey<br>
97-
✅ inverted::dotted_names_broken_chains<br>
98-
✅ inverted::empty_list<br>
99-
✅ inverted::dotted_names_falsey<br>
100-
✅ inverted::list<br>
101-
✅ inverted::doubled<br>
102-
✅ inverted::indented_inline_sections<br>
103-
✅ inverted::internal_whitespace<br>
104-
✅ inverted::nested_falsey<br>
105-
✅ inverted::padding<br>
106-
✅ inverted::null_is_falsey<br>
107-
✅ inverted::standalone_line_endings<br>
108-
✅ inverted::standalone_indented_lines<br>
109-
✅ inverted::nested_truthy<br>
110-
✅ inverted::standalone_lines<br>
111-
✅ inverted::truthy<br>
112-
✅ inverted::standalone_without_previous_line<br>
113-
✅ partials::failed_lookup<br>
114-
✅ inverted::standalone_without_newline<br>
115-
✅ inverted::surrounding_whitespace<br>
116-
✅ partials::standalone_without_previous_line<br>
117-
✅ partials::basic_behavior<br>
118-
✅ partials::context<br>
119-
✅ partials::padding_whitespace<br>
120-
✅ partials::inline_indentation<br>
121-
✅ sections::dotted_names_broken_chains<br>
122-
✅ sections::dotted_names_falsey<br>
123-
✅ partials::standalone_line_endings<br>
124-
✅ partials::standalone_indentation<br>
125-
✅ partials::nested<br>
126-
✅ partials::surrounding_whitespace<br>
127-
✅ sections::dotted_names_truthy<br>
128-
✅ partials::standalone_without_newline<br>
129-
✅ partials::recursion<br>
130-
✅ sections::context<br>
131-
✅ sections::empty_list<br>
132-
✅ sections::falsey<br>
133-
✅ sections::context_misses<br>
134-
✅ sections::doubled<br>
135-
✅ sections::implicit_iterator_html_escaping<br>
136-
✅ sections::implicit_iterator_decimal<br>
137-
✅ sections::implicit_iterator_root_level<br>
138-
✅ sections::implicit_iterator_ampersand<br>
139-
✅ sections::implicit_iterator_string<br>
140-
✅ sections::implicit_iterator_integer<br>
141-
✅ sections::implicit_iterator_array<br>
142-
✅ sections::indented_standalone_lines<br>
143-
✅ sections::implicit_iterator_triple_mustache<br>
144-
✅ sections::list<br>
145-
✅ sections::indented_inline_sections<br>
146-
✅ sections::internal_whitespace<br>
147-
✅ sections::padding<br>
148-
✅ sections::deeply_nested_contexts<br>
149-
✅ sections::standalone_lines<br>
150-
✅ sections::nested_falsey<br>
151-
✅ sections::parent_contexts<br>
152-
✅ sections::standalone_line_endings<br>
153-
✅ sections::null_is_falsey<br>
154-
✅ sections::list_contexts<br>
155-
✅ sections::standalone_without_newline<br>
156-
✅ sections::surrounding_whitespace<br>
157-
✅ sections::nested_truthy<br>
158-
✅ sections::variable_test<br>
159-
✅ sections::truthy<br>
160-
✅ sections::standalone_without_previous_line<br>
161-
</details>
162-
22+
## Features
23+
24+
Ribboncurls supports all the required Mustache features as per [Mustache
25+
spec] and runs against the [Mustache v1.4.2 spec] tests.
26+
27+
- [x] Comments: `12345{{! Comment Block! }}67890`
28+
- [x] Delimiters: Change delimiters from `{{ }}` to your own custom
29+
delimiters
30+
- `{{=<% %>=}}(<%text%>)`
31+
- [x] Interpolation
32+
- `{{text}}` - Renders escaped variable `text`
33+
- `{{&text}}`, `{{{text}}}` - Renders variable `text` without
34+
escaping
35+
- `{{a.b.c.d}}` - Renders HashMap properties
36+
- and more
37+
- [x] Sections
38+
- `{{#text}}Renders when text exists{{/text}}` - Renders section
39+
when `text` is truthy
40+
- `{{#animals_array}}({{.}}){{/list}}` - Implicit iterator
41+
- [x] Inverted: Functionally serves as inverted sections
42+
- `{{^text}}Renders when text does not exist{{/text}}`
43+
- [x] Partials: Used to expand an external template into the current
44+
template
45+
- `{{>partial_property}}`
16346

16447
## Code of Conduct
16548

@@ -182,4 +65,5 @@ license. See the [THIRD_PARTY_LICENSES] file for details.
18265
[MPL-2.0]: LICENSE
18366
[Code of Conduct]: https://github.com/tinted-theming/home/blob/main/CODE_OF_CONDUCT.md
18467
[THIRD_PARTY_LICENSES]: THIRD_PARTY_LICENSES.md
185-
[mustache spec tests]: https://github.com/mustache/spec
68+
[Mustache spec]: https://github.com/mustache/spec
69+
[mustache v1.4.2 spec]: https://github.com/mustache/spec/tree/v1.4.2

ribboncurls/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
## Added
6+
7+
- Bump support from Mustache spec 1.4.1 to 1.4.2
8+
59
## Fixed
610

711
- Remove unintended stdout prints.

0 commit comments

Comments
 (0)