-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
[CI/Build] Add shell script linting using shellcheck #7925
Conversation
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, please make sure to run full CI as it is required to merge (or just use auto-merge). To run full CI, you can do one of these:
🚀 |
1dc602b
to
5e7b8e2
Compare
This pull request has merge conflicts that must be resolved before it can be |
This runs the `shellcheck` linter against all shell scripts in the repo. Download the tool automatically if it's not found, at least on Linux+x86_64. Also run shellcheck in CI. Signed-off-by: Russell Bryant <rbryant@redhat.com>
This fixes a bunch of warnings from shellcheck. A sample of things addressed here include: - Quote variables to avoid accidental globbing or variable splitting. For example, as a best practice, `cd ${foo}` should be written as `cd "${foo}"`. Otherwise, a directory with a space in the name would break in the script. - Remove unused variables and fix a variable name typo. - Simplify error checking: `if command` instead of `command; if [ $? -eq 0 ]`. - Remove an unnecessary echo, i.e. `$(echo $(command) | foo)` can instead be `$(command | foo)`. - Specify `#!/bin/bash` in scripts that did not include it. Note that I left one script ignored for the moment, as the required change seemed like it wraranted its own separate commit. Signed-off-by: Russell Bryant <rbryant@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for missing this!
@DarkLight1337 no problem - PR queue is quite busy! I'm trying to help some where I can with reviews, and not just adding things to review :) feel free to tag me on anything you'd like me to review anytime! |
Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Isotr0py <2037008807@qq.com>
Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: OmerD <omer@run.ai>
Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Loc Huynh <jc1da.3011@gmail.com>
Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Sumit Dubey <sumit.dubey2@ibm.com>
b70364a format.sh: run shellcheck on all shell scripts
1077fda Make shellcheck run cleanly
commit b70364a
Author: Russell Bryant rbryant@redhat.com
Date: Tue Aug 27 13:32:40 2024 -0400
commit 1077fda
Author: Russell Bryant rbryant@redhat.com
Date: Mon Aug 26 13:16:56 2024 -0400