Commit Graph

61 Commits

Author SHA1 Message Date
D. Bohdan 38f247bf5a test: replace `unittest` setup w/ pytest fixtures 2023-11-18 18:52:47 +00:00
D. Bohdan f25d457212 fix(remarshal): fix mutable default argument 2023-11-02 08:10:49 +00:00
D. Bohdan 8dab0abe9a test(json2msgpack): add time zone and rm TZ `noqa` 2023-10-19 09:15:28 +00:00
D. Bohdan 808d44ac96 test: fix `bytes` type error
https://github.com/microsoft/pyright/issues/5697
2023-10-19 09:15:24 +00:00
D. Bohdan a071311ca1 build: convert to package 2023-09-28 09:17:45 +00:00
D. Bohdan c08bf7636e feat(cli): add `-f`/`-t`; hide `-if`/`-of` in help
`-f`/`--from` and `-t`/`--to` copy Pandoc and iconv(1).

`-if` and `-of` (with a single dash) are legacy options
from the Go days of Remarshal.
They are long overdue for hiding.
2023-09-28 09:17:45 +00:00
D. Bohdan c1b2ef082c feat(cli): add `--verbose` flag
Remove the function `remarshal.run`.
We can't keep using it from `main` with `--verbose`.
2023-09-28 09:17:45 +00:00
D. Bohdan 39de8cda6e refactor(remarshal)!: put format args first
BREAKING CHANGE: change the order of the arguments to `remarshal`.
2023-09-13 11:42:32 +00:00
D. Bohdan fe525e8051 refactor: prefix private API with underscores 2023-09-13 11:23:20 +00:00
D. Bohdan a707b09a5b feat(cli): rename `--max-nodes` to `--max-values`
Change internal references to "nodes", too. "Nodes" is specific to YAML,
while the limit isn't.
2023-09-05 13:14:45 +00:00
D. Bohdan fd6ac799a0 fix(yaml): limit maximum nodes
Prevent a billion laughs attack carried out with YAML anchors.

Thanks to Taichi Kotake of Akatsuki Inc. for finding this vulnerability
and to JPCERT/CC for reporting it.

JVN#86156389
2023-09-05 13:14:32 +00:00
D. Bohdan d95a1846b9 refactor: use `Path` for file ops 2023-08-23 07:05:53 +00:00
D. Bohdan 8feba65d7a test: add empty mapping test without stringify 2023-08-10 15:31:59 +00:00
D. Bohdan 4d99dabe08 feat(cli): change flag to `--stringify`; sort opts 2023-08-10 10:09:27 +00:00
D. Bohdan 3455cfebc2 feat: optionally stringify null values for TOML 2023-08-09 22:45:01 +00:00
D. Bohdan f0e9add739 feat!(cli): add `-k`/`--stringify-keys` flag
BREAKING CHANGE: make it no longer the default to stringify keys when
converting to JSON. This is being done to avoid silent incorrect
conversions and to turn them into errors. For example, GitHub Actions
workflows with an `on` YAML key are currently converted incorrectly.

Support stringifying keys for TOML.

v0.17.0
2023-08-09 21:45:51 +00:00
D. Bohdan 583a9e559c refactor: fill in types for mypy strict mode 2023-07-22 22:10:24 +00:00
D. Bohdan 121e622052 refactor: add types anns; simplify some func types 2023-07-19 11:47:18 +00:00
D. Bohdan 5c0bfb5107 fix(cli): set defaults for disabled options
This fixes short (`foo2bar`) commands. Change the `json_indent` default
from `None` to zero.
2023-07-19 03:36:23 +00:00
D. Bohdan b259420e1e feat(encode_yaml): add indent, width option
Add, recommend `--json-indent` for consistency.

v0.16.0
2023-07-18 21:18:48 +00:00
Christian Clauss 589594cf49 ci(github/lint): add lint action
Lint Python code with codespell and Ruff.
2023-07-09 07:55:30 +00:00
Christian Clauss 9590ab2f57 refactor: apply pyupgrade fixes
Closes #43.
2023-07-08 19:08:33 +00:00
D. Bohdan c0e2d346bb docs: capitalize "Remarshal" 2023-07-08 17:28:49 +00:00
D. Bohdan 434d8b2bd5 refactor: apply Ruff, mypy fixes; reformat 2023-07-08 17:23:43 +00:00
D. Bohdan 7e9d90c986 fix(encode_json): handle bool, null YAML keys
Fixes #38.
2023-07-08 16:34:37 +00:00
D. Bohdan 6606898c00 refactor(decode): remove argument `ordered`
We only support Python versions where the built-in dictionary preserves
insertion order.
2023-07-08 15:59:53 +00:00
D. Bohdan ca0ab3bc1f docs: update copyright 2023-07-08 15:27:46 +00:00
D. Bohdan 61d57795d9 refactor: drop Python 2.7, Python 3.5 2020-09-15 08:58:39 +00:00
D. Bohdan 2cd1bfcace feat(toml): support TOML 1.0.0-rc1
Switch from pytoml to TOML Kit.
2020-09-15 08:36:40 +00:00
D. Bohdan f70d112bf5 refactor(tests): replace camelCase w/ snake_case
Remove the unused function transformDateToIso().
2020-07-30 09:21:47 +00:00
D. Bohdan 9ff68f3fc0 refactor: move traverse() to tests 2020-07-30 09:15:31 +00:00
D. Bohdan be3c6fc9be build(tests): migrate to pytest 2020-06-02 20:23:37 +00:00
Felipe Gasper 79437388f0 test(cbor): skip json2cbor in Python 2 2020-03-13 16:44:58 +00:00
Felipe Gasper 9638e82981 test(cbor): restore Python 2 compat
List CBOR before JSON and the others in the docs.
2020-03-13 16:42:50 +00:00
Felipe Gasper 9789af5f89 test(cbor): add another test
Update the README.
2020-03-13 16:41:20 +00:00
Felipe Gasper 78382e13a8 feat(cbor): switch to cbor2; add tests 2020-03-13 16:41:09 +00:00
D. Bohdan ada67f2f97 docs: update copyright 2020-03-11 08:00:37 +00:00
dbohdan 6e579011f1 test: add missing tests/bin.{msgpack,yml} 2019-07-19 08:21:11 +00:00
dbohdan 54dd39e7ba fix: handle binary conv errors in Python 3
v0.11.1
2019-07-19 08:15:41 +00:00
dbohdan b84ac518e6 style: consistently indent multiline function args
Add a mention of MessagePack to the program description in
the help message.
2019-07-19 07:41:07 +00:00
dbohdan 32a3f9c627 fix(msgpack): encode Python 2 strs as strings 2019-07-18 19:24:51 +00:00
dbohdan f587cbde52 feat(msgpack): implement MessagePack support 2019-07-18 18:39:10 +00:00
dbohdan 058756c69e feat(cli): try to determine format from file ext 2019-04-05 21:24:03 +03:00
dbohdan da73e7d703 feat(cli): positional output arg, --if/--of
v0.10.0
2019-04-05 21:13:58 +03:00
dbohdan b782080197 chore: update copyright 2019-04-04 22:17:46 +03:00
dbohdan 74498e882b chore: update copyright 2018-10-12 21:22:41 +03:00
dbohdan 151c2e2a1b style: put keyword args on their own line 2018-10-12 21:21:40 +03:00
dbohdan e408edfea0 feat: add option to preserve key order 2018-10-12 21:21:06 +03:00
dbohdan 5204c5b09d test(run_no_output_dir): Use errno symbol 2018-05-07 12:07:44 +03:00
dbohdan 663c7e3223 fix(*): Use exceptions compatible with Python 2.7
Bump the version to 0.8.0.
2018-05-07 12:01:53 +03:00