IODA Bundle
run-pyflakes.py
Go to the documentation of this file.
1 #!/usr/bin/env python3
2 
3 import sys
4 import subprocess
5 from pathlib import Path
6 
7 IODA_CONV_PATH = Path(__file__).parent/"@SCRIPT_LIB_PATH@"
8 if not IODA_CONV_PATH.is_dir():
9  IODA_CONV_PATH = Path(__file__).parent/'..'/'lib-python'
10 sys.path.append(str(IODA_CONV_PATH.resolve()))
11 
12 from utils import collect_sources
13 
14 
15 def ignore(p):
16  """ Ignore hidden and test files """
17  parts = p.splitall()
18  if any(x.startswith(".") for x in parts):
19  return True
20  if 'test' in parts:
21  return True
22 
23  return False
24 
25 
27  cmd = ["pyflakes"]
28  cmd.extend(collect_sources(ignore_func=ignore))
29  return subprocess.call(cmd)
30 
31 
32 if __name__ == "__main__":
33  rc = run_pyflakes()
34  sys.exit(rc)
def run_pyflakes()
Definition: run-pyflakes.py:26
def ignore(p)
Definition: run-pyflakes.py:15