-
Notifications
You must be signed in to change notification settings - Fork 103
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
Fix #224: Add a clang-format that matches the best the OpenSSL coding style. #241
Conversation
@baentsch , CI jobs are failing because of the generated code that get reformat by Should we add a "post-step" to the code generation job, where we run |
Yes -- that would be easier than getting all "jinja2" magic to align (particularly considering #228). I started to look into that when evaluating the impact of #224 but hit some |
👍 , will do that.
It is indeed: some clang-format directives are new and may be unavailable in older versions. I checked the |
I'd be fine mandating that for a build env. The OQS main CI build env is "Ubuntu Jammy" -- and that's at |
Exactly. I've updated the CircleCI job to use
|
Tough luck. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, very good: Looks like OpenSSL code. In most areas formatting (and readability) improved; in some it really became awful (see single comments): Is there something that could be done about those? OK, it's generated code, but still, it should be somewhat legible to humans, no?
I agree. We can disable clang-format for some portions of the code. |
@baentsch when I run the
I did: $ OQS_ALGS_ENABLED=STD LIBOQS_SRC_DIR=../liboqs python3 oqs-template/generate.py I tried without Edit: running the script on linux is fine, but not on macOS. |
I added a I also removed the |
Not really -- this is (should be) all driven off "generate.yml".
Are you sure "generate.yml" is identical on both machines? I just ran the script on macOS and nothing changed (i.e., x25519_kyber768 and p256_kyber768 "persisted"). |
OK, it must have been because now it works. Sorry for the noise… |
… style. This commit adds a `.clang-format` file at the root of the repository. This `.clang-format` file tries to match the best the OpenSSL coding style. This commit also reformats the existing code according to that `.clang-format`. Finally, it adds a new CircleCI job to ensure that the code is well-formatted.
…he OpenSSL coding style. (open-quantum-safe#241) This commit adds a `.clang-format` file at the root of the repository. This `.clang-format` file tries to match the best the OpenSSL coding style. This commit also reformats the existing code according to that `.clang-format`. Finally, it adds a new CircleCI job to ensure that the code is well-formatted. Signed-off-by: Felipe Ventura <[email protected]>
This commit adds a
.clang-format
file at the root of the repository. This.clang-format
file tries to match the best the OpenSSL coding style.This commit also reformats the existing code according to that
.clang-format
.Finally, it adds a new CircleCI job to ensure that the code is well-formatted.