5 # find typedefs, excluding the externals folder
6 a
= subprocess
.Popen("git grep -P 'typedef\\s+.+\\s+\\w+;' -- \"[!e][!x][!t]*\"", stdout
=subprocess
.PIPE
, shell
=True)
8 # parse out the typedef names
12 idx2
= line
.rfind(b
";")
13 idx1
= line
.rfind(b
" ", 0, idx2
)
14 typedefName
= line
[idx1
+1 : idx2
]
15 if typedefName
.startswith(b
"*"):
16 typedefName
= typedefName
[1:]
17 # ignore anything less than 5 characters, it's probably a parsing error
18 if len(typedefName
) < 5: continue
19 typedefSet
.add(typedefName
)
21 for typedefName
in sorted(typedefSet
):
22 print(b
"checking: " + typedefName
)
23 a
= subprocess
.Popen(["git", "grep", "-wn", typedefName
], stdout
=subprocess
.PIPE
)
26 with a
.stdout
as txt2
:
33 print(b
"remove: " + foundLine2
)
35 print(b
"inline: " + foundLine2
)