159 lines
7.1 KiB
HTML
159 lines
7.1 KiB
HTML
<!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" />
|
|
|
|
<title>Usage — Git Lint 0.0.4 documentation</title>
|
|
|
|
<link rel="stylesheet" href="static/classic.css" type="text/css" />
|
|
<link rel="stylesheet" href="static/pygments.css" type="text/css" />
|
|
|
|
<script type="text/javascript">
|
|
var DOCUMENTATION_OPTIONS = {
|
|
URL_ROOT: './',
|
|
VERSION: '0.0.4',
|
|
COLLAPSE_INDEX: false,
|
|
FILE_SUFFIX: '.html',
|
|
HAS_SOURCE: true
|
|
};
|
|
</script>
|
|
<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>
|
|
<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>
|
|
<body role="document">
|
|
<div class="related" role="navigation" aria-label="related navigation">
|
|
<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>
|
|
<li class="nav-item nav-item-0"><a href="index.html">Git Lint 0.0.4 documentation</a> »</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body" role="main">
|
|
|
|
<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>
|
|
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="ch">#!/usr/bin/env python</span>
|
|
<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>
|
|
<p>Install this file in your project’s <code class="docutils literal"><span class="pre">.git/hooks/pre-commit</span></code>, and set
|
|
the file’s executable flag to <code class="docutils literal"><span class="pre">true</span></code>:</p>
|
|
<div class="highlight-shell"><div class="highlight"><pre><span></span>chmod +x pre-commit
|
|
</pre></div>
|
|
</div>
|
|
<p>Please see the <span class="xref std std-ref">api</span> for more details on options taken by the
|
|
<code class="docutils literal"><span class="pre">run_precommit()</span></code> and <code class="docutils literal"><span class="pre">run_gitlint</span></code> commands.</p>
|
|
<p>There is an example <code class="docutils literal"><span class="pre">pre-commit</span></code> script shipped with <code class="docutils literal"><span class="pre">git</span> <span class="pre">lint</span></code>.</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
|
<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>
|
|
<div role="note" aria-label="source link">
|
|
<h3>This Page</h3>
|
|
<ul class="this-page-menu">
|
|
<li><a href="_sources/usage.txt"
|
|
rel="nofollow">Show Source</a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="searchbox" style="display: none" role="search">
|
|
<h3>Quick search</h3>
|
|
<form class="search" action="search.html" method="get">
|
|
<div><input type="text" name="q" /></div>
|
|
<div><input type="submit" value="Go" /></div>
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
</div>
|
|
<script type="text/javascript">$('#searchbox').show(0);</script>
|
|
</div>
|
|
</div>
|
|
<div class="clearer"></div>
|
|
</div>
|
|
<div class="related" role="navigation" aria-label="related navigation">
|
|
<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>
|
|
<li class="nav-item nav-item-0"><a href="index.html">Git Lint 0.0.4 documentation</a> »</li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer" role="contentinfo">
|
|
© Copyright 2016, Kenneth M. "Elf" Sternberg.
|
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.6.
|
|
</div>
|
|
</body>
|
|
</html> |