git-linter/usage.html

160 lines
6.8 KiB
HTML
Raw Normal View History

2016-10-03 20:28:07 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
2016-10-04 00:31:52 +00:00
<title>Usage &mdash; Git Lint 0.0.4 documentation</title>
2016-10-03 20:28:07 +00:00
2016-10-04 00:31:52 +00:00
<link rel="stylesheet" href="static/default.css" type="text/css" />
2016-10-03 20:31:59 +00:00
<link rel="stylesheet" href="static/pygments.css" type="text/css" />
2016-10-03 20:28:07 +00:00
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.0.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
2016-10-03 20:31:59 +00:00
<script type="text/javascript" src="static/jquery.js"></script>
<script type="text/javascript" src="static/underscore.js"></script>
<script type="text/javascript" src="static/doctools.js"></script>
2016-10-03 20:28:07 +00:00
<link rel="top" title="Git Lint 0.0.4 documentation" href="index.html" />
<link rel="next" title="Contributing" href="contributing.html" />
<link rel="prev" title="Installation" href="installation.html" />
</head>
2016-10-04 00:31:52 +00:00
<body>
<div class="related">
2016-10-03 20:28:07 +00:00
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="contributing.html" title="Contributing"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="installation.html" title="Installation"
accesskey="P">previous</a> |</li>
2016-10-04 00:31:52 +00:00
<li><a href="index.html">Git Lint 0.0.4 documentation</a> &raquo;</li>
2016-10-03 20:28:07 +00:00
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
2016-10-04 00:31:52 +00:00
<div class="body">
2016-10-03 20:28:07 +00:00
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id1">Usage</a><a class="headerlink" href="#usage" title="Permalink to this headline"></a></h1>
<div class="section" id="command-line">
<h2><a class="toc-backref" href="#id2">Command Line</a><a class="headerlink" href="#command-line" title="Permalink to this headline"></a></h2>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#usage" id="id1">Usage</a><ul>
<li><a class="reference internal" href="#command-line" id="id2">Command Line</a></li>
<li><a class="reference internal" href="#options" id="id3">Options</a></li>
<li><a class="reference internal" href="#as-a-pre-commit-hook" id="id4">As a pre-commit hook:</a></li>
</ul>
</li>
</ul>
</div>
<p>git lint [options] [filenames]</p>
</div>
<div class="section" id="options">
<h2><a class="toc-backref" href="#id3">Options</a><a class="headerlink" href="#options" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="as-a-pre-commit-hook">
<h2><a class="toc-backref" href="#id4">As a pre-commit hook:</a><a class="headerlink" href="#as-a-pre-commit-hook" title="Permalink to this headline"></a></h2>
2016-10-04 00:31:52 +00:00
<div class="highlight-python"><div class="highlight"><pre><span class="c">#!/usr/bin/env python</span>
2016-10-03 20:28:07 +00:00
<span class="kn">import</span> <span class="nn">git_lint</span>
<span class="n">git_lint</span><span class="o">.</span><span class="n">run_precommit</span><span class="p">(</span><span class="n">staging</span> <span class="o">=</span> <span class="bp">True</span><span class="p">,</span> <span class="n">timestamps</span> <span class="o">=</span> <span class="bp">True</span><span class="p">)</span>
</pre></div>
</div>
2016-10-04 00:31:52 +00:00
<p>Install this file in your project&#8217;s <tt class="docutils literal"><span class="pre">.git/hooks/pre-commit</span></tt>, and set
the file&#8217;s executable flag to <tt class="docutils literal"><span class="pre">true</span></tt>:</p>
<div class="highlight-shell"><div class="highlight"><pre>chmod +x pre-commit
2016-10-03 20:28:07 +00:00
</pre></div>
</div>
2016-10-04 00:31:52 +00:00
<p>Please see the <em class="xref std std-ref">api</em> for more details on options taken by the
<tt class="docutils literal"><span class="pre">run_precommit()</span></tt> and <tt class="docutils literal"><span class="pre">run_gitlint</span></tt> commands.</p>
<p>There is an example <tt class="docutils literal"><span class="pre">pre-commit</span></tt> script shipped with <tt class="docutils literal"><span class="pre">git</span> <span class="pre">lint</span></tt>.</p>
2016-10-03 20:28:07 +00:00
</div>
</div>
</div>
</div>
</div>
2016-10-04 00:31:52 +00:00
<div class="sphinxsidebar">
2016-10-03 20:28:07 +00:00
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Usage</a><ul>
<li><a class="reference internal" href="#command-line">Command Line</a></li>
<li><a class="reference internal" href="#options">Options</a></li>
<li><a class="reference internal" href="#as-a-pre-commit-hook">As a pre-commit hook:</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="installation.html"
title="previous chapter">Installation</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="contributing.html"
title="next chapter">Contributing</a></p>
2016-10-04 00:31:52 +00:00
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="sources/usage.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
2016-10-03 20:28:07 +00:00
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
2016-10-04 00:31:52 +00:00
<input type="text" name="q" />
<input type="submit" value="Go" />
2016-10-03 20:28:07 +00:00
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
2016-10-04 00:31:52 +00:00
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
2016-10-03 20:28:07 +00:00
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
2016-10-04 00:31:52 +00:00
<div class="related">
2016-10-03 20:28:07 +00:00
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="contributing.html" title="Contributing"
>next</a> |</li>
<li class="right" >
<a href="installation.html" title="Installation"
>previous</a> |</li>
2016-10-04 00:31:52 +00:00
<li><a href="index.html">Git Lint 0.0.4 documentation</a> &raquo;</li>
2016-10-03 20:28:07 +00:00
</ul>
</div>
2016-10-04 00:31:52 +00:00
<div class="footer">
&copy; Copyright 2016, Kenneth M. &#34;Elf&#34; Sternberg.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
2016-10-03 20:28:07 +00:00
</div>
</body>
2016-10-04 00:31:52 +00:00
</html>