Pre-commit hooks to validate CircleCI configuration

Has anyone used pre-commit and check-jsonschema to validate CircleCI config files?

I know that syntaqx/git-hooks has a specific CircleCI one, so I could use that, but I already use the above one so having yet-another-thing seems redundant.

Or this for reference…

The last two use the CircleCI command line tool, whereas the first one uses schema.

Yes I’ve used it, they work quite well, including the syntaqx-one. We use it at the organization I work for.

I code within IntelliJ’s Idea IDE, which has json schema checking built-in. The only issue I’ve found so far shows up if you are using self-hosted runners as the schema documents CircleCI’s list of valued values for exec_node/resource_class, which can then not handle the fact that the same field is used to pass the name of the self-hosted runner.

So the checking works, but if you have self-hosted runners you will always get one error reported.