Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please support a built in way to run linters such as mypy. #265

Closed
jsonmcfall opened this issue Dec 6, 2019 · 3 comments
Closed

Please support a built in way to run linters such as mypy. #265

jsonmcfall opened this issue Dec 6, 2019 · 3 comments

Comments

@jsonmcfall
Copy link

Please add the ability to easily run external tools/linters such as Mypy with native support. I have seen a few complex solutions but it would be nice to have an official way to do this.
There has been an issue open on the Mypy side for about two years: python/mypy#3912

@thundergolfer
Copy link
Collaborator

thundergolfer commented Dec 7, 2019

I don't think running linters or type-checkers like MyPy should be something rules_python should natively support. Right now I can't think of any other rule_* that have native support for linters. None of rules_scala, rules_go, rules_java, and rules_rust do. Type-hinting is in stdlib since 3.6 (2.7 as comments) but type-checking isn't provided by Python and MyPy is just one solution to the problem. I think this project should just focus on core language functionality and packaging.

At the bottom of that thread you link, I've linked to a recently created Bazel+MyPy integration (https://github.com/thundergolfer/bazel-mypy-integration). I started it last week, and while it's not 1.0 yet I intend to get it user-ready so we can integrate it into a monorepo at work. It's based on Aspects, and I don't think is really that complicated. Have you looked at it? Feedback is welcome 🙂

@thundergolfer
Copy link
Collaborator

Update so say we've recently begun use of https://github.com/thundergolfer/bazel-mypy-integration at work.

Dropbox has also recently open-sourced on Github a different approach to doing MyPy checks on Python code.

So while these are not "built-in" ways of supporting MyPy I think they'll satisfy your needs.

@thundergolfer
Copy link
Collaborator

Closing as this project will for now just focus on the core language rules and packaging rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants