diff --git a/src/dwas/_config.py b/src/dwas/_config.py index 05596a5..5fe9525 100644 --- a/src/dwas/_config.py +++ b/src/dwas/_config.py @@ -232,8 +232,9 @@ def _get_color_setting(self, colors: bool | None) -> bool: # Check for CIs that were asked for, and enable colors by default # when it's possible. Do this towards the end to ensure other config # can override - if "GITHUB_ACTION" in os.environ: - return True + for ci_var in ["GITHUB_ACTION", "GITLAB_CI"]: + if ci_var in os.environ: + return True return self.is_interactive diff --git a/tests/test_config.py b/tests/test_config.py index c1dbd30..329b9e9 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -90,7 +90,7 @@ def test_can_enable_colors_with_force_color(monkeypatch, kwargs): assert conf.colors -@pytest.mark.parametrize("ci_env_var", ("GITHUB_ACTION",)) +@pytest.mark.parametrize("ci_env_var", ("GITHUB_ACTION", "GITLAB_CI")) def test_enables_colors_on_cis_by_default(ci_env_var, kwargs, monkeypatch): monkeypatch.setenv(ci_env_var, "1")