I am the developer of pylint-pycharm and mypy-pycharm, two plugins
providing both real-time and on-demand scanning of Python files with
PyLint/Mypy from within PyCharm/IDEA.
The real-time code inspection works automatically the same way like the
PyCharm's build-in PEP8 check (you see the issues highlighted directly in
your code while typing).
The on-demand inspection has several options that go from just scanning the
current file to scan the entire project.
The plugins also offer an option to run a check on modified files before a
If you are familiar with Checkstyle-IDEA plugin for Java, they are very
similar and offer the same features (and share a lot of the code).
The plugins source code is available here:
But they can also be easily installed from the official JetBrains Plugin
1. In PyCharm, open the Settings/Preferences dialog (CTRL+Alt+S), click
2. Click Browse repositories.
3. In the Browse Repositories dialog that opens, right-click on the plugin
named "Pylint" or "Mypy" and select Download and Install.
4. Confirm your intention to download and install the selected plugin.
5. Click Close.
6. Click OK in the Settings dialog and restart PyCharm for the changes to
Thanks and enjoy linting!
Hopefully this is the right place for Pylint suggestions; I did not see any
other mailing lists that appeared to fit.
I am working on a large project with a lot of existing Python code,
and we use pylint in our processes.
One frequently used module has a class with a lot of property methods
and regular methods, e.g.
return some_other_test() == 42
So, naturally, I mistakenly used the last item above as if it was
a property instead of a method:
The code, of course, needs to be:
The first form is valid code but mostly useless, because the
is_fubd method exists so an 'if' test is always true. And it is
a real pain to find the mistake by inspection. It would sure
be nice to have pylint flag this usage as suspicious.
This is my first post to this list, so first, let me give a quick
introduction. I'm VP of Engineering at GrammaTech, where I am in charge
of an advanced static analysis tool named CodeSonar. It primarily works
for C and C++, but also for x86, x64 and ARM binaries. We cover other
languages by integrating with other tools (mostly open source). We don't
have an integration with Pylint yet, but that's coming as described below.
I'm writing to let the community know of some work we will be doing that
should benefit everyone. I think I know the best way forward, but I'd
appreciate any words of wisdom and feedback on our approach.
SARIF stands for Static Analysis Results Interchange Format. It is a new
standard that originated at Microsoft, and that is now under the OASIS
umbrella (I'm on the TC):
idea is to make it easier for tools that produce results to integrate
with tools that consume results. Our own tool is both a producer and a
consumer. That is, it can import results from SARIF-compatible tools and
show them it is user interface. Our strategy to make CodeSonar be useful
for other languages is through SARIF; we'll write converters to SARIF
for the best-of-breed tools.
Consequently, we are planning to make it so that Pylint can produce
SARIF. There are two good ways to do this.
1. The easiest thing to do is to simply run "pylint -f json ..." and
write a simple program to convert the output to SARIF (data from "pylint
--list-msgs" is also needed). We're doing this first. A nice thing about
this approach is that it doesn't require any changes to Pylint. The
disadvantage is that it's likely to be very sensitive to the particular
version of Pylint used. E.g., if the format of those outputs change. The
plan is to contribute this to the sarif SDK github.
2. The better long-term approach is to change pylint to add a new output
format so one can do "pylint -f sarif ...". This way, everyone gets it.
I'm not expecting this to be too difficult, although I concede that I
haven't scrutinized the pylint code enough to know for sure.
I'm expecting #1 to appear within a couple of weeks, and to start work
on #2 by the end of the month. I'd appreciate any input from interested
Paul Anderson, VP of Engineering, GrammaTech, Inc.
531 Esty St., Ithaca, NY 14850
Tel: +1 607 273-7340 x118; http://www.grammatech.com