Skip to content

.import files with no options have a trailing newline at the end, which conflicts with pre-commit hooks #105456

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

Open
Calinou opened this issue Apr 16, 2025 · 0 comments · May be fixed by #105779

Comments

@Calinou
Copy link
Member

Calinou commented Apr 16, 2025

Tested versions

  • Reproducible in: 4.4.1.stable, 4.5.dev 215acd5

System information

Godot v4.5.dev (215acd5) - Fedora Linux 41 (KDE Plasma) on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (nvidia; 570.133.07) - 13th Gen Intel(R) Core(TM) i9-13900K (32 threads)

Issue description

.import files with no options have a trailing newline at the end, which conflicts with pre-commit hooks.

See godotengine/godot-demo-projects#1193, where I removed trailing whitespace from all files using a pre-commit hook. If I open all projects and run them, I get this diff (these are the only changed files sacross all demos):

diff --git a/compute/post_shader/post_process_grayscale.glsl.import b/compute/post_shader/post_process_grayscale.glsl.import
index f46e950c..653ea822 100644
--- a/compute/post_shader/post_process_grayscale.glsl.import
+++ b/compute/post_shader/post_process_grayscale.glsl.import
@@ -11,3 +11,4 @@ source_file="res://post_process_grayscale.glsl"
 dest_files=["res://.godot/imported/post_process_grayscale.glsl-74f080e1b01e56b39260b8709956a520.res"]
 
 [params]
+
diff --git a/compute/texture/water_plane/water_compute.glsl.import b/compute/texture/water_plane/water_compute.glsl.import
index ebf872a7..8ef651fc 100644
--- a/compute/texture/water_plane/water_compute.glsl.import
+++ b/compute/texture/water_plane/water_compute.glsl.import
@@ -11,3 +11,4 @@ source_file="res://water_plane/water_compute.glsl"
 dest_files=["res://.godot/imported/water_compute.glsl-c7fe8f11197ba28412c4cdf6f7a9a21b.res"]
 
 [params]
+
diff --git a/misc/compute_shader_heightmap/compute_shader.glsl.import b/misc/compute_shader_heightmap/compute_shader.glsl.import
index 92d45486..64e0cfba 100644
--- a/misc/compute_shader_heightmap/compute_shader.glsl.import
+++ b/misc/compute_shader_heightmap/compute_shader.glsl.import
@@ -11,3 +11,4 @@ source_file="res://compute_shader.glsl"
 dest_files=["res://.godot/imported/compute_shader.glsl-0816de56a4f9dce0934d88a29a0758cf.res"]
 
 [params]
+

Only GLSL files seem affected by this, most likely because they have no import options to specify.

Steps to reproduce

  • Trim trailing whitespace from all files in a project using a pre-commit hook or text editor. Files should only have one blank line at the end (not several).

Minimal reproduction project (MRP)

N/A

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

Successfully merging a pull request may close this issue.

1 participant