Skip to content

Instantly share code, notes, and snippets.

@Per48edjes
Forked from nstielau/lint_json.sh
Created December 27, 2020 02:30
Show Gist options
  • Save Per48edjes/469642d6c8dd067029f4773929efddae to your computer and use it in GitHub Desktop.
Save Per48edjes/469642d6c8dd067029f4773929efddae to your computer and use it in GitHub Desktop.
A one-liner for validating json
# Lint JSON with python (the exit 255 stops xargs after the first failed command)
find . -name "*.json" -print | xargs -Ixx bash -c "echo JSON linting xx 1>&2; cat xx | python -mjson.tool > /dev/null || exit 255"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment