Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments at the end of if condition are moved outside #143

Open
qarmin opened this issue Oct 8, 2021 · 1 comment
Open

Comments at the end of if condition are moved outside #143

qarmin opened this issue Oct 8, 2021 · 1 comment
Labels
bug Something isn't working formatter
Milestone

Comments

@qarmin
Copy link

qarmin commented Oct 8, 2021

Formatting this code

extends Node2D


#func _ready() -> void:
func _process(delta) -> void:
	var t = TYPE_NIL
	if !(
		t == TYPE_NIL
		|| t == TYPE_AABB
		|| t == TYPE_ARRAY
		|| t == TYPE_BASIS
		|| t == TYPE_BOOL
		|| t == TYPE_COLOR
		|| t == TYPE_COLOR_ARRAY
		|| t == TYPE_DICTIONARY
		|| t == TYPE_INT
		|| t == TYPE_VECTOR3_ARRAY
		#			# TODOGODOT4
		#			|| t == TYPE_VECTOR2I
		#			|| t == TYPE_VECTOR3I
		#			|| t == TYPE_STRING_NAME
		#			|| t == TYPE_RECT2I
		#			|| t == TYPE_FLOAT64_ARRAY
		#			|| t == TYPE_INT64_ARRAY
		#			|| t == TYPE_CALLABLE
	):
		return 

produce such result

extends Node2D


#func _ready() -> void:
func _process(delta) -> void:
	var t = TYPE_NIL
	if !(
		t == TYPE_NIL
		|| t == TYPE_AABB
		|| t == TYPE_ARRAY
		|| t == TYPE_BASIS
		|| t == TYPE_BOOL
		|| t == TYPE_COLOR
		|| t == TYPE_COLOR_ARRAY
		|| t == TYPE_DICTIONARY
		|| t == TYPE_INT
		|| t == TYPE_VECTOR3_ARRAY
	):
		#			# TODOGODOT4
		#			|| t == TYPE_VECTOR2I
		#			|| t == TYPE_VECTOR3I
		#			|| t == TYPE_STRING_NAME
		#			|| t == TYPE_RECT2I
		#			|| t == TYPE_FLOAT64_ARRAY
		#			|| t == TYPE_INT64_ARRAY
		#			|| t == TYPE_CALLABLE
		return

I added comment inside if, to be able to uncomment easily it, but after formatting I must copy this code each time

@Scony Scony added this to the 4.x milestone Oct 10, 2021
@Scony Scony added bug Something isn't working formatter labels Oct 10, 2021
@qarmin
Copy link
Author

qarmin commented Oct 23, 2021

Similar example

--- a/Autoloads/ValueCreator.gd
+++ b/Autoloads/ValueCreator.gd
@@ -19,17 +19,20 @@ func get_int() -> int:
                        return 0
                while true:
                        var temp_number: int = (randi() % int(number)) - int(number / 2.0)
-                       if !(temp_number in [
-                               26, # 54100
-                               41, # 54094
-                               13, # 54142
-                               10, # 54093
-                               26, # 54100
-                               33, # 54168
-                               11, # 54169
-                               32, # TODO
-                               30, # TODO
-                               ]):  # TODO this are reported notification crashes
+                       if !(
+                               temp_number
+                               in [
+                                       26,
+                                       41,
+                                       13,
+                                       10,
+                                       26,
+                                       33,
+                                       11,
+                                       32,
+                                       30,
+                               ]
+                       ):  # 54100  # 54094  # 54142  # 54093  # 54100  # 54168  # 54169  # TODO  # TODO  # TODO this are reported notification crashes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working formatter
Projects
Status: No status
Development

No branches or pull requests

2 participants