New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Coding Style guidelines and util/indent.pro need an update #138
Comments
This has actually been left open ended on purpose. However, it seems like we have at least all zeroed in on this:
The extra indentation is something we don't all agree on, so it has stayed open ended, i.e. we allow it but don't make it mandatory. If you have looked at my C code, you'll notice that I don't do that extra indentation, and it's for a very simple reason: there's no way that I know of to make indentation helpers to add that extra indentation without deep hackery, and I for one have no desire whatsoever to battle cc-mode or indent over this. |
All that being said, I agree that our coding style guide needs an update. |
Thanks @levitte for your comments. Trying the tool mentioned above on the (already approved and merged) header file |
During submission of the first chunks of our CMP contribution I learned that there are some (implicit) coding-style rules that are not (yet) part of the official coding guideline at https://www.openssl.org/policies/codingstyle.html. In particular:
&&
and||
operators should not be given at the end of lines but at the beginning of the following line, with and extra indentation of 4 spaces.Are there further such implicit rules to be followed?
Please update that Coding Style document accordingly.
Meanwhile we found that there is automated tool support for (re-)indenting source files:
the
indent
configuration fileutil\indent.pro
, which is used by theutil/openssl-format-source
script.Apparently this tool has not been used on many of the OpenSSL source files.
It this tool recommended to use, at least for new source files?
If so, also
util\indent.pro
should be updated to reflect all coding style rules, also those that are so far implicit.In particular, the above rule on
&&
and||
is not reflected there. Would it be possible to state it as anindent
rule, and if so, how to do it?The text was updated successfully, but these errors were encountered: