You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While this results in a cleaner looking output, it means the output is less useful when using pytest-mypy with other tools like Pycharm. When I change the code to include the filename, Pycharm turns it into a link which I can click to bring me directly to the place where the error is. Without the filename this doesn't work.
The text was updated successfully, but these errors were encountered:
In pypa/setuptools#4502, we've dived deep into this issue and find the default behavior of pytest-mypy to be suboptimal. It's inconsistent with the output from other tools, including mypy itself, which include the relative file path on each line. As pointed out, without this path, editors like VSCode and Pycharm are unable to provide easy hyperlinks to the relevant causes. The hook to customize the output is nice, but it requires each and every downstream project to implement something, or for someone to write yet another plugin to customize the behavior. Ideally, pytest-mypy would provide a default that's consistent with other tools and friendly to developers out of the box.
Would this project consider one or more of these options:
make relative path emission the default behavior and allow users to opt-out
provide an option to customize the emission strategy (e.g. --mypy-path-reporting={none,relative,absolute})
Feel free to transfer this comment to a new issue if you agree.
These lines strip the file name from the reported errors.
https://github.com/dbader/pytest-mypy/blob/8c99601158157ad96698d5a89357035e701bcf90/src/pytest_mypy.py#L234-L237
While this results in a cleaner looking output, it means the output is less useful when using pytest-mypy with other tools like Pycharm. When I change the code to include the filename, Pycharm turns it into a link which I can click to bring me directly to the place where the error is. Without the filename this doesn't work.
The text was updated successfully, but these errors were encountered: