2016-09-19 21:41:01 +00:00
|
|
|
=====
|
|
|
|
Usage
|
|
|
|
=====
|
|
|
|
|
|
|
|
Command Line
|
|
|
|
------------
|
|
|
|
|
|
|
|
.. contents::
|
|
|
|
|
|
|
|
git lint [options] [filenames]
|
|
|
|
|
|
|
|
Options
|
|
|
|
-------
|
|
|
|
|
|
|
|
``-h`` ``--help``
|
|
|
|
Help
|
|
|
|
|
|
|
|
``-v`` ``--version``
|
|
|
|
Version info
|
|
|
|
|
|
|
|
``-c`` ``--config``
|
2016-09-19 23:00:37 +00:00
|
|
|
Specify config file (default: ``$GIT_DIR/.git-lint``)
|
2016-09-19 21:41:01 +00:00
|
|
|
|
|
|
|
``-w`` ``--workspace``
|
|
|
|
Check workspace [default]
|
|
|
|
|
|
|
|
``-s`` ``--staging``
|
|
|
|
Check files in the staging area (useful as a pre-commit hook)
|
|
|
|
|
|
|
|
``-a`` ``--all``
|
|
|
|
Check all files in repository, not just changed files
|
|
|
|
|
|
|
|
``-b`` ``--base``
|
|
|
|
Run checks from your repository's root directory. By default,
|
|
|
|
``git-lint`` only runs from the current working directory.
|
|
|
|
|
|
|
|
``-o`` ``--only``
|
|
|
|
Run only specific linters, skipping all others
|
|
|
|
|
|
|
|
``-e`` ``--exclude``
|
|
|
|
Exclude specific linters, running all others
|
|
|
|
|
|
|
|
|
|
|
|
As a pre-commit hook
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
#!/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``:
|
|
|
|
|
|
|
|
chmod +x pre-commit
|
|
|
|
|
|
|
|
Please see the :ref:`api` for more details on options taken by the
|
|
|
|
``run_precommit()`` and ``run_gitlint`` commands.
|
|
|
|
|