Skip to content

Commit

Permalink
doc: point out 8char visual tabs in STYLE.md
Browse files Browse the repository at this point in the history
  • Loading branch information
m-schmoock committed Mar 5, 2020
1 parent 5c8bfab commit 2b8fa7a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ trim_trailing_whitespace = true

[{**.c,**.h,Makefile}]
indent_style = tab
indent_size = 8

[**.py]
indent_style = space
Expand Down
16 changes: 16 additions & 0 deletions doc/STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ using early returns or continues, eg:
}
```

## Tabs and indentaion

The C code uses TAB charaters with a visual indentation of 8 whitespaces.
If you submit code for a review, make sure your editor knows this.

Alsom when breaking a line because of more than 80 characters, use additional
whitespaces to align parameters and arguments like this when possible:

```C
static void subtract_received_htlcs(const struct channel *channel,
struct amount_msat *amount)
```
Note: For more details, the files `.clang-format` and `.editorconfig` are
located in the projects root directory.
## Prefer Simple Statements
Notice the statement above uses separate tests, rather than combining
Expand Down

0 comments on commit 2b8fa7a

Please sign in to comment.