I ought to pass my own lint style checks, ne?

This commit is contained in:
Elf M. Sternberg 2016-10-03 12:31:01 -07:00
parent 13b0378b67
commit f2ae3371e7
6 changed files with 28 additions and 19 deletions

View File

@ -14,12 +14,19 @@
Scan the workspace [default]
**-s, --staging**
Scan the staging area (useful for pre-commit).
**-c <path>, --config**=<path> Path to config file
**-c <path>, --config=<path>**
Path to config file
**-t, --bylinter**
Group reports by linter first as they appear in the config file [default]
**-f, --byfile**
Group reports by file first, linter second
**-d, --dryrun**
Report what git-lint would do, but don't actually do anything.
**-q, --quiet**
Produce a short report of files that failed to pass.
Produce a short report of file that failed to pass.
**-h, --help**
Print a short help message
**-V, --verbose**
Print a slightly more verbose long report
**-v, --version**
Print version information

View File

@ -12,7 +12,7 @@ To install Git Lint, run this command in your terminal:
.. code-block:: console
$ pip install git_lint
$ pip install git_linter
If you don't have `pip`_ installed, this `Python installation guide`_ can guide
you through the process.
@ -30,13 +30,13 @@ You can either clone the public repository:
.. code-block:: console
$ git clone git://github.com/elfsternberg/git_lint
$ git clone git://github.com/elfsternberg/git_linter
Or download the `tarball`_:
.. code-block:: console
$ curl -OL https://github.com/elfsternberg/git_lint/tarball/master
$ curl -OL https://github.com/elfsternberg/git_linter/tarball/master
Once you have a copy of the source, you can install it with:
@ -44,10 +44,9 @@ Once you have a copy of the source, you can install it with:
$ python setup.py install
.. _Github repo: https://github.com/elfsternberg/git_lint
.. _tarball: https://github.com/elfsternberg/git_lint/tarball/master
.. _Github repo: https://github.com/elfsternberg/git_linter
.. _tarball: https://github.com/elfsternberg/git_linter/tarball/master
Once installed, you may run the 'git lint --make-config' command, which
will generate a simple configuration file. You may install this either
in your home directory as ``.git-lint.conf`` or in your project's git
directory as ``.git/lint/git-lint.conf``
Once installed, please copy the '.git-lint' example file. You may install this either in
your home directory as ``.git-lint`` or in your project's git directory as
``.git/lint/git-lint``

View File

@ -32,4 +32,5 @@ the file's executable flag to ``true``:
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``.

View File

@ -18,10 +18,10 @@ OPTIONS = [
_('Scan the workspace'), ['staging']),
('s', 'staging', False,
_('Scan the staging area (useful for pre-commit).'), []),
('g', 'changes', False,
_("Report lint failures only for diff'd sections"), ['complete']),
('p', 'complete', False,
_('Report lint failures for all files'), []),
# ('g', 'changes', False,
# _("Report lint failures only for diff'd sections"), ['complete']),
# ('p', 'complete', False,
# _('Report lint failures for all files'), []),
('t', 'bylinter', False,
_('Group the reports by linter first as they appear in the config file [default]'), []),
('f', 'byfile', False,

View File

@ -46,17 +46,17 @@ def print_report(results, unlintable_filenames, cant_lint_filenames,
if len(broken_linter_names) and (len(cant_lint_filenames) or ('verbose' in options)):
print(_('These linters could not be run:'), ','.join(broken_linter_names))
if len(cant_lint_filenames):
print(_('As a result, these files were not linted:'))
print(_('Files not linted:'))
print('\n'.join([' {}'.format(f) for f in cant_lint_filenames]))
print('')
if len(unlintable_filenames) and ('verbose' in options):
print(_('The following files had no recognizeable linters:'))
print(_('No recognizeable linters for:'))
print('\n'.join([' {}'.format(f) for f in unlintable_filenames]))
print('')
if len(unfindable_filenames):
print(_('The following files could not be found:'))
print(_('Files not be found:'))
print('\n'.join([' {}'.format(f) for f in unfindable_filenames]))
print('')

View File

@ -6,6 +6,8 @@ import os.path
def get_data_files(prefix):
if prefix.startswith('/System/Library/Frameworks'):
return []
return [(os.path.join(prefix, 'share/man/man1'), ['docs/_build/man/git-lint.1'])]