This repository has been archived by the owner on Feb 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tools] Add format tools and execute format (#10)
* add format tools and execute format * merge main * update * update * update
- Loading branch information
1 parent
319f283
commit 6b38777
Showing
21 changed files
with
448 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Lint GitHub Actions workflows | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- '.github/workflows/*.ya?ml' | ||
- '.github/workflows/actionlint.*' | ||
- '.github/workflows/matchers/actionlint.json' | ||
pull_request: | ||
branches: | ||
- "main" | ||
paths: | ||
- '.github/workflows/*.ya?ml' | ||
- '.github/workflows/actionlint.*' | ||
- '.github/workflows/matchers/actionlint.json' | ||
|
||
env: | ||
LC_ALL: en_US.UTF-8 | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
actionlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: "Run actionlint" | ||
run: | | ||
echo "::add-matcher::.github/workflows/matchers/actionlint.json" | ||
tools/actionlint.sh -color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "actionlint", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"message": 4, | ||
"code": 5 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "mypy", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(.+):(\\d+):\\s(error|warning):\\s(.+)$", | ||
"file": 1, | ||
"line": 2, | ||
"severity": 3, | ||
"message": 4 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "ruff", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(.+?):(\\d+):(\\d+): (\\w+): (.+)$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"code": 4, | ||
"message": 5 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[mypy] | ||
; warn_return_any = True | ||
warn_unused_configs = True | ||
|
||
; Suppress all missing import errors from torch_npu for mypy. | ||
[mypy-torch_npu.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-transformers.*] | ||
ignore_missing_imports = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
if command -v actionlint &> /dev/null; then | ||
actionlint "$@" | ||
exit 0 | ||
elif [ -x ./actionlint ]; then | ||
./actionlint "$@" | ||
exit 0 | ||
fi | ||
|
||
# download a binary to the current directory - v1.7.3 | ||
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/aa0a7be8e566b096e64a5df8ff290ec24fa58fbc/scripts/download-actionlint.bash) | ||
./actionlint "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
# Checks whether the repo is clean and whether tags are available (necessary to correctly produce vllm version at build time) | ||
|
||
if ! git diff --quiet; then | ||
echo "Repo is dirty" >&2 | ||
|
||
exit 1 | ||
fi | ||
|
||
if ! git describe --tags; then | ||
echo "No tags are present. Is this a shallow clone? git fetch --unshallow --tags" >&2 | ||
|
||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
CI=${1:-0} | ||
PYTHON_VERSION=${2:-3.9} | ||
|
||
if [ "$CI" -eq 1 ]; then | ||
set -e | ||
fi | ||
|
||
run_mypy() { | ||
echo "Running mypy on $1" | ||
if [ "$CI" -eq 1 ] && [ -z "$1" ]; then | ||
mypy --python-version "${PYTHON_VERSION}" "$@" | ||
return | ||
fi | ||
mypy --follow-imports skip --python-version "${PYTHON_VERSION}" "$@" | ||
} | ||
|
||
run_mypy # Note that this is less strict than CI | ||
run_mypy vllm_ascend | ||
run_mypy examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# Ensure that *.excalidraw.png files have the excalidraw metadata | ||
# embedded in them. This ensures they can be loaded back into | ||
# the tool and edited in the future. | ||
|
||
find . -iname '*.excalidraw.png' | while read -r file; do | ||
if git check-ignore -q "$file"; then | ||
continue | ||
fi | ||
if ! grep -q "excalidraw+json" "$file"; then | ||
echo "$file was not exported from excalidraw with 'Embed Scene' enabled." | ||
exit 1 | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
scversion="stable" | ||
|
||
if [ -d "shellcheck-${scversion}" ]; then | ||
PATH="$PATH:$(pwd)/shellcheck-${scversion}" | ||
export PATH | ||
fi | ||
|
||
if ! [ -x "$(command -v shellcheck)" ]; then | ||
if [ "$(uname -s)" != "Linux" ] || [ "$(uname -m)" != "x86_64" ]; then | ||
echo "Please install shellcheck: https://github.com/koalaman/shellcheck?tab=readme-ov-file#installing" | ||
exit 1 | ||
fi | ||
|
||
# automatic local install if linux x86_64 | ||
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv | ||
PATH="$PATH:$(pwd)/shellcheck-${scversion}" | ||
export PATH | ||
fi | ||
|
||
# TODO - fix warnings in .buildkite/run-amd-test.sh | ||
find . -name "*.sh" -not -path "./.buildkite/run-amd-test.sh" -print0 | xargs -0 -I {} sh -c 'git check-ignore -q "{}" || shellcheck "{}"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
sphinx-lint --disable trailing-whitespace,missing-final-newline docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.