Skip to content

Commit d2fe3ae

Browse files
authored
Merge branch 'main' into molecule-config-file
2 parents 6e9cac9 + b4d1d97 commit d2fe3ae

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

.github/workflows/ack.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ on:
1212
jobs:
1313
ack:
1414
uses: ansible/team-devtools/.github/workflows/ack.yml@main
15+
secrets: inherit

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
hooks:
2424
- id: codespell
2525
- repo: https://github.com/psf/black
26-
rev: 24.1.1
26+
rev: 24.2.0
2727
hooks:
2828
- id: black
2929
language_version: python3
@@ -40,14 +40,14 @@ repos:
4040
language_version: python3
4141

4242
- repo: https://github.com/adrienverge/yamllint.git
43-
rev: v1.34.0
43+
rev: v1.35.1
4444
hooks:
4545
- id: yamllint
4646
files: \.(yaml|yml)$
4747
types: [file, yaml]
4848
entry: yamllint --strict
4949
- repo: https://github.com/astral-sh/ruff-pre-commit
50-
rev: "v0.2.1"
50+
rev: "v0.2.2"
5151
hooks:
5252
- id: ruff
5353
args: [--fix, --exit-non-zero-on-fix]

src/molecule/console.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ def should_do_markup() -> bool:
7272
return sys.stdout.isatty()
7373

7474

75+
# Define ANSIBLE_FORCE_COLOR if markup is enabled and another value is not
76+
# already given. This assures that Ansible subprocesses are still colored,
77+
# even if they do not run with a real TTY.
78+
if should_do_markup():
79+
os.environ["ANSIBLE_FORCE_COLOR"] = os.environ.get("ANSIBLE_FORCE_COLOR", "1")
80+
7581
console_options: dict[str, Any] = {"emoji": False, "theme": theme, "soft_wrap": True}
7682

7783
console = Console(
@@ -83,9 +89,3 @@ def should_do_markup() -> bool:
8389
console_options_stderr = console_options.copy()
8490
console_options_stderr["stderr"] = True
8591
console_stderr: Console = Console(**console_options_stderr)
86-
87-
# Define ANSIBLE_FORCE_COLOR if markup is enabled and another value is not
88-
# already given. This assures that Ansible subprocesses are still colored,
89-
# even if they do not run with a real TTY.
90-
if should_do_markup():
91-
os.environ["ANSIBLE_FORCE_COLOR"] = os.environ.get("ANSIBLE_FORCE_COLOR", "1")

0 commit comments

Comments
 (0)