提交 4d0d68b5 authored 作者: Frederic Bastien's avatar Frederic Bastien

Allow to test flake8 on selected files

上级 6114635c
...@@ -139,7 +139,7 @@ def test_format_flake8(): ...@@ -139,7 +139,7 @@ def test_format_flake8():
raise AssertionError("FLAKE8 Format not respected") raise AssertionError("FLAKE8 Format not respected")
def print_files_information_flake8(): def print_files_information_flake8(files):
""" """
Print the list of files which can be removed from the whitelist and the Print the list of files which can be removed from the whitelist and the
list of files which do not respect FLAKE8 formatting that aren't in the list of files which do not respect FLAKE8 formatting that aren't in the
...@@ -147,7 +147,9 @@ def print_files_information_flake8(): ...@@ -147,7 +147,9 @@ def print_files_information_flake8():
""" """
infracting_files = [] infracting_files = []
non_infracting_files = [] non_infracting_files = []
for path in list_files(): if not files:
files = list_files()
for path in files:
rel_path = os.path.relpath(path, theano.__path__[0]) rel_path = os.path.relpath(path, theano.__path__[0])
number_of_infractions = flake8.main.check_file(path, number_of_infractions = flake8.main.check_file(path,
ignore=ignore) ignore=ignore)
...@@ -186,4 +188,4 @@ def check_all_files(dir_path=theano.__path__[0], pattern='*.py'): ...@@ -186,4 +188,4 @@ def check_all_files(dir_path=theano.__path__[0], pattern='*.py'):
if __name__ == "__main__": if __name__ == "__main__":
print_files_information_flake8() print_files_information_flake8(sys.argv[1:])
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论