This is a plugin for Flake8 that will emulate pylint json output.
Installation
pip install flake8-for-pycharm
flake8 will be automaitcally installed in the same enviroment. To validate installation run flake8_pycharm.py –help-msg=E1101. Output should look like that:
:no-member (E1101): *%s %r has no %r member%s*
Used when a variable is accessed for an unexistent member. This message
belongs to the typecheck checker.
pylint will also be installed because pycharm plugin refuses to work if it’s not installed.
Usage
Locate the file flake8_pycharm.py in your python environment (in linux use command which flake8_pycharm.py)
In Pycharm go to File -> Settings -> Pylint (If you can’t find it, go to Settings -> Plugins and install pylint plugin)
In “Path to Pylint executable”, provide path to “flake8_pycharm.py” script
[ Optional ] In path to pylintrc, provide path to your flake8 configuration file
Do not put anything in the “Arguments” field or script won’t work.
This is it, youa re basically done.
Pylint support
If you want support for both pylint and flake8, you’ll need to add –with-pylint parameter. In PyCharm, add this value in the Arguments field in pylint settings page.
How does it work?
Initially Pycharm call pylint with the following arguments
pylint --help-msg=E1101
Once this command has succeeded, it assumes that pylint is installed and starts using it with command like that.
pylint --rcfile=pylintrc -f json my_file.py
The flake8_pycharm.py script understand those pylint arguments, query flake8 accordingly and return result in same format that pylint produces.
Troubleshooting
If you did everything correctly but pycharm kept complaining about pylint being not installed, you might have to install it anyway. It’s a bug reported by a colleague but I wasn’t able to reproduce it locallay.
If you received errors from pycharm, you can try to run the command manually to see if it’s producing errors.
flake8_pycharm.py --rcfile=<your flake8 configuration> -f json my_file.py
Metadata
Release files for flake8-for-pycharm 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| flake8-for-pycharm-0.4.1.tar.gz | 6.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flake8_for_pycharm-0.4.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 12.6 kB
Release files / flake8-for-pycharm-0.4.1.tar.gz
| Download URL | flake8-for-pycharm-0.4.1.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec0f3aa95d3f0cc7a9e7bad1d16e56862909a8d03a14047cf93bf1c1e0a2e2bc
|
|
BLAKE2b-256 checksum How to use checksums |
a0688e9509ddf55d14adc26a46e123a29d10611658ae1b427f166371cc67d2f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / flake8_for_pycharm-0.4.1-py2.py3-none-any.whl
| Download URL | flake8_for_pycharm-0.4.1-py2.py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
d4c642daa70afb1a24af958500699e28579a47ae7d0bbcc2290cf799157877ae
|
|
BLAKE2b-256 checksum How to use checksums |
be7a169259db6d8e6697d684ca51a0676b9db5d6c4b1f1b31b42fe1598e7a004
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Security for flake8-for-pycharm 0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.