Skip to content

Command with xdebug enabled causes invalid json #189

Description

@rollecode

Phpcs doesn't really need xdebug but will produce error because the command warns for not being able to connect to debugging client. This means vscode-phpcs cannot lint at all despite phpcs is working fine:

$ /usr/local/bin/phpcs --report=json -q -s --encoding=UTF-8 --standard=/Users/rolle/Projects/airdev/content/themes/air-light/phpcs.xml --error-severity=5 --warning-severity=5 --stdin-path=/Users/rolle/Projects/airdev/content/themes/air-light/inc/includes/nav-walker.php
Xdebug: [Step Debug] Could not connect to debugging client. Tried: 127.0.0.1:9003 (through xdebug.client_host/xdebug.client_port) :-(
{"totals":{"errors":10,"warnings":13,"fixable":10},"files":{"\/Users\/rolle\/Projects\/airdev\/content\/themes\/air-light\/functions.php":{"errors":0 
<truncated>

Any way to disable xdebug (also asked in PHP_Codesniffer issue) OR add environment variable XDEBUG_MODE=off before the executable? We have "solved" this for now with our custom executable script as described here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions