Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
e0853b65
Unverified
Commit
e0853b65
authored
Nov 13, 2024
by
Russell Bryant
Committed by
GitHub
Nov 14, 2024
Browse files
[Misc] format.sh: Simplify tool_version_check (#10305)
Signed-off-by:
Russell Bryant
<
rbryant@redhat.com
>
parent
504ac53d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
format.sh
format.sh
+9
-8
No files found.
format.sh
View file @
e0853b65
...
@@ -44,18 +44,19 @@ CLANGFORMAT_VERSION=$(clang-format --version | awk '{print $3}')
...
@@ -44,18 +44,19 @@ CLANGFORMAT_VERSION=$(clang-format --version | awk '{print $3}')
# # params: tool name, tool version, required version
# # params: tool name, tool version, required version
tool_version_check
()
{
tool_version_check
()
{
if
[[
"
$2
"
!=
"
$3
"
]]
;
then
expected
=
$(
grep
"
$1
"
requirements-lint.txt |
cut
-d
'='
-f3
)
echo
"❓❓Wrong
$1
version installed:
$3
is required, not
$2
."
if
[[
"
$2
"
!=
"
$expected
"
]]
;
then
echo
"❓❓Wrong
$1
version installed:
$expected
is required, not
$2
."
exit
1
exit
1
fi
fi
}
}
tool_version_check
"yapf"
"
$YAPF_VERSION
"
"
$(
grep
yapf requirements-lint.txt |
cut
-d
'='
-f3
)
"
tool_version_check
"yapf"
"
$YAPF_VERSION
"
tool_version_check
"ruff"
"
$RUFF_VERSION
"
"
$(
grep
"ruff=="
requirements-lint.txt |
cut
-d
'='
-f3
)
"
tool_version_check
"ruff"
"
$RUFF_VERSION
"
tool_version_check
"mypy"
"
$MYPY_VERSION
"
"
$(
grep
mypy requirements-lint.txt |
cut
-d
'='
-f3
)
"
tool_version_check
"mypy"
"
$MYPY_VERSION
"
tool_version_check
"isort"
"
$ISORT_VERSION
"
"
$(
grep
isort requirements-lint.txt |
cut
-d
'='
-f3
)
"
tool_version_check
"isort"
"
$ISORT_VERSION
"
tool_version_check
"codespell"
"
$CODESPELL_VERSION
"
"
$(
grep
codespell requirements-lint.txt |
cut
-d
'='
-f3
)
"
tool_version_check
"codespell"
"
$CODESPELL_VERSION
"
tool_version_check
"clang-format"
"
$CLANGFORMAT_VERSION
"
"
$(
grep
clang-format requirements-lint.txt |
cut
-d
'='
-f3
)
"
tool_version_check
"clang-format"
"
$CLANGFORMAT_VERSION
"
YAPF_FLAGS
=(
YAPF_FLAGS
=(
'--recursive'
'--recursive'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment