Skip to content

Commit

Permalink
Merge pull request #26 from ohexel/pretty-formatting
Browse files Browse the repository at this point in the history
Reformatting: Remove old comments and printf debug statements. Consistent indenting.
  • Loading branch information
tomthe authored Dec 6, 2024
2 parents 0421ebf + 192e367 commit d86ba77
Show file tree
Hide file tree
Showing 3 changed files with 5,195 additions and 5,184 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,23 @@ build source and binary package:
devtools::build(binary=FALSE)
devtools::build(binary=TRUE)
```
### Style guide

The goal of this section is to improve the readability of the code and reduce complaints from modern compilers (parts of the code are 40ish years old). We (try to) follow Allman style, but as a guideline not a hard requirement. Basically, this means:

- one level of indentation = 4 spaces;
- spaces not tabs;
- braces after a function declaration or a control flow statement go on a new line;
- first-level braces at the beginning of a line appear in the first column;
- closing braces appear in the same column as their counterpart.
- spaces...:
- ... around binary operators;
- ... after commas;
- ... before opening parentheses and after closing parentheses.

If you use vim, the default C formatting should be fine (':h C-indenting').

We reformatted the .cpp files because indentation was all over the place, but we left the .c files largely alone such as not to anger the compiler gods.

### Future plans

Expand Down
Loading

0 comments on commit d86ba77

Please sign in to comment.