Open johnbillion opened 4 years ago
Happy for this to be a premium feature, by the way!
As an alternative, we can use https://github.com/phpstan/phpstan. However, I also would like to see the errors in the navigation of Problems in VS Code.
As a simple helper to prevent silly mistakes, you could install a pre-commit hook
.git/hooks/pre-commit
:
#!/bin/sh
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$( git hash-object -t tree /dev/null )
fi
# Redirect output to stderr.
exec 1>&2
git diff --cached --diff-filter=d --name-only -z $against -- \*.php | xargs --null --no-run-if-empty --max-args=1 php -l > /dev/null
Feature description or problem with existing feature
It's not currently possible to run diagnostics for all files within a workspace without opening them all and making an edit.
Describe the solution you'd like
I'd love a command in the command palette to run diagnostics on all files in the workspace. I can then use the various "Problems" navigation in VS Code to navigate any problems.