Skip to content

Commit

Permalink
feat: Support FORCE_COLOR environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jul 14, 2024
1 parent 92594a9 commit e1b7bd9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/_griffe/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,11 @@ def check(
# Find and display API breakages.
breakages = list(find_breaking_changes(old_package, new_package))

if color is None and (force_color := os.getenv("FORCE_COLOR", None)) is not None:
color = force_color.lower() in {"1", "true", "y", "yes", "on"}
colorama.deinit()
colorama.init(strip=color if color is None else not color)

if style is None:
style = ExplanationStyle.VERBOSE if verbose else ExplanationStyle.ONE_LINE
else:
Expand Down

0 comments on commit e1b7bd9

Please # to comment.