nit: Fix runtime dependent format issue in generate.sh and clean up python scripts #641
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey!
I was debugging something related to code generation and it seems that every time I ran the
generate.sh
script, a ton of local files were changed due to formatting.This PR contains two changes:
--style="{BasedOnStyle: llvm, IndentWidth: 4}"
to clang-format ingenerate.sh
In my environment the generate.sh script's clang-format execution changes every file to fix whitespaces (which I assume is somewhat my Arch Linux's clang-format default). By using the same settings as in code_format.sh we can make sure that the changes are somewhat consistent and that we don't end up with a mess of changes files.
I also removed a committed .clang-format file which is inconsistent with the current code formatting and the config in
do_check_format.sh
andgenerate.sh
It also seems like since we do a find on '.' (and from the .gitignore it seems that I am not the only one) every .c .h and .inc file in the directory gets formatted and therefore the checked out versions of liboqs and openssl get formatted as well. This takes a very long time and IMHO it does not make too much sense formatting those repos. I limited the find command in the generate.sh script to format only oqsprov/ and test/
generate.py
andgenerate_oid_nid_table.py
Some Python best practices have been violated and I took the freedom to fix what I deem risk-free. I can remove those changes if they are not wanted since it shouldn't change any behavior. the changes in detail:
generate.sh
andgenerate_oid_nid_table.py
generate_oid_nid_table.py
instead of just importing the filegenerate_oid_nid_table.py
is None
) instead of equality checks (== None
)rc == 0
in subprocess.run by setting check=Falseopen(...)