iotaledger / access-server

Apache License 2.0
14 stars 3 forks source link

Added code formatter. #108

Closed oopsmonk closed 4 years ago

oopsmonk commented 4 years ago

Apply clang-format to git hook for automatically checking code style before commit. Unformatted changes are unable to commit to the local repository once it's installed.

$ git commit
File "access/pdp/pdp.c" is not compliant with the coding style    
85c85,89                                              
<     } else if (memcmp("not", operation, size) == 0) { ret = NOT; } else if (memcmp("leq", operation, size) == 0) { ret = LEQ; } else if (memcmp("geq", operation, size) ==
0) {                                                  
---                                                     
>     } else if (memcmp("not", operation, size) == 0) {
>       ret = NOT;
>     } else if (memcmp("leq", operation, size) == 0) {
>       ret = LEQ;
>     } else if (memcmp("geq", operation, size) == 0) {
Run ./git_hooks/formatter to fix it
$