PyCharm/IntelliJ 18 This file is indented with tabs instead of 4 spaces

In PyCharm / IntelliJ you can see yellow notification of the top of the working file:

This file is indented with tabs instead of 4 spaces

This happens very often when people with different configurations are working together on a project. For example working from Windows and Linux machine could provoke this warning. There are several ways to solve it:

disable notification This file is indented with tabs instead of 4 spaces

In order to stop seeing the notification in PyCharm and IntelliJ 18 you can do:

  • File
  • Settings (Preferences on Mac) Ctrl + Shift + S
  • Editor
  • Inspections
  • Search for indent
  • Select settings for specific language - i.e. Python
  • Disable the notification

pycharm_space_tab_warning

Change only for the current file

  • Open the problematic file
  • Press Ctrl + Shift + A
  • Search tabs/spaces
  • Select what should be used
    • To tabs
    • To spaces

Change global for file type/language

  • File
  • Settings (Preferences on Mac) Ctrl + Shift + S
  • Editor
  • Code Style
  • Select language Python, Java, Groovy
  • Tabs and Indents
  • Mark Use tab character
  • Finally you can reident your code by: Ctrl + Alt + L

Related Article