dpvs icon indicating copy to clipboard operation
dpvs copied to clipboard

Coding Style is not consistent

Open andrewhit opened this issue 6 years ago • 1 comments

The coding style in dpvs is not consistent.

For example, one whitespace is added or missing between "if" and "(".

neigh.c:198: if(!(neighbour->flag & NEIGHBOUR_HASHED)){ vlan.c:517: if (!conf || size < sizeof(*param) || !out || !outsize)

Some line exceeds the column number, 80. For example, dpvs/tools/dpip.

106 inet_ntop(neigh->af, &neigh->ip_addr, ipaddr, sizeof(ipaddr)) ? ipaddr : "::",

Or whether "{" should be added after "if ()" for the single statement.

The tool of "uncrustify" does the code beautification for your info.

https://github.com/uncrustify/uncrustify

It is better to add some coding style guideline to DPVS repo.

andrewhit avatar Apr 26 '18 02:04 andrewhit

The auto check script/tool should be added to CI at the very beginning of project. We'll perform more strict standard for review, and to see if we can hook some auto-check script to CI in the future.

beacer avatar Apr 26 '18 03:04 beacer