Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ce5c24b

Browse files
committedJan 22, 2025·
Improve feature name readability in conformance reports
Add feature name processing to remove redundant prefixes and improve readability in conformance comparison tables. Changes include: - Remove "HTTPRoute" and "Gateway" prefixes from feature names - Split camelCase words into space-separated words - Add process_feature_name() function for consistent text processing - Update generate_profiles_report() to use processed feature names This makes the conformance reports easier to read
1 parent bdd64d2 commit ce5c24b

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed
 

‎hack/mkdocs-generate-conformance.py

+20-1
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,27 @@
1919
from fnmatch import fnmatch
2020
import glob
2121
import os
22+
import re
2223

2324
log = logging.getLogger('mkdocs')
2425

2526

27+
def process_feature_name(feature):
28+
"""
29+
Process feature names by:
30+
1. Removing HTTPRoute and Gateway prefixes
31+
2. Splitting camelCase into space-separated words
32+
"""
33+
# Remove prefixes
34+
feature = re.sub(r'^(HTTPRoute|Gateway)', '', feature)
35+
36+
# Split camelCase
37+
words = re.findall(r'[A-Z][a-z]*(?=[A-Z][a-z]*|$)|[A-Z]{2,}(?=[A-Z][a-z]|\d|\W|$)|[A-Z][a-z]+|\d+', feature)
38+
39+
# Join words with spaces and title case each word
40+
return ' '.join(word.title() for word in words)
41+
42+
2643
@plugins.event_priority(100)
2744
def on_pre_build(config, **kwargs):
2845
log.info("generating conformance")
@@ -114,7 +131,9 @@ def generate_profiles_report(reports, route,version):
114131
for row in http_table.itertuples():
115132
if type(row._4) is list:
116133
for feat in row._4:
117-
http_table.loc[row.Index, feat] = ':white_check_mark:'
134+
# Process feature name before using it as a column
135+
processed_feat = process_feature_name(feat)
136+
http_table.loc[row.Index, processed_feat] = ':white_check_mark:'
118137
http_table = http_table.fillna(':x:')
119138
http_table = http_table.drop(['extended.supportedFeatures'], axis=1)
120139

0 commit comments

Comments
 (0)
Please sign in to comment.