-
-
Save tossmilestone/23139d870841a3d5cba2aea28da1a895 to your computer and use it in GitHub Desktop.
How to manually setup flake8 as PyCharm external tool | |
File / Settings / Tools / External Tools / Add | |
Name: Flake8 | |
Program: $PyInterpreterDirectory$/python | |
Parameters: -m flake8 --max-complexity 10 --ignore E501 $FilePath$ | |
Working directory: $ProjectFileDir$ | |
Output Filters / Add | |
Name: Filter 1 | |
Regular expression to match output: | |
$FILE_PATH$\:$LINE$\:$COLUMN$\:.* | |
Output Filters / Add | |
Name: Filter 2 | |
Regular expression to match output: | |
$FILE_PATH$\:$LINE$\:.* | |
To check source with flake8: | |
Tools / External Tools / Flake8 | |
Can be used with single files as well as with directories, recursively. |
not work, errors: permission denied.
thx, it working
Ty! Output filters work great with pylint too; see https://www.jetbrains.com/help/pycharm/configuring-third-party-tools.html#pylint-configure
Using this config with file watcher:
Can flake8 be configured to run automatically in pycharm?
How can I use a flake8 config file (setup.cfg) together with the external tooling?
How can I use a flake8 config file (setup.cfg) together with the external tooling?
@patrickwerz
I think you can add the setup.cfg
to the Parameters
:
Parameters: -m flake8 --max-complexity 10 --ignore E501 $FilePath$
and use the $ProjectFileDir$
to locate your setup.cfg
.
Thank's a lot, really helpful info! 👍
thanks for helps!!
Created a small repo for pycharm external tools (currently flake8 and black supported ) for applying to a code selection from pycharm.
Maybe this will be somewhat helpful to anyone: https://github.com/haim0n/pycharm_ext_tools
Thank you, @haim0n!
Thank you, worked like a charm!
Cheers , glad to help :)
Just bear in mind that flake8 deprecated the support for --diff
option in its next versions: https://flake8.pycqa.org/en/latest/release-notes/5.0.0.html#deprecations
thanks, it helps