/
data_audit_wrapper.py
62 lines (41 loc) · 1.78 KB
/
data_audit_wrapper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""Wrapper around data_audit.
This wrapper is specific to InaSAFE.
This wrapper will run data_audit.py
Specify what extensions, directories and files should be ignored by
the data_audit process.
These will generally be specific to each software project.
"""
from data_audit import IP_verified as IP_engine
# Ignore source code files
extensions_to_ignore = ['.py','.c', '.h', '.cpp', '.f',
'.bat', '.m','.sh','.awk', '.pck']
# Ignore shp file auxiliary files
extensions_to_ignore += ['.prj', '.sbn', '.sbx', '.cpg']
# Ignore InaSAFE .keywords files
extensions_to_ignore += ['.keywords']
# Ignore control images for unit tests
extensions_to_ignore += ['.png', '.zip', '.html', '.txt']
# Ignore QGIS projects and styles
extensions_to_ignore += ['.qml', '.qpj', '.qgs',
'.sld', '.sqlite', '.db']
# Ignore pdf, doc and csv documents
extensions_to_ignore += ['.pdf', '.doc', '.csv', '.iml', 'DS_Store']
# Ignore generated stuff
extensions_to_ignore += ['.pyc', '.o', '.so', '~']
extensions_to_ignore += ['.aux', '.log', '.idx', 'ilg', '.ind',
'.bbl', '.blg', '.syn', '.toc', '.xml']
# Ignore license files themselves
extensions_to_ignore += ['.lic', '.permission']
# Ignore certain other files,
files_to_ignore = ['README.txt', 'LICENSE.txt', 'Makefile', '.name',
'.temp', 'SConstruct', 'SConscript', 'log.ini']
# Ignore directories
directories_to_ignore = ['.svn', '.git', '.metadata']
#directories_to_ignore += ['old_pyvolution_documentation']
def IP_verified(directory, verbose=False):
result = IP_engine(directory,
extensions_to_ignore,
directories_to_ignore,
files_to_ignore,
verbose=verbose)
return result