Commit Graph

35 Commits

Author SHA1 Message Date
guoguangwu
04f3751f08
chore: remove refs to deprecated io/ioutil (#716) 2024-06-10 21:27:07 +01:00
Rohit Jangid
aece6e9b90
feat: add more crypto functions (#699)
* feat: add more crypto functions
2023-06-13 17:18:02 +01:00
Jonathan Regehr
123396675b
Adds jsonnet-lint to the releases (#664) 2023-01-16 20:12:40 +00:00
Jesse
2655afd2bd
memory align structs (#635)
feat: align most structs and add lint rule to enforce struct alignment
2022-10-19 06:19:15 +01:00
Dave Cunningham
44ec256189 Fix wasm 2022-05-24 19:53:19 +01:00
Dave Cunningham
2f2f6d664f Add wasm build 2021-09-09 12:45:53 +01:00
Tsuyoshi Hombashi
51daeb3229
Modify jsonnet-lint to accept multiple input files (#545)
Modify jsonnet-lint to accept multiple input files
2021-07-01 13:10:51 +02:00
Stanisław Barzowski
5899996502 Make go linter happy again. 2021-05-19 15:10:49 +02:00
Simon Let
415d036e5e Put AddPlusObject behind an option, rename FixPlusObject 2021-04-29 22:55:07 +02:00
Hanyu Cui
cd59751527
Distinguish go-jsonnet from cpp-jsonnet in version message (#497)
Distinguish the Go implementation in the version message
2021-01-13 20:46:15 +01:00
Stanisław Barzowski
4beab6633f Prevent keeping files open for too long.
Fixes #485.
2020-12-21 01:14:30 +01:00
Stanisław Barzowski
b70cbd441a Anonymous Import Locations
We used to treat dummy paths like <stdin>, <std>, <extvar> as
real import locations, which causes obvious problem for importers.

After this change we consistently pass "" (an empty string) as location
for non-imported paths.

We exposed new functions to properly handle all paths.

The first function family, EvaluateFile* which allow evaluating
a Jsonnet program at a specified importable path. It should
be used in most cases.

The second function family, EvaluateAnonymousSnippet* allows evaluating
a snippet without an importable path. It should be used for situations
like the code passed as a commandline argument, stdin, etc.

The old function family, EvaluateSnippet* is now deprecated, but
works the same as before, i.e. the passed filenames are treated
as imported paths.

Changes are required to custom importers to make sure they satisfy
the refined contract.

Fixes #329.
2020-09-08 17:27:47 +02:00
Stanisław Barzowski
8fcbda5b50 Linter 2020-08-13 21:06:34 +02:00
Varun B Patil
2e346e53e7 jsonnet-deps: Jsonnet static dependency parser
Fixes #833
2020-08-08 19:59:36 +02:00
Robert Vollmert
9e6b0d15b7 jsonnetfmt --help: Indent subsection and break long lines
For consistency of the formatting changes to jsonnet --help.
Minor phrasing and punctuation changes for consistency.
2020-07-02 23:04:34 +02:00
Robert Vollmert
678df37686 jsonnet --help: align consistently, break long lines
This fits the help text into 80 columns.
2020-07-02 23:04:34 +02:00
Robert Vollmert
e71d28e7c2 jsonnet --help: separate sections more clearly 2020-07-02 23:04:34 +02:00
sh0rez
4f4aa80dd7 feat(api): expose formatter
Exposes what I consider a good public API from the `internal/formatter`
package.

Having a go-native formatter is an awesome thing, especially because it
allows shipping the formatter as part of other projects. It's also fair
to keep the formatter's code in `internal`, yet third party projects
should have a way to use relevant parts of it.
2020-03-31 20:43:25 +02:00
Dave Cunningham
724650d358
Add native golang formatter (#388)
Add native golang formatter
2020-03-10 22:19:49 +00:00
Stanisław Barzowski
9ada769ce4 Make golangci-lint happy
Some of the suggestions are minor bug fixes (missing error handling).
2020-03-05 14:54:27 +01:00
Stanisław Barzowski
e4e1d9112a Fix Bazel config 2019-09-09 13:31:08 +02:00
Stanisław Barzowski
c77f22c99f Eliminate the unnecessary ast.StdAst
The initially empty ast.StdAst was created to break the circular
dependency. The generation of stdlib AST used to depend on
the primary "jsonnet" package, which meant that "jsonnet"
could not depend on it directly. Hence stdlib needed to be put
in the ast package. Now dumpstdlibast no longer depends on Jsonnet,
so we can get rid of this complication.

All code using ast.StdAst should now use astgen.StdAst.
2019-09-01 21:17:29 +02:00
Stanisław Barzowski
e6c74ca7a6 Address review comments 2019-08-28 20:16:47 +01:00
Stanisław Barzowski
82f949e7fe Extract AST processing to separate packages
Making it independent from the jsonnet package breaks the circular
dependency during stdast generation.
2019-08-28 20:16:47 +01:00
Steve Harris
7614fd519c Correct a few complaints reported by "staticcheck" 2019-06-15 01:34:11 +02:00
Steve Harris
2e6c559964 Don't automatically install the std AST into "ast" 2019-06-15 01:34:11 +02:00
Steve Harris
5b0d9c4da0 dumpstdlibast: Take source file path as parameter 2019-06-15 01:34:11 +02:00
Steve Harris
7a5297a884 Dump standard library into "astgen" package
Export all fields in struct types in the "ast" package to allow
generating program source to reconstruct their complete values in a
separate package.
2019-06-15 01:34:11 +02:00
Steve Harris
ad72eb0fbb Allow building the Go program with Bazel 2019-06-15 01:34:11 +02:00
Dave Cunningham
df7753e2c7 Bring up-to-date with cpp version 2019-05-22 20:43:37 +01:00
Stanisław Barzowski
c195e570ef Share std.jsonnet with cpp-jsonnet
So far `std.jsonnet` needed to be updated seprately from
the cpp-jsonnet submodule. Since we should update it anyway
at the same time (to make sure the tests are running fine),
we can just as well get it directly from there, eliminating
the extra step of copying the new `std.jsonnet` version.

This change updates the cpp-jsonnet used.
2019-04-16 20:35:19 +02:00
Michael Schuett
2188e2d62a Add go mod / cleanup (#266)
Add go mod

Also make the build docs nicer and cleanup the file directory to be in line
with most other go projects. This also make it so you can build jsonnet
without setting -o on go build.
2019-04-03 15:46:19 +02:00
Marcelo Cantos
88519c3704 Apply more golint recommendations (#201)
* Apply more golint recommendations

* Update dumpstdlibast.go to include StdAst comment

* Improve dump.go package comment.
2018-02-28 01:11:18 -05:00
Liang Mingqiang
8f568c1115 remove escLocalFS (#150)
* remove escLocalFS

* update README
2017-11-10 09:55:22 -05:00
Liang Mingqiang
aeda6138e5 experiment dump ast to source code (#101)
* Add facility to dump part of Go heap as Go code.

* Generate stdlib AST as Go code

* Use hardcoded stdlib AST instead of parsing it
2017-11-07 23:31:11 -05:00