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

annoying newline after an empty diff #1781

Closed
hujuice opened this issue Dec 13, 2017 · 5 comments
Closed

annoying newline after an empty diff #1781

hujuice opened this issue Dec 13, 2017 · 5 comments
Milestone

Comments

@hujuice
Copy link

hujuice commented Dec 13, 2017

This is a very minor bug, but annoying for me.
If I run
phpcs --report=diff
in absence of errors and warnings, a newline is printed.

So, for example, my pre-commit git hook results malformed

echo -n 'PHP CodeSniffer... '
if vendor/bin/phpcs -s --report=diff $i; then
    echo 'ok'
else
    echo 'failed'
    exit 1
fi

Yes, it's really minor, but grrrr >:-(

Regards (and thanks),
HUjuice

@deleugpn
Copy link

What is malformed?

@hujuice
Copy link
Author

hujuice commented Dec 13, 2017

Even if I use the -n option after the first echo command, the output will be

PHP CodeSniffer...
ok

What I want, using the -n option, is

PHP CodeSniffer... ok

Very minor, I know.

@hujuice
Copy link
Author

hujuice commented Dec 13, 2017

In other words, the output is not an empty string '' but a newline "\n".

@gsherwood
Copy link
Member

Annoying no more!

@hujuice
Copy link
Author

hujuice commented Dec 14, 2017

composer require --dev "squizlabs/PHP_CodeSniffer" : "dev-master#ef0678a"
is very nice 👍

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

3 participants