1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-30 07:48:58 +01:00
Commit Graph

393 Commits

Author SHA1 Message Date
Oliver Steele
a24569655d Windows test cases: one more fix 2022-02-12 23:22:40 +08:00
Oliver Steele
8af3245933 Upgrade indirect dependencies 2022-02-12 23:03:18 +08:00
Oliver Steele
49f7daf257
Merge pull request #54 from kke/bind-env
Add --env for binding environment in the CLI tool
2022-02-12 23:00:46 +08:00
Oliver Steele
ddc4e45c83 Rename source.txt -> source.liquid; add env.liquid 2022-02-12 22:32:55 +08:00
Kimmo Lehto
ae6b280abe Add --env for binding environment in the CLI tool 2022-02-12 22:32:55 +08:00
Oliver Steele
c68221dd7e
Merge pull request #61 from osteele/fix-windows-paths
Fixed: include tag test cases failed on Windows
2022-02-12 22:31:23 +08:00
Oliver Steele
78fe71d224 Fixed: include tag test cases failed on Windows 2022-02-12 22:29:53 +08:00
Oliver Steele
f13e7dab1c Update for go1.17 tooling changes
- Update golang.org/x/tools
- `go get` -> `go install` stringer
2022-02-12 18:38:48 +08:00
Oliver Steele
2aa750df9d
Merge pull request #59 from carolynvs/expose-ast
Expose the template ast
2022-02-11 16:35:02 +08:00
Oliver Steele
26d973c198
Merge pull request #41 from heyvito/feat/cache
Add support to cached templates
2022-02-11 16:29:32 +08:00
Oliver Steele
4bd17f283c
Merge pull request #57 from danog/fix_trim
Stop trimming ASAP
2022-02-11 16:17:05 +08:00
Oliver Steele
1ee624ba54
Merge pull request #58 from danog/fix_concat
Add concat filter.
2022-02-07 18:21:25 +08:00
Carolyn Van Slyck
2e107bef29 Expose the template ast
Sometimes a consumer of a template needs to know what objects were used.
In my case, a template can reference secret values from a secret store
vault and instead of passing all possible secrets to the template only
to render two of them, we use the ast to determine which are used and
only retrieve those values from the vault before rendering the template.

Exposing the ast allows us to use the liquid APIs just like normal,
without having to jump through hoops to build the ast ourselves using
the other types exported in this library.

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
2022-01-31 16:18:38 -06:00
3c60e26a82
Stop trimming ASAP 2022-01-06 14:26:41 +01:00
f63f2db128
Avoid useless reallocations 2021-12-20 17:22:23 +01:00
87434b73b6
Add concat filter 2021-12-20 17:16:39 +01:00
Oliver Steele
5cbe290051 Document missing filter keyword parameter feature 2021-07-06 10:33:12 +08:00
Oliver Steele
94c219b2c3 Rename golantci-lint -> Lint; run only master 2021-07-06 10:33:12 +08:00
Oliver Steele
522f0b321b Rename go action -> Build Status; only apply to main and master 2021-07-06 10:33:12 +08:00
Oliver Steele
0bc5e4c93e
Merge pull request #47 from luminsmart/master
🐛 Fix MaxUint32 assignment to platform int
2021-07-05 14:32:28 +08:00
Oliver Steele
6e83bd2960 Add @bendoerr as a contributor 2021-07-05 14:29:24 +08:00
Oliver Steele
55b3f39dc3 Apply @bendoerr's fix, in previous commit, to generated file's source 2021-07-05 14:27:52 +08:00
Ben Doerr
c0ad3cec70 🐛 Fix MaxUint32 assignment to platform int
This fixes an issue where math.MaxUint32 is assigned to a platform
dependent int type. This works on 64-bit platforms without issue due to
there being plenty of space. On 32-bit platforms this is wrong and will
not compile as math.MaxUint32 > math.MaxInt32.
2021-07-05 14:20:55 +08:00
Oliver Steele
beafe4eb95 Add @Eun as a contributor 2021-06-27 11:06:14 +08:00
Oliver Steele
7d49ec0a4f Enable gofmt linter 2021-06-26 15:24:21 +08:00
Oliver Steele
28ae2b46b4 Update GitHub Action badge URLs 2021-06-26 15:07:52 +08:00
Oliver Steele
eb28891df5 Fix markdown lint errors 2021-06-26 14:54:25 +08:00
Oliver Steele
d4e2f72022 Replace Appveyor -> GitHub Actions matrix 2021-06-26 14:49:05 +08:00
Oliver Steele
81ead91790 Replace travis by GitHub action 2021-06-26 14:43:59 +08:00
Oliver Steele
7840a5e8b8 Removed unused require 2021-06-26 14:21:50 +08:00
Oliver Steele
c8e431bbb5 Move golangci-lint from Travis -> GitHub Actions 2021-06-26 14:17:44 +08:00
Ben Doerr
16e265c7d2 🐛 Fix MaxUint32 assignment to platform int
This fixes an issue where math.MaxUint32 is assigned to a platform
dependent int type. This works on 64-bit platforms without issue due to
there being plenty of space. On 32-bit platforms this is wrong and will
not compile as math.MaxUint32 > math.MaxInt32.
2021-06-23 09:55:26 -04:00
Oliver Steele
f7a10b7ade Update required go version 2021-06-18 13:32:36 +08:00
Oliver Steele
42035af9b1 Replace gometalinter -> golangci; fix lint errors 2021-06-16 18:42:31 +08:00
Oliver Steele
26c51e4252 Add go.mod 2021-06-16 18:41:53 +08:00
Oliver Steele
3b040ccfe2
Merge pull request #40 from imiskolee/master
1. support json.Number for parse into number types
2020-11-07 13:05:15 +08:00
Oliver Steele
26998e1688
Merge pull request #33 from Eun/master
floor and ceil should return integers
2020-11-07 12:59:56 +08:00
Vito Sartori
481fd9c7a3
Add support to cached templates 2020-11-02 21:41:26 -03:00
misko
dd12222409 1. fix 2019-12-20 19:51:52 +08:00
Tobias Salzmann
5540947bf1 force explicit type checking 2018-07-31 17:47:45 +02:00
Tobias Salzmann
7ae2fa24ed floor and ceil should return integers 2018-07-25 17:18:10 +02:00
Oliver Steele
e0ae1590bf
Add latest PR to CHANGELOG 2018-06-05 16:36:56 -04:00
Oliver Steele
b8970ec180
Add a CHANGELOG 2018-06-05 16:33:11 -04:00
Oliver Steele
4e0fda9afd
Re-organize README 2018-06-05 16:33:08 -04:00
Oliver Steele
20a3b002f5
Add make pre-commit; lint before testing 2018-06-05 16:33:07 -04:00
Oliver Steele
ca945a04d1
Merge pull request #30 from nsf/master
Properly handle implicit conversion to integer types.
2018-06-05 15:27:13 -04:00
nsf
c32908a4f3 Returning proper error type causes less panics during expression eval.
When user-defined function is called, it does convert all the arguments using
MustConvert, which panics on error with an error. However 'func (e expression)
Evaluate(ctx Context)' from sub package "expressions" catches those panics and
converts some of them to errors. Raw errors returned from strconv functions
are "repanicked", but proper error types such as values.TypeError are not.
Hence we should use it here.
2018-05-31 23:49:25 +05:00
nsf
4354d48a04 Properly handle implicit conversion to integer types.
Go's reflect API is very picky about arguments to Call method. You can't just
pass in the "int" when function expects "int64", even on 64 bit machines. This
patch solves this problem by performing conversions properly. Truncation
problems however, as well as negative to uint issues are completely ignored.
Which is perhaps not ideal, but still better than returning "int" when "int32"
or "int64" is requested.

I did split the Kind switch cases and moved value -> int and value -> float
conversions to separate functions. An alternative to that would be using the
reflection API, which might be less performant. Not that it matters much, but
this solution is correct, even though looks a bit copy & pasty.

Oh and of course all "uint" types were completely missing in the function and
they are now added.
2018-05-31 23:18:57 +05:00
Oliver Steele
aadc886acd Minor formatting fixes in the README 2018-05-30 20:54:10 +00:00
Oliver Steele
d2be34e2e9 Add Contributors section; add nsf as contributor; adopt All Contributors and all-contributors-cli 2018-05-30 20:50:25 +00:00