Skip to content

Commit e1b7bd9

Browse files
committed
feat: Support FORCE_COLOR environment variable
1 parent 92594a9 commit e1b7bd9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/_griffe/cli.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,11 @@ def check(
506506
# Find and display API breakages.
507507
breakages = list(find_breaking_changes(old_package, new_package))
508508

509+
if color is None and (force_color := os.getenv("FORCE_COLOR", None)) is not None:
510+
color = force_color.lower() in {"1", "true", "y", "yes", "on"}
509511
colorama.deinit()
510512
colorama.init(strip=color if color is None else not color)
513+
511514
if style is None:
512515
style = ExplanationStyle.VERBOSE if verbose else ExplanationStyle.ONE_LINE
513516
else:

0 commit comments

Comments
 (0)