How to avoid the spell check on string in Pycharm

60,434

Solution 1

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

In the latest version of PyCharm it appears as ProofReading:

ProofReading

Solution 3

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

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

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

Share:
60,434

Related videos on Youtube

StefanoG_ITA
Author by

StefanoG_ITA

Updated on April 09, 2022

Comments

  • StefanoG_ITA
    StefanoG_ITA about 2 years

    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.

    • S.L. Barth
      S.L. Barth about 10 years
      @Close Voters: I see 2 of you suggest moving this to SU. Questions about programming tools are on-topic for SO, so I disagree with these particular close votes.
    • LazyOne
      LazyOne about 10 years
      In case if this is not the spell checker -- please show a screenshot with some example code.
  • Mark Ribau
    Mark Ribau over 8 years
    # noinspection SpellCheckingInspection
  • Bob Stein
    Bob Stein over 6 years
    Thanks @MarkRibau. How to do it for a specific comment? There doesn't seem to be a way.
  • Mark Ribau
    Mark Ribau over 6 years
    I just put that on the line above the line with the false spelling error. Does that help you?
  • Kelly Bang
    Kelly Bang about 4 years
    For me there was no 'Spelling' section, it was under 'Proofreading'
  • Qedized
    Qedized about 4 years
    @KellyBang Thanks, that seemed to be the case for me too. Maybe in the newer versions they changed the location.
  • WinEunuuchs2Unix
    WinEunuuchs2Unix almost 3 years
    For some strange reason I have to insert the directive two lines in a row for it to take effect.