From fd0c2b5cf1edb906892d5b5a97c9d038f24d05bc Mon Sep 17 00:00:00 2001 From: SALES Date: Thu, 17 Mar 2022 08:28:51 +1100 Subject: [PATCH 1/2] One liners : pipe into jq cf #33 --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index f08e7da..88bedc5 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,36 @@ circumstances. ⚠️**Use at your own risk, you have been warned...** ⚠️ +# 💪 Tips and tips + +## ⏩ One liners + +Most of use love short and efficient command lines. Here are some ready to use ones : + +### Piping `json` summary through `jq` + +``` +yamlfixer --jsonsummary bad.yml 2>&1 | jq +``` + +So you can get a nicely colored (and vlidated `json` output) : + +```json + "filestofix": 1, + "passedstrictmode": 1, + "modified": 0, + "skipped": 0, + "notwriteable": 0, + "unknown": 0, + "details": { + "/home/jerome/yamlfixer/bad.yml": { + "status": "PASSED", + "issues": 0, + "handled": 0 + } + } +} +``` # 🔖 Related contents From c76f0a79b4d135037e6dc82f7066af9169f4b873 Mon Sep 17 00:00:00 2001 From: SALES Date: Thu, 17 Mar 2022 08:42:07 +1100 Subject: [PATCH 2/2] piping lint and fixing related to #33 --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 88bedc5..68aaef6 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,16 @@ So you can get a nicely colored (and vlidated `json` output) : } ``` +### Check if `yamlfixer` could fix a `yaml` and get the exit code + +See how piping fixing and linting can be intersting... and get exit code +so you can go furher in automation : + +``` +yamlfixer