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

Default .gd script naming should follow convention #2521

Closed
ivanskodje opened this issue Mar 29, 2021 · 1 comment
Closed

Default .gd script naming should follow convention #2521

ivanskodje opened this issue Mar 29, 2021 · 1 comment

Comments

@ivanskodje
Copy link

ivanskodje commented Mar 29, 2021

Describe the project you are working on

Any Godot Engine project.

Describe the problem or limitation you are having in your project

When I attempt to attach a new script to a Node, the script name defaults to the node name that uses PascalCase. (Steam's Godot Engine version as of 2021-03-29)

For Example:

  1. Create a MyNode node.
  2. Attach a new script.
  3. Notice the default name is "MyNode.gd" instead of "my_node.gd" which would be the Godot Engine's documented naming convention.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Instead of creating default gdscript file name using PascalCase, it should be converted to snake_case by default, so we won't have to manually change the name in order to follow GDscript naming conventions

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

In the Godot Engine source code, parse the Node name into snake_case before populating the GDScript file name's text box.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No. The only way to "fix" this is to break coding conventions and use snake_case for Node names as well.

Is there a reason why this should be core and not an add-on in the asset library?

Because we both follow and encourage others to follow the standard conventions, without having to make them think and manually "correct" it. :)

@YuriSizov
Copy link
Contributor

Duplicate of #1211

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

No branches or pull requests

2 participants