diff --git a/.editorconfig b/.editorconfig index e2eb17b87d65..e49de5f5e98a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,6 +10,7 @@ trim_trailing_whitespace = true [{**.c,**.h,Makefile}] indent_style = tab +indent_size = 8 [**.py] indent_style = space diff --git a/doc/STYLE.md b/doc/STYLE.md index dd7b6fcdfa58..c5ba2bea5f9d 100644 --- a/doc/STYLE.md +++ b/doc/STYLE.md @@ -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