Eclipse bad indentation warning

2019-04-07 07:10发布

I am using PyDev perspective. I get a "bad indentation" warning in python files. I am using two spaces for indent and eclipse seems to want me to use 4.

How to set the indentation I want so this warning goes away?

3条回答
【Aperson】
2楼-- · 2019-04-07 07:37

Do Control+A to select all. Then go under the "source" menu tab and select "correct indentation".

Source: currently have Eclipse open.

查看更多
甜甜的少女心
3楼-- · 2019-04-07 07:38

Warning:

Bad indentation (2 spaces)

Solution:

  1. CTRL A (select all code in current file)

  2. Source -> Convert tabs to space-tabs [In main menu bar]

  3. Write 2

查看更多
神经病院院长
4楼-- · 2019-04-07 08:00

You have to change the tab length that PyDev uses at:

window > preferences > pydev > editor > tab length

查看更多
登录 后发表回答