Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --ansi option to force table output when not running in a TTY #57

Open
someonewithpc opened this issue Dec 25, 2021 · 1 comment
Open

Comments

@someonewithpc
Copy link

someonewithpc commented Dec 25, 2021

I looked through the code but wasn't able to figure out where the difference comes from, but when running this command from a git pre-commit hook, docker exec -it fails with the error the input device is not a TTY, and without the -it option, the output is not formatted into tables.

Tools like PHPStan and PHP-CS-fixer have a --ansi/--no-ansi option which would be helpful here.

I managed to work around this by running the command with < /dev/tty.

Specifically, the following:

make doc-check < /dev/tty
# where this make target runs bin/php-doc-check
# which runs:
docker exec -it container /path/vendor/bin/php-doc-check folders
@NielsdeBlaauw
Copy link
Owner

NielsdeBlaauw commented Dec 25, 2021

Thanks for sharing this issue @someonewithpc

The table is rendered with the php-cli-tools dependency. Possibly updating to the latest version resolves this issue (partially). At least they have a somewhat related change in the latest release. wp-cli/php-cli-tools#145

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

No branches or pull requests

2 participants