Skip to content

Instantly share code, notes, and snippets.

@scharf
Last active May 12, 2022 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scharf/a8d505f15f3fe261362f6e5b5f5c7557 to your computer and use it in GitHub Desktop.
Save scharf/a8d505f15f3fe261362f6e5b5f5c7557 to your computer and use it in GitHub Desktop.
mypy wrapper to make the error links clickabe in pycharm/webstorm/intellij (jetbrains)
#!/bin/bash
PY_ROOT=$(cd "$(dirname "$0")";cd ../..; pwd)
MYPY_BIN=${PY_ROOT}/.venv/bin/mypy
basepath=`pwd`
OUTPUT=`$MYPY_BIN $*`
echo
$MYPY_BIN $* | awk -v basepath=$basepath '{done=0} /.*:.*:.*/ {print basepath"/" $0; done=1} done==0 {print}'
exit ${PIPESTATUS[0]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment