Skip to content
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

Makefile: Ignore SC2329 #414

Merged
merged 3 commits into from
May 13, 2024
Merged

Makefile: Ignore SC2329 #414

merged 3 commits into from
May 13, 2024

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented May 9, 2024

See #413

It's not needed

Signed-off-by: Paweł Gronowski <[email protected]>
In previous versions of shellcheck, SC2317 was emitted for every line of
a unused function and we're ignoring the SC2317 completely:
https://github.com/docker/docker-install/blob/6e61729e66af62fd54c0b659751a431be8f90f68/Makefile#L6

We were ignoring this error due to `version_compare` being reported as a
false positive.

After
koalaman/shellcheck@4f81dbe
this was fixed and now it produces one `SC2329` for the whole function
instead of multiple SC2137.

Signed-off-by: Paweł Gronowski <[email protected]>
@vvoland vvoland self-assigned this May 9, 2024
eval version_compare "$VERSION" "$1"
version_compare "$VERSION" "$1"
Copy link
Member

Choose a reason for hiding this comment

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

Is there any change in behavior between with / without eval ? (LOL, I may have written this code, but I honestly don't recall why it's there 🤔 🙈)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems to work fine without it:

bash-3.2$ export VERSION=23.0
bash-3.2$ version_gte 24.0; echo $?
1
bash-3.2$ version_gte 34.0; echo $?
1
bash-3.2$ version_gte 23.0; echo $?
0
bash-3.2$ version_gte 23.5; echo $?
1
bash-3.2$ version_gte 20.10; echo $?
0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Btw, the examples in the comment seem wrong 🙈

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like a mistake in d08fb9e

-# VERSION=20.10
+# VERSION=23.0
+# version_gte 23.0  // 0 (success)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wait, isn't it a holiday in NL? Go away Sebastiaan 😅

Copy link
Member

Choose a reason for hiding this comment

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

Looks like a mistake in d08fb9e

-# VERSION=20.10
+# VERSION=23.0
+# version_gte 23.0  // 0 (success)

Isn't that correct though? I.e. 23.0 is "gte" (>=) 23.0, or didn't it work?

Copy link
Member

Choose a reason for hiding this comment

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

Oh! Last line; I see it now; last line had to be updated because 21.10 would now no longer pass

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit f2775a0 into docker:master May 13, 2024
9 checks passed
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.

2 participants