mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-11 07:14:18 +00:00
merged
This commit is contained in:
commit
8d71ebb10f
2 changed files with 7 additions and 4 deletions
|
|
@ -3,4 +3,5 @@ Project created by Tarek Ziadé.
|
||||||
Contributors:
|
Contributors:
|
||||||
|
|
||||||
- Tamás Gulácsi
|
- Tamás Gulácsi
|
||||||
|
- Nicolas Dumazet
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,12 @@ def main():
|
||||||
|
|
||||||
|
|
||||||
def _get_files(repo, **kwargs):
|
def _get_files(repo, **kwargs):
|
||||||
|
seen = set()
|
||||||
for rev in xrange(repo[kwargs['node']], len(repo)):
|
for rev in xrange(repo[kwargs['node']], len(repo)):
|
||||||
for file_ in repo[rev].files():
|
for file_ in repo[rev].files():
|
||||||
|
if file_ in seen:
|
||||||
|
continue
|
||||||
|
seen.add(file_)
|
||||||
if not file_.endswith('.py'):
|
if not file_.endswith('.py'):
|
||||||
continue
|
continue
|
||||||
if skip_file(file_):
|
if skip_file(file_):
|
||||||
|
|
@ -82,11 +86,9 @@ def hg_hook(ui, repo, **kwargs):
|
||||||
for file_ in _get_files(repo, **kwargs):
|
for file_ in _get_files(repo, **kwargs):
|
||||||
warnings += check_file(file_)
|
warnings += check_file(file_)
|
||||||
|
|
||||||
strict = ui.config('flake8', 'strict')
|
strict = ui.configbool('flake8', 'strict', default=True)
|
||||||
if strict is None:
|
|
||||||
strict = True
|
|
||||||
|
|
||||||
if strict.lower() in ('1', 'true'):
|
if strict:
|
||||||
return warnings
|
return warnings
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue