How to Set Up Python for Automatic Code Completion, Pylint, Flake8, Pydocstyle and Python Black?
Forgive me if the first question is a bit too noob-ish. I have been using Atom from Github as an IDE for a while, but their recent announcement on sunsetting made me explore pycharm. So far, I am loving it, although I am still feeling my way around.
But the basic question is how do I get a similar functionality offered by the combined atom packages of pylint, flake8 and Black formatter to
- point out any error spotted by static analysis, as well as deviation from the standards
- at the same time, respect my choice if I want to suppress the issue with # pylint-disable command?
- Offers smart autocompletion, and autoformatting, especially for multi-line commands for long dictionaries, arrays etc.
I noticed it is already pointing out some issues with the code, but not all of them, as pointed out by flake8 (under Atom). So do I have to basically install packages similar to atom which fit my use cases? Also, do the packages support other kind of functionality (not strictly related to python, although I know it's a python ide) such as linter-clang for C++ code, json beautifier, Docker file build etc.?
请先登录再写评论。
Hi,
PyCharm has built-it static analyzer, autocompletion and formatter. Please see:
- Inspection settings (including PEP 8 inspections) https://www.jetbrains.com/help/pycharm/inspections-settings.html
- Disabling and suppressing inspections https://www.jetbrains.com/help/pycharm/disabling-and-enabling-inspections.html
- Code completion https://www.jetbrains.com/help/pycharm/auto-completing-code.html
- Formatting https://www.jetbrains.com/help/pycharm/formatting.html
First, please check the inspection settings and see if there's a setting for it. If not, i.e. if PyCharm doesn't detect some obvious issue, please submit a bug report to https://youtrack.jetbrains.com/issues/py so we could investigate.
All of the above functionality is provided out of the box. This is one of PyCharm strong points -- you don't need to install third-party packages and spend time on extensive configuration. PyCharm does most things out of the box and we try to provide sane defaults.
C++ is not supported in PyCharm, unfortunately. For this, there's CLion IDE.
JSON is beautified by simply using built-in formatter on the file (see the link above)
Dockerfile syntax is supported as well.
I hope you will like PyCharm. If you have questions, please feel free to address them here, or contact our tech. support at https://intellij-support.jetbrains.com/hc/en-us/?pycharm.