Skip to main content

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

  1. Locate the file flake8_pycharm.py in your python environment (in linux use command which flake8_pycharm.py)

  2. In Pycharm go to File -> Settings -> Pylint (If you can’t find it, go to Settings -> Plugins and install pylint plugin)

  3. In “Path to Pylint executable”, provide path to “flake8_pycharm.py” script

  4. [ Optional ] In path to pylintrc, provide path to your flake8 configuration file

  5. Do not put anything in the “Arguments” field or script won’t work.

  6. 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

flake8-for-pycharm-0.3.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flake8_for_pycharm-0.3.1-py2.py3-none-any.whl (5.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file flake8-for-pycharm-0.3.1.tar.gz.

File metadata

  • Download URL: flake8-for-pycharm-0.3.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.9

File hashes

Hashes for flake8-for-pycharm-0.3.1.tar.gz
Algorithm Hash digest
SHA256 5376799a18482c2ac041cc8c03ddf17c6d5196c90f6e6cc9842aa8dc771652a6
MD5 c5b02a2a79bff631e74d38f7164c47b9
BLAKE2b-256 9c69e88d388eb8a6c815894c834f2e7b499f0df0850a0d13d0c37f79d5c24f67

See more details on using hashes here.

File details

Details for the file flake8_for_pycharm-0.3.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_for_pycharm-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 42f9db0bb3bda4177d37bc22a8a243c287de44df07005803585487919604950c
MD5 e3160caf0114c12622b5bd722b04606e
BLAKE2b-256 facf69c78dd040d45978e6ec3fd19cfcf0ac08ebe774fe2d8239702fecbd5d9a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page