Skip to content

Code Style: clarify optional whitespace after closing bracket with semicolon #233

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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.

```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