mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-16 00:59:52 +00:00
Merge the changes from the 'default' branch
This commit is contained in:
commit
4a8c382398
4 changed files with 6 additions and 7 deletions
|
|
@ -6,13 +6,13 @@ Documentation
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
|
|
||||||
api
|
|
||||||
extensions
|
|
||||||
config
|
config
|
||||||
|
warnings
|
||||||
vcs
|
vcs
|
||||||
buildout
|
buildout
|
||||||
setuptools
|
setuptools
|
||||||
warnings
|
api
|
||||||
|
extensions
|
||||||
changes
|
changes
|
||||||
|
|
||||||
Original Projects
|
Original Projects
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ Git hook
|
||||||
To use the Git hook on any *commit*, add a **pre-commit** file in the
|
To use the Git hook on any *commit*, add a **pre-commit** file in the
|
||||||
*.git/hooks* directory containing::
|
*.git/hooks* directory containing::
|
||||||
|
|
||||||
#!/usr/bin/python
|
#!/usr/bin/env python
|
||||||
import sys
|
import sys
|
||||||
from flake8.run import git_hook
|
from flake8.run import git_hook
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ from flake8.main import DEFAULT_CONFIG
|
||||||
|
|
||||||
def git_hook(complexity=-1, strict=False, ignore=None, lazy=False):
|
def git_hook(complexity=-1, strict=False, ignore=None, lazy=False):
|
||||||
"""This is the function used by the git hook.
|
"""This is the function used by the git hook.
|
||||||
|
|
||||||
:param int complexity: (optional), any value > 0 enables complexity
|
:param int complexity: (optional), any value > 0 enables complexity
|
||||||
checking with mccabe
|
checking with mccabe
|
||||||
:param bool strict: (optional), if True, this returns the total number of
|
:param bool strict: (optional), if True, this returns the total number of
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,7 @@ def main():
|
||||||
|
|
||||||
|
|
||||||
def check_file(path, ignore=(), complexity=-1):
|
def check_file(path, ignore=(), complexity=-1):
|
||||||
"""Checks a file using pep8 and pyflakes by default and mccabe
|
"""Checks a file using pep8 and pyflakes by default and mccabe optionally.
|
||||||
optionally.
|
|
||||||
|
|
||||||
:param str path: path to the file to be checked
|
:param str path: path to the file to be checked
|
||||||
:param tuple ignore: (optional), error and warning codes to be ignored
|
:param tuple ignore: (optional), error and warning codes to be ignored
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue