PHP_CodeSniffer: phpcs reads from stdin which requires a terminal, and hangs if there are none.
With version 2.6.0, phpcs now tries to read content from stdin.
This of course either requires a terminal or an incoming stream from another process.
When running phpcs as part of a git pre-commit hook in git gui or any other GUI around git which doesn’t allocate a terminal, this completely blocks the pre-commit process and and the GUI itself, the process is stuck in T state on linux or osx.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 23 (10 by maintainers)
Commits related to this issue
- Read stdin input from the dup()’ed non-blocking handle Read stdin from the handle opened via `fopen('php://stdin')`, not the original `STDIN` handle which may not have been affected by the `stream_se... — committed to addaleax/PHP_CodeSniffer by addaleax 8 years ago
- The Internal.NoCodeFound error is no longer generated for content sourced from STDIN (ref #993) — committed to squizlabs/PHP_CodeSniffer by gsherwood 8 years ago
- Echo blank line to phpcs to provide STDIN input Blank line is needed to provide STDIN input to phpcs when phpcs is called from the Git pre-push hook context. See https://github.com/squizlabs/PHP_Code... — committed to ibuildingsnl/qa-tools by deleted user 8 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Fix slow input on stdin Non-blocking reading from stdin was introduced in 80b156de8d440b6245e6b1dd7f8df777d99064fa because we had problems with auto detecting whether we should read from stdin or not... — committed to arnested/PHP_CodeSniffer by arnested 7 years ago
- Changelog + minor changes for #1490 (ref #993, #1472) — committed to squizlabs/PHP_CodeSniffer by gsherwood 7 years ago
For us as a solution was these lines in ruleset file
Just want to share my case
I recently update phpcs to 2.6 and I’ve started to have the same problem with STDIN. I’ve never had it before.
I’m using phing to automate some build steps, and I’m running it from pre-push hook like this
I’ve following problem
Meanwhile if I’m running
phpcsor with help phingvendor/bin/phing verify-devfrom terminal it works finehere is my phpcs-dev target which I have in build.xml
and it seems that chnages in my build.xml like this
spawn="true"- solves the problem