Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions writing-apps/code-style/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,29 @@ if (condition) {
// other code
```

The placement of empty lines after blocks ending with a closing bracket and semicolon is not regulated. You may add an empty line if it improves readability.
Copy link
Collaborator

@jeremypw jeremypw Sep 8, 2025

Choose a reason for hiding this comment

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

Aren't these closing braces, strictly speaking? We need to clarify rules about closing braces and closing brackets as we sometimes have a closing bracket on its own line, e.g for long param list:

        long_variable_name = long_function_name (
                long_param_name_1,
                long_param_name_2,
                ((a ,b ,c) => {

                }
        );


```vala
var box = new Gtk.Box (Gtk.Orientation.VERTICAL, 12) {
margin_top = 12,
margin_bottom = 12
};
box.append (new Gtk.Button.with_label ("Click me!"));

var titlebar = new Gtk.Grid () {
visible = false
};

var main_window = new Gtk.ApplicationWindow (this) {
title = "MyApp",
child = box,
titlebar = headerbar
};
main_window.present ();

// other code
```

## Indentation

### Vala
Expand Down