Skip to content

Commit 42874f1

Browse files
committed
fix color of "N/A" values
1 parent 7ae7a6c commit 42874f1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cycode/cli/printers/tables/sca_table_printer.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,19 @@ def _enrich_table_with_values(policy_id: str, table: Table, detection: Detection
142142
table.add_cell(ECOSYSTEM_COLUMN, detection_details.get('ecosystem'))
143143
table.add_cell(PACKAGE_COLUMN, detection_details.get('package_name'))
144144

145-
direct_dependency_color = 'green' if detection_details.get('is_direct_dependency') else 'red'
145+
dependency_bool_to_color = {
146+
True: 'green',
147+
False: 'red',
148+
} # by default, not colored (None)
146149
table.add_cell(
147150
column=DIRECT_DEPENDENCY_COLUMN,
148151
value=detection_details.get('is_direct_dependency_str'),
149-
color=direct_dependency_color,
152+
color=dependency_bool_to_color.get(detection_details.get('is_direct_dependency')),
150153
)
151-
dev_dependency_color = 'green' if detection_details.get('is_dev_dependency') else 'red'
152154
table.add_cell(
153155
column=DEVELOPMENT_DEPENDENCY_COLUMN,
154156
value=detection_details.get('is_dev_dependency_str'),
155-
color=dev_dependency_color,
157+
color=dependency_bool_to_color.get(detection_details.get('is_dev_dependency')),
156158
)
157159

158160
dependency_paths = 'N/A'

0 commit comments

Comments
 (0)