Skip to content

Conversation

twilfredo
Copy link
Contributor

Use sort -v to sort versions and allow versions greater than 0.78. For example, Fedora 42 ships 0.80, which fails to work since this script currently checks exactly for 0.78.

Use `sort -v` to sort versions and allow versions greater than 0.78. For
example, Fedora 42 ships 0.80, which fails to work since this script
currently checks exactly for 0.78.

Signed-off-by: Wilfred Mallawa <[email protected]>
Comment on lines +20 to +21
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."
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants