Skip to content

Commit

Permalink
Merge branch 'main' of github.com:opt-nc/yamlfixer into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tamere-allo-peter committed Mar 17, 2022
2 parents 64194a9 + 4fa85f1 commit 155a579
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,46 @@ 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
}
}
}
```
### 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 <bad.yml | yamllint --format parsable --strict -
echo $?
```
# 🔖 Related contents
Expand Down

0 comments on commit 155a579

Please sign in to comment.