Commit Graph

41 Commits

Author SHA1 Message Date
Mike Farah 72a78472af Added tostring #72 2024-03-05 10:40:55 +11:00
Mike Farah 447bf28cd8 Introduced 'format' to encapsulate encoding and decoding formats together 2024-02-24 16:37:13 +11:00
Mike Farah 8f6d642012 Refactoring encoding configuration 2024-02-24 16:07:15 +11:00
Mike Farah 1d371b712f Refactoring encoding configuration 2024-02-24 15:59:12 +11:00
Mike Farah 55f6a3a49d Refactoring JSON encoder prefs 2024-02-24 15:48:59 +11:00
Mike Farah 7a01e216c4 Refactoring Yaml encoder prefs 2024-02-24 15:36:16 +11:00
Mike Farah f44d47a204 Refactoring Props encoder prefs 2024-02-24 15:14:21 +11:00
Mike Farah 2866e90c49 Refactoring XML encoder prefs 2024-02-24 15:03:30 +11:00
Mike Farah 571caa696a Refactoring Output types 2024-02-24 14:58:11 +11:00
Ryan Drew 2865022cf8
Add --properties-separator option (#1951)
This commit adds the --properties-separator option, which lets users
specify the separator used between keys and values in the properties
output format. This is done by adjusting the value of
github.com/magiconair/properties#Properties.WriteSeparator at encode
time.

Some refactoring of the properties encoder unit tests was done to make
it easier to write unit tests that include different separator values.

Fixes: #1864

Signed-off-by: Ryan Drew <ryan.drew@isovalent.com>
2024-02-20 10:57:44 +11:00
Mike Farah 9a8151d316 Added csv separator flag #1950 2024-02-17 19:11:41 +11:00
Mike Farah c32a9ceab8 Added new CSV option to turn off auto-parsing #1947 2024-02-15 13:11:53 +11:00
Mike Farah 010750daf6 Updated to latest golint 2024-01-11 13:17:34 +11:00
Mike Farah 13d1bbb45f
Generic ast (#1829)
Remove dependency on yaml.Node for internal AST representation. Yaml decoder is now just another decoder.
2023-10-18 12:11:53 +11:00
Abel Sen fa6fac1a76
Minor typos (#1595)
* Remove extra backtick

* Reword explanation of update

* Reword explanation of relative update

* Change "remaple" to "remain"

* Change "clovver" to "clobber"

* Reword explanation of update for comment operators

* Reword explanation of relative update for comment operators

* Change "array" to "expression"

* Change "the golangs" to "Golang's"

* Change "golangs" to "Golang's"

* Change "can durations" to "can add durations"

* Change "array scalars" to "arrays"

* Change "beit" to "be it"

* Fix typo in `eval` tip

* Fix typo in header for `has` operation

* Add space before pipe in `line` operator example

* Fix typos in explanation of deep array merges

* Change "is now used" to "is now used."

* Change "object," to "object."

* Changes "indexes" to "indices"

* Remove extraneous copied text from `..` article

* Reword explanation of `...` operator

* Change "your are" to "you are"

* Add link to `string` operator docs in `select` article

* Change "is a" to "parameter specifies" in `string` operators article

* Change "new line" to "newline"

* Change "golang regex" to "Golang's regex"

* Change "golang" to "Golang"

* Add period

* Remove comma in `subtract` article

* Remove duplicate number subtraction example

* Remove comma in `traverse` operator article

* Clarify use of brackets when `read`ing with special characters
2023-03-16 13:39:36 +11:00
Anders Björklund cf8cfbd865
Allow build without json and xml support (#1556)
* Refactor ordered_map into separate files

Separate json and xml, from the regular yaml.

Makes it possible to compile, without those...

* Refactor encoder and decoder creation

Use more consistent parameters vs globals

Return errors instead of calling panic()

* Allow build without json and xml support
2023-03-01 13:19:06 +11:00
Mike Farah d21bb920d6 Added shell string encoder (@sh) #1526 2023-02-02 12:23:08 +11:00
Mike Farah 6d7d76a3f1 Adds @uri/@urid #1529 2023-01-23 11:37:18 +11:00
Mike Farah 1d35134310 Unwrap scalar now works for JSON encoding when explicitly set #1409 2022-11-10 19:21:18 +11:00
Mike Farah 880397d549
Refactored decoder responsibilities (#1402)
- improved comment handling
- yaml decoder now responsible for leading content work around
2022-10-28 14:16:46 +11:00
Mike Farah 24bbffd71e xml prefs should be part of API 2022-10-25 14:27:16 +11:00
Mike Farah 6d6b693fb3
Added XML processing instructions and directive support (#1396) 2022-10-24 10:09:42 +11:00
Mike Farah c8815f5ab9
Csv decoder (#1290)
* WIP: adding CSV decoder

* Adding CSV decoder

* Added CSV roundtrip

* Fixing from review
2022-08-01 10:28:34 +10:00
Mike Farah b9a1ef89fe
Added NDJSON decoder (#1281) 2022-07-27 12:26:22 +10:00
Daniel Carbone 98b411f82e
adding support for --wrapScalar=false in properties encoder (#1241)
* adding support for --wrapScalar=false in properties encoder

* altering encoder and decoder tests somewhat

* adding .idea

* Revert "altering encoder and decoder tests somewhat"

This reverts commit e3655130e2.

* adding test scenario for encoding with wrapped scalars
2022-06-25 12:22:03 +10:00
rndmit b9309a42a4
XML decoder additions (#1239)
* Add xml-keep-namespace and xml-raw-token features

* Add tests

* Change flags usage strings

* Append docs
2022-06-15 09:40:31 +10:00
Mike Farah fbe49c3700 Added colors to json output #1208 2022-05-22 21:19:59 +10:00
Mike Farah 186b319093 Added from_props 2022-03-28 19:48:30 +11:00
Mike Farah bbeae229ca Disable strict XML parsing by default #1155 2022-03-28 14:05:10 +11:00
Mike Farah d9bca65626 Added base64 support 2022-02-23 09:26:35 +11:00
Mike Farah 26356ff4be Added github action fix for parsing xml, updated linter 2022-02-07 11:55:55 +11:00
Mike Farah ec8ef312ef
Added XML encoding/decoding (#1067)
* Added XML encoding/decoding

* Minor fixes

* Improve yq doc

* Lint
2022-01-15 11:57:59 +11:00
Mike Farah 2ee9c65bc2 Added global xml prefs for simplicity 2021-12-21 16:52:54 +11:00
Mike Farah df32baedf1
Added XML decoder (#1044) 2021-12-21 15:02:07 +11:00
Mike Farah df5128fa36 Added encoder tests 2021-12-02 20:06:51 +11:00
Mike Farah b44fecdfa5 Added key operator 2021-11-24 09:57:35 +11:00
Mike Farah 0b2688c0f1 Split printer 2021-10-30 10:04:41 +11:00
Mike Farah 91717b3c5d Can specify indent in encode ops 2021-10-24 11:35:40 +11:00
Mike Farah 587af7f722 Fixed newline handling in encoder/decoder 2021-10-22 15:21:01 +11:00
Mike Farah b1e64a0d80 Fixed newline handling when decoding/encoding 2021-10-22 14:53:39 +11:00
Mike Farah 7288d34778 Added decoder op 2021-10-22 12:37:47 +11:00