Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test: validate ANSI escape codes are not in redirected composer output#86

Merged
AaronFeledy merged 3 commits into
mainfrom
test/ansi-escape-codes
Feb 28, 2026
Merged

test: validate ANSI escape codes are not in redirected composer output#86
AaronFeledy merged 3 commits into
mainfrom
test/ansi-escape-codes

Conversation

@AaronFeledy

@AaronFeledy AaronFeledy commented Feb 27, 2026

Copy link
Copy Markdown
Member

Adds a test that verifies lando composer --version > file.txt does not contain ANSI escape codes in the output file.

This test is expected to FAIL on CI until the fix is applied — removing --ansi from the composer tooling command.

The root cause is --ansi being hardcoded in the composer tooling definition. Composer auto-detects TTY when --ansi isn't forced.

Ref lando/drupal#157


Note

Low Risk
Low risk: a small change to the composer tooling command plus a docs/example verification step; main impact is how lando composer formats output when not attached to a TTY.

Overview
Prevents ANSI escape codes from being emitted when lando composer output is redirected by removing the hardcoded --ansi from the Symfony recipe’s composer tooling command.

Adds a defaults example verification command that asserts redirected lando composer --version output contains no ANSI sequences, and notes the change in CHANGELOG.md.

Written by Cursor Bugbot for commit f20fc1e. This will update automatically on new commits. Configure here.

Adds a test to verify that `lando composer` output does not contain
ANSI escape codes when stdout is redirected to a file.

This test is expected to FAIL until the fix is applied (removing
`--ansi` from the composer tooling command).

Ref lando/drupal#157
@netlify

netlify Bot commented Feb 27, 2026

Copy link
Copy Markdown

Deploy Preview for lando-symfony ready!

Name Link
🔨 Latest commit f20fc1e
🔍 Latest deploy log https://app.netlify.com/projects/lando-symfony/deploys/69a234bbffc8c40008d8648a
😎 Deploy Preview https://deploy-preview-86--lando-symfony.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 84 (🔴 down 7 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Missing blank line between test blocks breaks separation
    • Added the missing blank line after line 45 to maintain consistent formatting between test blocks as used throughout the file.

Create PR

Or push these changes by commenting:

@cursor push 5711b5bfdc
Preview (5711b5bfdc)
diff --git a/examples/symfony-defaults/README.md b/examples/symfony-defaults/README.md
--- a/examples/symfony-defaults/README.md
+++ b/examples/symfony-defaults/README.md
@@ -43,6 +43,7 @@
 
 # Should not include ANSI escape codes when output is redirected
 lando composer --version > /tmp/composer-output.txt 2>&1 && ! grep -P '\x1b\[' /tmp/composer-output.txt
+
 # Should report symfony requirements are met
 lando symfony check:requirements

lando exec appserver -- /bin/sh -c 'NO_COLOR=1 composer -V' | grep "Composer version 2."

# Should not include ANSI escape codes when output is redirected
lando composer --version > /tmp/composer-output.txt 2>&1 && ! grep -P '\x1b\[' /tmp/composer-output.txt

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing blank line between test blocks breaks separation

Low Severity

Every other test block in this file (and all other example READMEs like symfony-custom/README.md) has a blank line separating it from the next # Should ... comment block. The new test at line 45 is missing this blank line before line 46's # Should report symfony requirements are met. This breaks the consistent formatting pattern and could affect how leia parses these test blocks, potentially grouping two separate tests into one.

Fix in Cursor Fix in Web

Composer auto-detects TTY and enables color output when appropriate.
The --ansi flag forced ANSI escape codes even when stdout was redirected
to a file or used in command substitution, breaking scripted usage.

Ref lando/drupal#157
@AaronFeledy AaronFeledy merged commit d0eb802 into main Feb 28, 2026
21 checks passed
@AaronFeledy AaronFeledy deleted the test/ansi-escape-codes branch February 28, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant