How to avoid the spell check on string in Pycharm

PythonSyntaxPycharm

Python Problem Overview


Where is the option to disable the spell check on the strings for the PyCharm IDE? I hate the jagged line under my comments and strings.

Python Solutions


Solution 1 - Python

Go to File -> Settings -> Editor -> Inspections. Expand the list under Spelling in the middle window and uncheck the option Typo.

enter image description here

However, practically most of the jagged line is caused by violations of the PEP 8 coding style. If you would like to disable this option too, in the same window, expand the list under Python and uncheck the option PEP 8 coding style violation.

Solution 2 - Python

In the latest version of PyCharm it appears as ProofReading:

ProofReading

Solution 3 - Python

You can disable spellchecking for specific code section by commenting # noinspection SpellCheckingInspection above it.

See https://www.jetbrains.com/help/pycharm/spellchecking.html

Solution 4 - Python

PyCharm does not check the syntax inside strings and comments. It checks spelling.

You can find the settings of the spell-checker under the Settings... page. There is a Spelling page inside Project Settings. Inside this page, at the bottom of the Dictionaries tab you can enable/disable dictionaries. If you don't want spell checking simply disable all of them.

Note that it is possible to add custom words in the spell checker, or, if you already have a dictionary on your computer, you can add it. This can turn out useful if you want to spell check different languages (for example Italian).

In particular if you are using a Linux system and you have installed the Italian language pack, you probably have the Italian dictionary under: /usr/share/dict/italian. You can add the /usr/share/dict directory to the directories searched for dictionaries and enable the italian dictionary.


It seems like PyCharm only checks files with the .dic extension. If you want to use /usr/share/dict/italian you should probably either copy it into an other directory renaming it italian.dic or you could create a symbolic link.

Solution 5 - Python

In my opinion the best option is to disable typo checks only for code. This way green lines under variable/method/class names and strings disappear, but PyCharm still controls comments to avoid misspellings, so You have both nice compact code and fully understandable docs.

I don't exactly know since which PyCharm version this option is accessible, but for sure in revision 2020.2 if You highlight a Typo in Settings > Editor > Inspections > Proofreading there are three additional options in the right panel - just uncheck Process code.

enter image description here

Solution 6 - Python

In the newer version of PyCharm, go to Preferences -> Editor -> Inspections -> Spelling.

Solution 7 - Python

You can also add particular typo word to PyCharm dictionary by pressing Alt + Enter this word and select Save [typo word] to dictionary. Sometimes this is best choice for me.

Solution 8 - Python

I found how to disable typos only in string literals in official documentation by disabling process literals, but it doesn't work for me (maybe it's a bug, that will be fixed in the future).

Settings->Proofreading->Typo

Solution 9 - Python

For single line you can use the # noqa at the end of the line and it will suppress spelling inspections (the squiggly green line).

GOOFY_API_USERNAME_THING = "LAksdfallae@#lkdaslekserlse#lsese" # noqa

I'm using PyCharm 2021.3.2

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionStefanoG_ITAView Question on Stackoverflow
Solution 1 - PythonThan SkourtanView Answer on Stackoverflow
Solution 2 - PythonNicolas LopezView Answer on Stackoverflow
Solution 3 - Pythonuser3105337View Answer on Stackoverflow
Solution 4 - PythonBakuriuView Answer on Stackoverflow
Solution 5 - PythonJakub RakusView Answer on Stackoverflow
Solution 6 - PythonBrndnView Answer on Stackoverflow
Solution 7 - PythonvalexView Answer on Stackoverflow
Solution 8 - PythonAzamat_yaminView Answer on Stackoverflow
Solution 9 - PythonlexnnView Answer on Stackoverflow