Skip to content

Some long lines are not formatted correctly #338

Description

@musjj
func _physics_process(delta: float) -> void:
    var direction: Vector3 = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()

I have set my maxLineLength to 80, but the second line above exceeds that length. The formatter does not try to break the line up, which causes the linter to complain about it.

Instead, you need to manually format your code to satisfy the linter:

func _physics_process(delta: float) -> void:
    var direction: Vector3 = (
        (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
    )

gdscript-formatter should be able to automatically format this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions