# Pre-commit.com hook

**URL:** <https://discuss.circleci.com/t/pre-commit-com-hook/22297>\
**Category:** Tips, Tricks, and Hacks\
**Created:** [May 10, 2018, 10:46pm UTC](https://discuss.circleci.com/t/pre-commit-com-hook/22297 "2018-05-10T22:46:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hoherd](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/hoherd/32/18410_2.png) [@hoherd](https://discuss.circleci.com/u/hoherd)\
**Post date:** [May 10, 2018, 10:46pm UTC](https://discuss.circleci.com/t/pre-commit-com-hook/22297/1 "2018-05-10T22:46:34Z")

</div>

I made a [pre-commit.com](http://pre-commit.com) pre-commit hook to automatically run `circleci config validate`.

> **[danielhoherd/pre-commit-circleci](https://github.com/danielhoherd/pre-commit-circleci)**
>
> pre-commit-circleci - pre-commit hook for circleci config validation.

[pre-commit.com](http://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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [August 8, 2018, 10:46pm UTC](https://discuss.circleci.com/t/pre-commit-com-hook/22297/2 "2018-08-08T22:46:36Z")

</div>

Closed on August 8, 2018, 10:46pm UTC

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