Tested versions
Reproducible in all Godot versions upwards of 897e2d9, which is part of v4.3.stable, where #78119 was merged and enabled kebab-case script names.
System information
Not relevant. It happens on Windows, macOS and Linux
Issue description
Since Godot version 897e2d9, it is possible to specify kebab-case as a standard for script names, but whenever those names have to be translated into other naming schemes like PascalCase, snake_case or camelCase, the translation fails and produces invalid names.
One example is the creation of human readable names for the "Template" dropdown field in the "Attach Node Script" popup. Those are generated by capitalizing the template scripts file name if the template doesn't explicitly specify the name in a "meta-name" comment. This works for all cases except kebab-case, where the first word of the generated name is capitalized, but the rest is just kebab-case.

The second example is the translation of script file names into a script templates _CLASS_ variable. Here, the generated _CLASS_ name is correct for all script naming schemes except for kebab-case, where the generated _CLASS_ name is capitalized on the first word, and the rest is treated as snake_case

The generated class_names for the scripts in the screenshot above are as follows:
| Script name |
class_name |
| TestPascalCase.gd |
TestPascalCase |
| test_snake_case.gd |
TestSnakeCase |
| testCamelCase.gd |
TestCamelCase |
| test-kebab-case.gd |
Test_kebab_case |
Steps to reproduce
To check the first case with the human readable template names:
- open the attached project in any Godot version upwards of 897e2d9
- select the "Root" node in the SceneTree, attach a new script and open the "Templates" dropdown in the "Attach Node Script" popup
- observe the human readable names of the project templates
The second case with wrongly generated _CLASS_ names is a bit more work. The simplest method is to give all nodes under the "Root" node a new script, select a template which includes a _CLASS_ variable (all of the four embedded project templates do so), and then save the script with the same name as the node. The generated _CLASS_ variable will be based on the scripts file name.
- open the attached project in any Godot version upwards of 897e2d9
- select the "TestPascalCase" node, create a new script, select any of the project templates, save the script as "TestPascalCase.gd"
- select the "test_snake_case" node, create a new script, select any of the project templates, save the script as "test_snake_case.gd"
- select the "testCamelCase" node, create a new script, select any of the project templates, save the script as "testCamelCase.gd"
- select the "test-kebab-case" node, create a new script, select any of the project templates, save the script as "test-kebab-case.gd"
- open all four of the generated scripts in the editor and check the generated class_name variable
Minimal reproduction project (MRP)
test.zip
Tested versions
Reproducible in all Godot versions upwards of 897e2d9, which is part of v4.3.stable, where #78119 was merged and enabled kebab-case script names.
System information
Not relevant. It happens on Windows, macOS and Linux
Issue description
Since Godot version 897e2d9, it is possible to specify kebab-case as a standard for script names, but whenever those names have to be translated into other naming schemes like PascalCase, snake_case or camelCase, the translation fails and produces invalid names.
One example is the creation of human readable names for the "Template" dropdown field in the "Attach Node Script" popup. Those are generated by capitalizing the template scripts file name if the template doesn't explicitly specify the name in a "meta-name" comment. This works for all cases except kebab-case, where the first word of the generated name is capitalized, but the rest is just kebab-case.
The second example is the translation of script file names into a script templates _CLASS_ variable. Here, the generated _CLASS_ name is correct for all script naming schemes except for kebab-case, where the generated _CLASS_ name is capitalized on the first word, and the rest is treated as snake_case
The generated class_names for the scripts in the screenshot above are as follows:
Steps to reproduce
To check the first case with the human readable template names:
The second case with wrongly generated _CLASS_ names is a bit more work. The simplest method is to give all nodes under the "Root" node a new script, select a template which includes a _CLASS_ variable (all of the four embedded project templates do so), and then save the script with the same name as the node. The generated _CLASS_ variable will be based on the scripts file name.
Minimal reproduction project (MRP)
test.zip