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

Inconsistent naming convention (PascalCase vs snake_case) for scripts and scenes in save dialog #85057

Closed
p10tr3k opened this issue Nov 18, 2023 · 1 comment

Comments

@p10tr3k
Copy link
Contributor

p10tr3k commented Nov 18, 2023

Godot version

v4.1.3.stable.official [f06b6836a]

System information

MacOS 14.1.1 (23B81)

Issue description

The Godot Editor is currently exhibiting inconsistent behavior in the suggested naming conventions for scripts and scene files. This inconsistency is especially apparent when comparing the naming of scene files and their associated scripts in various scenarios of creation and saving.

For instance, if an unsaved root node is named "OneTwoThree", the script is initially suggested to be saved as "OneTwoThree.gd". However, after the scene is saved, if a script is added, the suggested name for the script becomes "one_two_three.gd", diverging from the initial suggestion. This inconsistency extends to child nodes as well. The fundamental issue here is that the scene and its corresponding script do not follow the same naming convention, whether it be PascalCase or snake_case.

This lack of uniformity can lead to confusion and disorganization in project file management, making it difficult to maintain a coherent structure in large projects.

Expected behavior:
The expected behavior in Godot is for both the scene and its corresponding script to follow the same naming convention, regardless of the order of operations (creating, saving, adding scripts, etc.). Whether this convention is PascalCase, snake_case, or another format, consistency is key to ensuring an intuitive and manageable project structure. Adopting a uniform naming convention would significantly enhance clarity and organization in project development.

Steps to reproduce

  1. Open the Godot Editor and create a new scene.
  2. Name the root node of the scene "OneTwoThree", but do not save the scene yet.
  3. Add a script to this node. Observe that the suggested save name for the script is "OneTwoThree.gd". Do not save the script.
  4. Save the scene now. Notice that the saved scene file name is "one_two_three.tscn", which is in snake_case, different from the PascalCase naming of the script file.
  5. Now, try to add script again to the scene, and observe the suggested file name. The Godot Editor now suggests "one_two_three.gd" for the script file, aligning with the scene file's snake_case naming but diverging from the initial PascalCase suggestion.
  6. Additionally, add a child node to the scene and name it "FiveSix". Add a script to this child node and observe the suggested file name. Regardless of the scene's save status, the proposed script file name for the child node is consistently "FiveSix.gd", in PascalCase, highlighting further inconsistency in naming conventions across different scenarios.

Minimal reproduction project

N/A

@Calinou
Copy link
Member

Calinou commented Nov 18, 2023

Thanks for the report! Consolidating in godotengine/godot-proposals#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