godotengine / godotengine/godot-docs

Add a guideline for whitespace before inline comments in the GDScript style guide

Open
#6,328 3 comments 2 reactions 0 assignees View on GitHub
area:manual enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

I think it would be nice to have guidelines about comment whitespace. I use 3 spaces, I've seen people use 1. Calinou recommends 2, the only example in Godot style guide uses 2, many examples throughout the codebase are inconsistent between 1-3. Some of them try to align comments vertically.

I think it would be nice to have some consistency here.

https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_styleguide.html

I think it would make sense in the "Whitespace" section, something like...

-----

Use two spaces to separate code from inline comments:

```gdscript
var raw_text = "" # Stores text without markup.
```

-----

And maybe enforced throughout the documentation.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.