-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a convenience script for consistent astyle formatting (#1861)
* Add script to format code in a CI container * Update CONTRIBUTING.md to document script --------- Signed-off-by: Spencer Wilson <[email protected]>
- Loading branch information
Showing
3 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
# SPDX-License-Identifier: MIT | ||
|
||
# usage: LIBOQS_DIR=<liboqs dir> ./scripts/format_code.sh | ||
|
||
arch=$(uname -m) | ||
|
||
# tested on Ubuntu 22 / x86_64 and macOS 13 / arm64 | ||
if [ "$arch" != "x86_64" ] && [ "$arch" != "arm64" ] | ||
then | ||
echo "This script does not currently support systems where \`uname -m\` returns $arch." | ||
exit 1 | ||
fi | ||
|
||
if [ ! -d "$LIBOQS_DIR" ] | ||
then | ||
echo "Please set the environment variable LIBOQS_DIR to point to your liboqs directory." | ||
exit 1 | ||
fi | ||
|
||
docker run --rm -v"$LIBOQS_DIR":/root/liboqs -w /root/liboqs openquantumsafe/ci-ubuntu-focal-$arch:latest ./tests/run_astyle.sh --no-dry-run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters