Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions script/format_nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ fi
VERSION=$(uncrustify --version 2>/dev/null | sed -E 's/Uncrustify-([0-9]+\.[0-9]+).*/\1/')
REQUIRED_VERSION="0.78"

if [ "$VERSION" != "$REQUIRED_VERSION" ]; then
echo "ERROR: uncrustify version $REQUIRED_VERSION is required, but found $VERSION."
if [ "$(printf '%s\n' "$REQUIRED_VERSION" "$VERSION" | sort -V | head -n1)" != "$REQUIRED_VERSION" ]; then
echo "ERROR: uncrustify version $REQUIRED_VERSION or higher is required, but found $VERSION."
Comment on lines +20 to +21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI pipeline runs within an Ubuntu container. However, even when developers use a newer version of uncrustify (e.g., 0.80) locally, the CI continues to run with version 0.78. This version mismatch can lead to confusion, especially when formatting differences cause CI failures. Hence, I feel it is better to have the stricter version check for making it easy to figure out what is needed for CI to pass.

Originally, the strict version check was introduced because we had encountered issues in the past where newer versions of uncrustify deprecated certain configuration keys or altered the behavior of existing ones. These changes led to unintended formatting modifications and numerous unnecessary code diffs. Additionally, Ubuntu tends to lag behind Fedora in adopting the latest uncrustify releases, further contributing to inconsistencies across development and CI environments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @manojkiraneda. At this point the style checker is mainly for CI/CD. In particular if you run it locally it will change a lot of files. Maybe the file should be moved to https://github.com/DMTF/libspdm/tree/main/.github to show that it should not be run locally.

exit 1
fi

Expand Down
Loading