godot-gdscript-toolkit icon indicating copy to clipboard operation
godot-gdscript-toolkit copied to clipboard

Method chaining not creating newlines to go under max length

Open viviicat opened this issue 3 years ago • 1 comments
trafficstars

Version: 3.3.1

I am using a unit test library which uses method chaining and I'm running into an issue where gdlint and gdformat do not agree with each other. gdformat is flattening the code to a single line, which causes gdlint to raise the max-line-length error. This is happening with the default line-length of 100 chars.

This seems similar to #148, but not exactly the same as it doesn't have to do with return types.

Specifically it seems to have trouble with something like this:

	do_some_stuff(["with", "a", "decently", "long", "array", "of", "strings", "and", "other"]).is_cool()

I have attached a script that demonstrates this issue: test.zip

Please let me know if it's likely to be already fixed upstream. For now, I have disabled max-line-length in the file where this problem is present!

viviicat avatar Apr 21 '22 07:04 viviicat

This is a known problem I can't resolve due to a bug in Godot - https://github.com/godotengine/godot/issues/35415 (fixed in 4.0). Thus I'll fix it in the gdtoolkit 4.0. For now, consider adding an extra variable to reduce line length and increase readability.

Scony avatar Apr 21 '22 16:04 Scony