You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the code uses a mixture of old GNU style and some kind of Linux kernel style hybrid, and it's pretty messy. There is not even a consistent style within individual files. This complicates pull requests which often include unrelated reformatting because it makes people cringe and they can't leave it alone (in some cases peoples editors reformat stuff automatically).
The docbook comments are not too bad, but there is some degree of inconsistency, with some using auto-brief style (first para is the "brief"), and some using \brief tags.
We need to decide on a style, pick a tool to enforce it, add some kind of config or make support for it, document it, and reformat all the code. In other projects I've added a "make tidy" target to reformat the code using gnu indent with args for our recommended style. Others seem to be converging on clang-format which can use a .clang-format config file for your style settings. I've also written a wrapper for indent to address some of it's deficiencies here;
This might be OK for a once-off reformat effort, particularly of docbook comments, but it's to esoteric to make our default reformat tool.
We also need to make sure we don't reformat code taken from upstream sources, like blake2, so that we have clean diffs against the upstream source. Fortunately this is now in it's own subdirectory so is easy to exclude.
The text was updated successfully, but these errors were encountered:
Currently the code uses a mixture of old GNU style and some kind of Linux kernel style hybrid, and it's pretty messy. There is not even a consistent style within individual files. This complicates pull requests which often include unrelated reformatting because it makes people cringe and they can't leave it alone (in some cases peoples editors reformat stuff automatically).
The docbook comments are not too bad, but there is some degree of inconsistency, with some using auto-brief style (first para is the "brief"), and some using \brief tags.
We need to decide on a style, pick a tool to enforce it, add some kind of config or make support for it, document it, and reformat all the code. In other projects I've added a "make tidy" target to reformat the code using gnu indent with args for our recommended style. Others seem to be converging on clang-format which can use a .clang-format config file for your style settings. I've also written a wrapper for indent to address some of it's deficiencies here;
https://github.com/dbaarda/tidyc
This might be OK for a once-off reformat effort, particularly of docbook comments, but it's to esoteric to make our default reformat tool.
We also need to make sure we don't reformat code taken from upstream sources, like blake2, so that we have clean diffs against the upstream source. Fortunately this is now in it's own subdirectory so is easy to exclude.
The text was updated successfully, but these errors were encountered: