YAML tool, a clone of the json.tool Python module for YAML.
Project description
YAML tool, a clone of the json.tool Python module for YAML.
This tool provides a simple command line interface to validate and pretty-print YAML documents while trying to preserve as much as possible from the original documents (like comments and anchors).
Usage
usage: yt [-h] [-i] [files ...]
YAML tool, a clone of the json.tool Python module for YAML.
This tool provides a simple command line interface to validate and pretty-print
YAML documents while trying to preserve as much as possible from the original
documents (like comments and anchors).
positional arguments:
files a YAML file to be validated or pretty-printed
optional arguments:
-h, --help show this help message and exit
-i, --in-place Perform the pretty-print in place, overwriting the existing files.
When enabling --in-place, all files are processed as input files.
When --in-place is not enabled and there are more then 2 files
passed, the last files is considered as the output file. If you
wish to pretty-print multiple files and output to standard out,
specify the last file as "-" .
Please note that specifying multiple input files will concatenate
them, resulting in a single file that has multiple documents.
pre-commit hook
YAML tool can be used as a pre-commit <https://pre-commit.com/> hook by
adding the following to your .pre-commit-config.yaml
file:
---
repos:
- repo: https://git.shore.co.il/nimrod/yamltool.git
rev: 0.1.0 # Check for the latest tag or run pre-commit autoupdate.
hooks:
- id: yamltool
License
This software is licensed under the MIT license (see the LICENSE.txt
file).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yamltool-0.1.0.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for yamltool-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bf2f153db466a8132f4c96399517a5a7f9f5695c756ab4695944a7e2bd7967f |
|
MD5 | de88e83502dd306d202ab7512111ff76 |
|
BLAKE2b-256 | 1dc3b4c4034c94222f59d6952350ce788122ba3a5c1be3398375279fac502443 |