New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
One liners > Pipe summary in jq (no file) #33
Comments
Do you find this cool @tamere-allo-peter ? |
jerome@OPT17844:~/yamlfixer$ yamlfixer --jsonsummary bad.yml 2>&1 | jq
{
"filestofix": 1,
"passedstrictmode": 1,
"modified": 0,
"skipped": 0,
"notwriteable": 0,
"unknown": 0,
"details": {
"/home/jerome/yamlfixer/bad.yml": {
"status": "PASSED",
"issues": 0,
"handled": 0
}
}
}
jerome@OPT17844:~/yamlfixer$ |
@adriens Another way using only pipes (I had forgotten) : yamlfixer --jsonsummary <bad.yml 2>&1 >/dev/null | jq This way the fixed YAML code is sent to /dev/null but the JSON output is sent to stdout. Beware : if you invert the stderr and stdout redirections this won't do what you want. Order does matter ! |
I love piping commands, I must confess @tamere-allo-peter |
@tamere-allo-peter , here it is included into the documentation cf #37 |
ANy other oneLiner idea ❔ |
If not, i'll close the issue, maybe @mbarre could have some ? We could also wait for incoming questions ✔️ |
jerome@OPT17844:~/yamlfixer$ yamlfixer <bad.yml | yamllint --format parsable --strict -
jerome@OPT17844:~/yamlfixer$ echo $?
0
jerome@OPT17844:~/yamlfixer$ |
I'm adding it to the doc section ⚡ |
Added, just merge #37 |
@adriens : shouldn't we close this one ? |
Sure, I'm going to make a dedicated issue for code sample requests 👍 |
Context
Some of uf like one liners as they are cool and fun to use... and help promote nice looking shell scripts
Actions
The text was updated successfully, but these errors were encountered: