Skip to content

Instantly share code, notes, and snippets.

@seiz
Last active November 23, 2021 20:28
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save seiz/c96ecef7d30093bd3fcb571a5cc83853 to your computer and use it in GitHub Desktop.
Save seiz/c96ecef7d30093bd3fcb571a5cc83853 to your computer and use it in GitHub Desktop.
BBedit Script to syntax check a JSON-File with jsonlint. Thanks to the new "bbresults", this is a piece of cake.
#!/bin/bash
/usr/local/bin/jsonlint -cq 2>&1 "$BB_DOC_PATH" | bbresults -e --pattern '(?P<file>.+?):\sline\s(?P<line>\d+),\scol\s((?P<col>\d+),)?\s+(?P<msg>.*)$'
@seiz
Copy link
Author

seiz commented Jul 15, 2016

To use such scripts in BBedit, drop them into ~/Library/Application Support/BBEdit/Scripts or wherever you store your BBedit "Application Support"-Folder. You'll then find them listed in BBedit's "Scripting"-Menu.

See also https://gist.github.com/seiz/00fdb1f3fb94871661995ba756e8b967 for a script to use jsonlint to syntax check CSS-Files
See also https://gist.github.com/seiz/50b9551be4d3a061636aebf43afba714 for a script to use jsonlint to syntax check JavaScript-Files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment