Pre-commit.com hook


#1

I made a pre-commit.com pre-commit hook to automatically run circleci config validate.

pre-commit.com (available via pip install --user pre-commit)makes it really easy to add community maintained git pre-commit hooks for a variety of things. I was iterating on circleci configs and kept getting them wrong, so I decided to add this hook to prevent me from committing invalid configs.

Unfortunately my hook requires two upstream changes that are yet to be handled to make it really to use. The first is that there’s no easy way to install on OSX (eg: no brew install circleci), and the second is that the circleci command currently launches docker commands with -ti which fails when called inside of a shell script. I am eagerly waiting for those two changes to come down from upstream. Until then though you can use the hard installation method (or easily install via snap on linux) and manually edit the script to remove the -ti option.


#2

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.