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(";")
13 idx1
= line
.rfind(" ", 0, idx2
)
14 typedefName
= line
[idx1
+1 : idx2
]
15 if typedefName
.startswith("*"):
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("checking: " + typedefName
)
23 a
= subprocess
.Popen(["git", "grep", "-wn", typedefName
], stdout
=subprocess
.PIPE
)
26 with a
.stdout
as txt2
:
31 print("remove: " + foundLine2
)
33 print("inline: " + foundLine2
)