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

[CI/Build] Add shell script linting using shellcheck #7925

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

russellb
Copy link
Collaborator

@russellb russellb commented Aug 27, 2024

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

format.sh: run shellcheck on all shell scripts

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>

commit 1077fda
Author: Russell Bryant rbryant@redhat.com
Date: Mon Aug 26 13:16:56 2024 -0400

Make shellcheck run cleanly

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>

Copy link

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which consists a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of default ones by unblocking the steps in your fast-check build on Buildkite UI.

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:

  • Comment /ready on the PR
  • Add ready label to the PR
  • Enable auto-merge.

🚀

@russellb russellb changed the title Add shell script linting using shellcheck Draft - [CI/Build] Add shell script linting using shellcheck Aug 30, 2024
@russellb russellb changed the title Draft - [CI/Build] Add shell script linting using shellcheck [CI/Build] Add shell script linting using shellcheck Oct 31, 2024
@mergify mergify bot added the ci/build label Oct 31, 2024
@russellb russellb marked this pull request as ready for review October 31, 2024 20:55
@russellb russellb force-pushed the shellcheck branch 2 times, most recently from 1dc602b to 5e7b8e2 Compare November 6, 2024 14:00
Copy link

mergify bot commented Nov 7, 2024

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @russellb.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Nov 7, 2024
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>
Copy link
Member

@DarkLight1337 DarkLight1337 left a 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 DarkLight1337 enabled auto-merge (squash) November 7, 2024 16:50
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 7, 2024
@russellb
Copy link
Collaborator Author

russellb commented Nov 7, 2024

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!

@DarkLight1337 DarkLight1337 merged commit 3be5b26 into vllm-project:main Nov 7, 2024
34 of 37 checks passed
Isotr0py pushed a commit to Isotr0py/vllm that referenced this pull request Nov 8, 2024
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Isotr0py <2037008807@qq.com>
omer-dayan pushed a commit to omer-dayan/vllm that referenced this pull request Nov 10, 2024
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: OmerD <omer@run.ai>
JC1DA pushed a commit to JC1DA/vllm that referenced this pull request Nov 11, 2024
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Loc Huynh <jc1da.3011@gmail.com>
sumitd2 pushed a commit to sumitd2/vllm that referenced this pull request Nov 14, 2024
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Sumit Dubey <sumit.dubey2@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/build ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants