@@ -610,24 +610,24 @@ def relevant_environment_display(env: Mapping[str, str]) -> list[tuple[str, str]
610
610
A list of pairs (name, value) to show.
611
611
612
612
"""
613
- slugs = {"COV" , "PY" }
614
- include = {"HOME" , "TEMP" , "TMP" }
615
- cloak = {"API" , "TOKEN" , "KEY" , "SECRET" , "PASS" , "SIGNATURE" }
616
- truncate = {"COVERAGE_PROCESS_CONFIG" }
617
- truncate_len = 60
613
+ SLUGS = {"COV" , "PY" }
614
+ INCLUDE = {"HOME" , "TEMP" , "TMP" }
615
+ CLOAK = {"API" , "TOKEN" , "KEY" , "SECRET" , "PASS" , "SIGNATURE" }
616
+ TRUNCATE = {"COVERAGE_PROCESS_CONFIG" }
617
+ TRUNCATE_LEN = 60
618
618
619
619
to_show = []
620
620
for name , val in env .items ():
621
- keep = False
622
- if name in include :
623
- keep = True
624
- elif any (slug in name for slug in slugs ):
625
- keep = True
626
- if keep :
627
- if any (slug in name for slug in cloak ):
621
+ show = False
622
+ if name in INCLUDE :
623
+ show = True
624
+ elif any (slug in name for slug in SLUGS ):
625
+ show = True
626
+ if show :
627
+ if any (slug in name for slug in CLOAK ):
628
628
val = re .sub (r"\w" , "*" , val )
629
- if name in truncate :
630
- if len (val ) > truncate_len :
631
- val = val [:truncate_len - 3 ] + "..."
629
+ if name in TRUNCATE :
630
+ if len (val ) > TRUNCATE_LEN :
631
+ val = val [:TRUNCATE_LEN - 3 ] + "..."
632
632
to_show .append ((name , val ))
633
633
return human_sorted_items (to_show )
0 commit comments