[openssl-users] OpenSSL source reformat

Matt Caswell matt at openssl.org
Mon Jan 5 12:10:30 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

We have previously announced our intention to reformat the entire
codebase into a more consistent style (see our roadmap document here:
https://www.openssl.org/about/roadmap.html)

Since then we have been busy working towards doing that. I'd like to
make available for comment a sample reformat. So far I've run it for
master and 1.0.2, but the current thinking is that this will also be
applied to 1.0.1, 1.0.0 and 0.9.8 (this is necessary to significantly
ease the maintenance overhead)

I've put the results of the reformat up on my github account here:
https://github.com/mattcaswell/openssl

The reformat of master is on the "sample-master-reformat" branch, and
the 1.0.2 reformat is on "sample-1.0.2-reformat".

The style itself is heavily influenced by the Linux Kernel Coding style:
https://www.kernel.org/doc/Documentation/CodingStyle

Although there are some significant differences - most notably that we
are using spaces not tabs for indents, and the indent depth is 4
characters not 8. We will be publishing our own style guide in due course.

I'm not looking to open any religious wars here - so I'm not looking
for comments on the style itself (e.g. debates about whether 2, 4 or 8
character indents are better (we've already had those!)) - but I'm
mainly seeking feedback on anywhere where the reformatting has failed.
We've already looked of course...but sometimes many sets of eyes are
better!

I've also made available the script that was used to do the
reformatting. The script is called openssl-format-source and is in the
util directory of the branches mentioned above. This script depends on
GNU indent being available. It should be executed from the root of the
source tree as follows:

util/openssl-format-source -v -c .

There are also some one-off manual tweaks (both before and after
running the script) that need to be done which are present in the
sample reformat branches. These are related to multi-line comments
which have their own internal formatting - these aren't handled too
well. The manual steps should be a one-off exercise though. The hope
is that we will be able to re-run the script at regular intervals.

Thanks

Matt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJUqn82AAoJENnE0m0OYESR/r0IALuQC+UQKEr6mSTHu3aex+TQ
OSirP2FzQAwxLwRujnLSC9xVsRiDEg8CjGDJFpMBWUz3+tL1+9A5tUzt9gb6rqE3
sVVZCYuB81Q0Ge5bA9pTluOg+BX6E7UfcEmoeJMol0GPYjXeAWqmp67XrpSj5ZA7
iH0JUURP5/aj3NWXZpUZG/KVVsGAJl8UQtCF2xycYVE/1A7rb+C7voedXA7QvAnZ
rIn9h4B8wzU9dfHOdZj9PjPfXTn+XEUI+9aY4kDsnuuH3yw0Jb0hGb2fF1bOIb/M
RtS658hNCCr8wWdgiGoUNkbv8s21hrWBQ8oobM4izbn8+wr6OYBFKfoYCfBP9IY=
=O1i4
-----END PGP SIGNATURE-----


More information about the openssl-users mailing list