forked from Squalr/Squally
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckIncludes.py
More file actions
31 lines (25 loc) · 1.1 KB
/
CheckIncludes.py
File metadata and controls
31 lines (25 loc) · 1.1 KB
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
#!/usr/bin/env python3
###################################################################################
# This script will detect unecessary includes in header files. #
###################################################################################
import os
import sys
import subprocess
with open("CheckIncludesIntermediate.txt", "w") as f:
subprocess.call([
sys.executable,
'C:/Python38/Scripts/cppclean', #cppclean
'./Source',
'--include-path=Source',
'--include-path=cocos2d',
'--include-path=cocos2d/cocos',
'--include-path=proj.win32',
'--include-path=proj.linux',
'--include-path=proj.mac'
], stdout=f)
ignored_words = ['Squally.dir', 'cocos2d.dir', 'spriter2dx.dir', ' static data ', 'precheader', 'asmjit', 'asmtk', 'libudis86']
with open("CheckIncludesIntermediate.txt", "r") as input, open("CheckIncludes.txt", "w") as output:
for line in input:
if not any(ignored_word in line for ignored_word in ignored_words):
output.write(line)
os.remove("CheckIncludesIntermediate.txt")