Skip to content

Commit

Permalink
Merge pull request #87 from bpicolo/dockermentation
Browse files Browse the repository at this point in the history
Add dockermentation
  • Loading branch information
asottile authored Jan 4, 2017
2 parents 892ee3e + f81c890 commit 3430c27
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sha: f840ac610d8d9d76b666062416241f2156b3f388
hooks:
- id: scss-lint
language_version: 1.9.3-p547
language_version: 2.1.2
- repo: git@github.com:pre-commit/pre-commit-hooks
sha: 97b88d9610bcc03982ddac33caba98bb2b751f5f
hooks:
Expand Down
16 changes: 13 additions & 3 deletions index.mako
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
</pre>
<h2 id="supported-languages">Supported languages</h2>
<ul>
<li><code>docker</code> - must have a Dockerfile (Installed via <code>docker build .</code>) Requires pre-commit >= 0.10.0.</li>
<li><code>node</code> - must have a package.json (Installed via <code>npm install .</code>)</li>
<li><code>python</code> - must have a setup.py (Installed via <code>pip install .</code>)</li>
<li><code>ruby</code> - must have a file matching *.gemspec (Installed via <code>gem build *.gemspec &amp;&amp; gem install *.gem</code>)</li>
Expand All @@ -226,6 +227,14 @@
<li><code>ruby</code> - provided by <code>executables</code> in your gemspec</li>
</ul>

Running Docker hooks required a running Docker engine on your host.
For configuring Docker hooks, your <code>entry</code> should correspond to an executable
inside the Docker container, and will be used to override the default container entrypoint.
Your Docker CMD will not run when pre-commit passes a file list as arguments to the run container
command. Docker allows you to use any language that's not supported by pre-commit as a builtin.
See <a href="https://github.com/pre-commit/pre-commit-docker-flake8">this repository</a> for an example Docker-based hook.


<h2 id="developing-hooks-interactively">Developing hooks interactively</h2>

<p>
Expand Down Expand Up @@ -261,7 +270,7 @@
<h2 id="pre-commit-during-merges">pre-commit during merges</h2>
<p>
The biggest gripe we&rsquo;ve had in the past with pre-commit
hooks was during merge conflict resolution.
hooks was during merge conflict resolution.
When working on very large projects a merge often results in
hundreds of committed files. I shouldn&rsquo;t need to run
hooks on all of these files that I didn&rsquo;t even touch!
Expand Down Expand Up @@ -365,8 +374,8 @@
pre-commit can also be used as a tool for continuous
integration. For instance, adding
<code>pre-commit run --all-files</code> as a CI step will
ensure everything stays in tip-top shape.
To check only files which have changed, which may be faster, use something like
ensure everything stays in tip-top shape.
To check only files which have changed, which may be faster, use something like
<code>git diff-tree --no-commit-id --name-only -r $REVISION | xargs pre-commit run --files</code>.
</p>
</div>
Expand Down Expand Up @@ -397,6 +406,7 @@
<li><a href="https://github.com/barrysteyn">Barry Steyn</a></li>
<li><a href="https://github.com/blarghmatey">Tobias Macey</a></li>
<li><a href="https://github.com/laurentsigal">Laurent Sigal</a></li>
<li><a href="https://github.com/bpicolo">Ben Picolo</a></li>
</ul>
</div>
</div>
Expand Down

0 comments on commit 3430c27

Please sign in to comment.