Skip to content

Commit

Permalink
Tools: extract_features.py: sort extracted features string into more …
Browse files Browse the repository at this point in the history
…useful order

when taking differences between output of this file it is more useful to sort the list regardless of compiled-in/compiled-out.
  • Loading branch information
peterbarker committed Jul 31, 2023
1 parent 9d768c0 commit 3784841
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Tools/scripts/extract_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,20 @@ def create_string(self):

ret = ""

for compiled_in_feature_define in sorted(compiled_in_feature_defines):
ret += compiled_in_feature_define + "\n"
for remaining in sorted(not_compiled_in_feature_defines):
ret += "!" + remaining + "\n"

combined = {}
for define in sorted(compiled_in_feature_defines):
combined[define] = True
for define in sorted(not_compiled_in_feature_defines):
combined[define] = False

def squash_hal_to_ap(a):
return re.sub("^HAL_", "AP_", a)

for define in sorted(combined.keys(), key=squash_hal_to_ap):
bang = ""
if not combined[define]:
bang = "!"
ret += bang + define + "\n"
return ret

def run(self):
Expand Down

0 comments on commit 3784841

Please sign in to comment.