To make a long story short due to company policy I have to make a local copy on our bitbucket server of this repo: https://github.com/pre-commit/mirrors-mypy
I have a python project with a .pre-commmit-config.yaml file that looks like this:
repos:
- repo: http://host/scm/~user/local_pre-commit_mypy.git
rev: 'hash'
hooks:
- id: mypy
name: mypy
types: [python]
When I run:
pre-commit run
in my pycharm terminal I get an output that I want that looks like this:
[INFO] Initializing environment for http://host/scm/~user/local_pre-commit_mypy.git.
[INFO] Installing environment for http://host/scm/~user/local_pre-commit_mypy.git.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
mypy.....................................................................Failed
- hook id: mypy
- exit code: 1
OCR_test.py:14: error: Function is missing a return type annotation
OCR_test.py:14: note: Use "-> None" if function does not return a value
OCR_test.py:30: error: Function is missing a return type annotation
OCR_test.py:30: note: Use "-> None" if function does not return a value
OCR_test.py:50: error: Function is missing a type annotation
OCR_test.py:77: error: Function is missing a type annotation
OCR_test.py:96: error: Function is missing a return type annotation
OCR_test.py:96: note: Use "-> None" if function does not return a value
OCR_test.py:101: error: Function is missing a return type annotation
OCR_test.py:101: note: Use "-> None" if function does not return a value
OCR_test.py:130: error: Call to untyped function "upload_files_to_cloud" in typed context
Found 7 errors in 1 file (checked 1 source file)
Which is exactly what I expect and want
However when I run:
git commit -a -m"Changed pre commit stuff"
The result looks like this:
[INFO] Initializing environment for http://host/scm/~user/local_pre-commit_mypy.git.
[INFO] Installing environment for http://host/scm/~user/local_pre-commit_mypy.git.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
mypy.....................................................................Failed
- hook id: mypy
- exit code: 1
Which gives me mostly what I want, but doesn't give me the proper output like what file and line is causing it to fail.
I want the output from gitbash to look like the output from the pycharm terminal Is there something I am doing wrong, or is this normal?