Repository navigation
Addon: Error when running the formatter with safe mode + reorder code both active #286
Description
Activity
Same problem here, with Godot .NET and GDScript in a Mac Tahoe 26.5.
I tried updating byFormat > Install or Update Formattermenu, but still not working.- changed the title
[-]Doesn't work and idk how to troubleshoot it[/-][+]Addon: Error when running the formatter after install[/+]on Jul 22, 2026 Could you please show me how you point at the binary in the editor settings? Do you use an absolute path? Just the binary name?
Having the same issue (endeavor os - arch linux 4.7.1 stable installed through pacman). It's listed as the absolute path to it:
/home/{USER}/.cache/godot/gdquest/gdscript-formatterI did also make it an executable and then run it in the cli, which it did work (just repeating what OP said)
Reacted by Cosmo Myzrail Gorynych aka CoMiGoCosmoMyzrailGorynych commented
on Jul 22, 2026 AuthorMore actionsCould you please show me how you point at the binary in the editor settings? Do you use an absolute path? Just the binary name?
I didn't do anything manually. I ran the command the readme tells to download/update the binary, and it set the real absolute path to the executable.
- added a commit that references this issue
on Jul 23, 2026 Could you please try this version? It has a small patch. I'm not getting the issue on my test machines, so I'm not exactly sure yet what's happening. At least this update captures any errors reported by the formatter or while "installing" it.
You can replace your copy of the addon with the files in there, then run install or update formatter, and on your script: Format -> Format Current Script
Then if it fails, please copy paste the output from the Output bottom panel. Normally it should include any error message the formatter itself reports. Could you also please tell me if you use any particular settings for the add-on? Like the safe mode in the editor settings.
Just redownloaded, heres the output:
ERROR: core/variant/variant_utility.cpp:1023 - Format GDScript failed: res://utilities/ui/pixel_menu.gd ERROR: core/variant/variant_utility.cpp:1023 - Exit code: 1 Output: Formatting 1 file...Error: "Failed to format file /tmp/gdscript_formatter_72609.gd: Safe mode: formatted output is structurally different from input. Keeping original source." ERROR: core/variant/variant_utility.cpp:1023 - If your script does not have any syntax errors, this might be a formatter bug.wait I tried it without safe mode and it works...
These are the settings I used (and it works without safemode and it fails with it on)
Hope that helps!
Thanks! Okay, I see, if you use reorder with safe mode it's normal that it fails, the settings are not compatible at the moment. I'll think of a way to change this to warn you about this.
Safe mode reparses the file after formatting and verifies that the the syntax tree is the same as before formatting. But when reordering we change the order of function so that changes the parsed syntax tree which triggers the safe mode safety.
I generally don't recommend turning on reordering at all times personally, but rather running it manually occasionally because an automatic order is not necessarily ideal for following along your code. It works well for small scripts but it's not necessarily productive for larger code files.
CosmoMyzrailGorynych commented
on Jul 23, 2026 AuthorMore actionsReplicated what PixelSaver received.
Confirming that turning safe mode off does format the code successfully.
Also found a new formatter bug :) 😅 Will open/lookup an issue.I generally don't recommend turning on reordering at all times personally, but rather running it manually occasionally because an automatic order is not necessarily ideal for following along your code.
Yeah, but code standards are standards, and the best way to enforce them is to make them unavoidable (equals "automatic" here). Ideally there should be tweaks to make this or that more lax, and I guess they will come with time.
I'll think of a way to change this to warn you about this.
Perhaps make the binary do a simple flag check and bail out early with an error message with something along "Safe mode cannot be combined with reordering", as the errors will now be properly logged in the Output panel in Godot?
Reacted by Nathan GDQuest- changed the title
[-]Addon: Error when running the formatter after install[/-][+]Addon: Error when running the formatter with safe mode + reorder code both active[/+]on Jul 24, 2026 Yeah, but code standards are standards
For code style, it's actually guidelines, it's not hard rules. The code order part in particular is something to help beginners reduce cognitive load or for people who really like strict consistency.
Closed by #296
Godot v4.7.1, Fedora Linux, installed through Flatpak. Godot has full filesystem access.
The binary is present at
/home/comigo/.var/app/org.godotengine.Godot/cache/godot/gdquest/gdscript-formatter, has the +x flag. The plugin's settings do point at this location.Throws this on every format command (tried with different scripts, all are valid and working in-game):
Running the executable in style
./gdscript-formatter /path/to/file.gddoes work and change the file (and makes mistakes, will open a separate issue if there isn't one for that case).Still, it doesn't run in Godot. I tried disabling other script editor-related plugin, restarted, and it didn't help.