pyright's output is quite verbose for a pre-commit hook. We can combine it with grep to give much less verbose output:
hooks:
- id: pyright
entry: bash -c '! pyright "$@" | grep -Po "(?<=$PWD/)(.*:.*)"' --
Does it make sense to add this as a second hook, maybe "pyright-minimal"?
Of course, a caveat here is that it is less robust and could silently fail if $PWD contains funny special characters.
pyright's output is quite verbose for a pre-commit hook. We can combine it with grep to give much less verbose output:Does it make sense to add this as a second hook, maybe "pyright-minimal"?
Of course, a caveat here is that it is less robust and could silently fail if
$PWDcontains funny special characters.