Skip to content

Enforce GDScript and C# dictionary spacing style guidelines in code samples #107357

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

Merged
merged 1 commit into from
Jun 11, 2025

Conversation

ProgrammerOnCoffee
Copy link
Contributor

Both the GDScript and the C# style guides state that a space should be added after opening braces and before ending braces in single-line dictionary declarations. This PR enforces that guideline in various code samples.

This PR does not change the style of the following:

  • Dictionaries passed to functions (e.g. foo({"some_key": "bar"}))
  • Single-line dictionary arrays (e.g. [{"godot": true}])

@Mickeon
Copy link
Member

Mickeon commented Jun 10, 2025

I... this is going to be real nasty for translators.
I am not necessarily against it. I just think that if we decide on something it's got to be agreeable. I for one don't really like the extra padding this style gives to nested dictionaries, but I get it. It's in the style guide, so it makes sense.

@ProgrammerOnCoffee
Copy link
Contributor Author

I'd be happy to close this if it would cause issues.

Copy link
Member

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually not that invasive in hindsight. However, we need to argue about... nested dictionaries in a single line, because that's not explicitly mentioned in the style guide.

@AThousandShips
Copy link
Member

I'd say that nested dictionaries are covered by the style guide, if it was an exception it should have been mentioned, otherwise it applies by induction

AThousandShips
AThousandShips previously approved these changes Jun 10, 2025
@AThousandShips AThousandShips dismissed their stale review June 10, 2025 17:19

Minor detail

@Mickeon Mickeon modified the milestones: 4.x, 4.5 Jun 10, 2025
@Repiteo Repiteo merged commit 1bbfe63 into godotengine:master Jun 11, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Jun 11, 2025

Thanks!

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

Successfully merging this pull request may close these issues.

4 participants