Skip to content

Commit

Permalink
Update show-unused-features.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Aayush-Goel-04 committed Aug 9, 2023
1 parent 5748673 commit a383022
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions scripts/show-unused-features.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,10 @@ def get_colored(s: str):

def print_unused_features(feature_map: typing.Counter[Feature], rules_feature_set: Set[Feature]):
unused_features = []
for feature, count in feature_map.items():
for feature, count in reversed(feature_map.most_common()):
if feature in rules_feature_set:
continue
unused_features.append((count, get_colored(str(feature))))
unused_features = [
(str(count), feature) for count, feature in sorted(unused_features, key=lambda x: x[0])
]
unused_features.append((str(count), get_colored(str(feature))))
print("\n")
print(tabulate.tabulate(unused_features, headers=["Count", "Feature"], tablefmt="plain"))
print("\n")
Expand Down

0 comments on commit a383022

Please sign in to comment.