Skip to content

Commit

Permalink
Merge branch 'main' into molecule-config-file
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Mar 12, 2024
2 parents 6e9cac9 + b4d1d97 commit d2fe3ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ on:
jobs:
ack:
uses: ansible/team-devtools/.github/workflows/ack.yml@main
secrets: inherit
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
hooks:
- id: codespell
- repo: https://github.com/psf/black
rev: 24.1.1
rev: 24.2.0
hooks:
- id: black
language_version: python3
Expand All @@ -40,14 +40,14 @@ repos:
language_version: python3

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.34.0
rev: v1.35.1
hooks:
- id: yamllint
files: \.(yaml|yml)$
types: [file, yaml]
entry: yamllint --strict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.2.1"
rev: "v0.2.2"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
12 changes: 6 additions & 6 deletions src/molecule/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ def should_do_markup() -> bool:
return sys.stdout.isatty()


# Define ANSIBLE_FORCE_COLOR if markup is enabled and another value is not
# already given. This assures that Ansible subprocesses are still colored,
# even if they do not run with a real TTY.
if should_do_markup():
os.environ["ANSIBLE_FORCE_COLOR"] = os.environ.get("ANSIBLE_FORCE_COLOR", "1")

console_options: dict[str, Any] = {"emoji": False, "theme": theme, "soft_wrap": True}

console = Console(
Expand All @@ -83,9 +89,3 @@ def should_do_markup() -> bool:
console_options_stderr = console_options.copy()
console_options_stderr["stderr"] = True
console_stderr: Console = Console(**console_options_stderr)

# Define ANSIBLE_FORCE_COLOR if markup is enabled and another value is not
# already given. This assures that Ansible subprocesses are still colored,
# even if they do not run with a real TTY.
if should_do_markup():
os.environ["ANSIBLE_FORCE_COLOR"] = os.environ.get("ANSIBLE_FORCE_COLOR", "1")

0 comments on commit d2fe3ae

Please sign in to comment.