Godot: Parse error: Spaces used for indentation in tab-indented file!

Created on 7 Oct 2019  路  8Comments  路  Source: godotengine/godot

**Godot version:3.2 alpha 1

OS/device including version:
Mac OS 10.14.6

Issue description:
When open 3.1 projects in 3.2 alpha 1, the output this error.
Another similar error is:
Tabs used for indentation in space-indented file!

Steps to reproduce:

Minimal reproduction project:

bug editor gdscript

All 8 comments

In Godot 3.2, each file must have indentations created with spaces or tabs, but you cannot mix them together.

I expected 'Convert Indent On Save' to fix all indent errors but it doesn't help in this case, is it a bug?

Already exists easy way to convert indents to spaces or tabs(but not automatically)
Screenshot_20191007_182441

In 3.1.1 it shows no error but in Godot version:3.2 alpha 1 it does.

It catches empty lines with spaces as invalid indent which is new, it should convert them,
Using 'Convert Indent to Tabs' is doing nothing in this case.

func _ready():
    print("")

    print("")

By default Godot convert 4 spaces to tabulator.
I see here only 3 spaces

whelp, i've got about 20k lines of gds to go through, disgonnabegood.jpg
edit: actually, holy crap this error is actually making my code look way nicer. i have tons of indents, extra whitespaces and spaces mixed up all over the place lmao

edit2: I was just about to post complaining about this error, but tbh I kinda like it now. Makes my code look tidier
edit3: I originally thought it was a GDS warning (that could be disabled), lol

It catches empty lines with spaces as invalid indent which is new, it should convert them,
Using 'Convert Indent to Tabs' is doing nothing in this case.

Yeah, sometimes it doesn't convert them, but sometimes it does. If i can reproduce in a minimal example, I'll post back. So far, I'm just clicking on the errors, then removing all the extra crap. Sometimes there is a sneaky tab indent after the end of a line

Also, watch out for these sneaky little devils

PS: One can set up pre-commit with a bunch of predefined hooks to clean up files automatically on every commit :slightly_smiling_face:

In Godot 3.2, each file must have indentations created with spaces or tabs, but you cannot mix them together.

@bojidar-bg: Hold my beer 馃槅

Damn, now we can mix them lol oh well my code looks way nicer ;p. I'm happy

Was this page helpful?
0 / 5 - 0 ratings