git-linter/sources/usage.txt

37 lines
664 B
Plaintext
Raw Normal View History

2016-10-03 20:28:07 +00:00
=====
Usage
=====
2016-10-04 17:20:46 +00:00
2016-10-03 20:28:07 +00:00
Command Line
------------
.. contents::
git lint [options] [filenames]
Options
-------
2016-10-04 17:20:46 +00:00
.. include:: arguments.rst
2016-10-03 20:28:07 +00:00
As a pre-commit hook:
---------------------
.. code-block:: python
#!/usr/bin/env python
import git_lint
git_lint.run_precommit(staging = True, timestamps = True)
Install this file in your project's ``.git/hooks/pre-commit``, and set
the file's executable flag to ``true``:
.. code-block:: shell
chmod +x pre-commit
Please see the :ref:`api` for more details on options taken by the
``run_precommit()`` and ``run_gitlint`` commands.
There is an example ``pre-commit`` script shipped with ``git lint``.