Flake8 json formatter that produces output pycharm can recognize
Project description
This is a plugin for Flake8 that will emulate pylint json output.
Installation
pip install git+https://gitlab.com/ramast/flake8-for-pycharm.git#egg=flake8-for-pycharm
Make sure you have flake8 installed in the same enviroment.
pip install flake8
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.
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.
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for flake8_for_pycharm-0.3.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f96d3ff8c9a52606327f9d550ed5c87dc86b73fccdd0b0a3df4954be6b7a3ef |
|
MD5 | 2a5517d799cd8eeedce6180f6b40e655 |
|
BLAKE2b-256 | 9c7ddc844a39448fa67e96dcd760a68491aa64064630847b8e03ddfd53dd68a2 |