A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 16, 07:00 UTC
[CI/Build] Add sphinx/rst linter for docs (#10366)
Rafael Vasquez committed
Nov 20, 2024 at 00:35 UTC
709c9f1f257fd15545ad19b89ed5019cb5ea338b
4 files changed
+42
.github/workflows/sphinx-lint.yml
new
+32
@@ -0,0 +1,32 @@
1
+name: Lint documentation
2
+
3
+on:
4
+ push:
5
+ branches:
6
+ - main
7
+ paths:
8
+ - "docs/**"
9
+ pull_request:
10
+ branches:
11
+ - main
12
+ paths:
13
+ - "docs/**"
14
+
15
+jobs:
16
+ sphinx-lint:
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ matrix:
20
+ python-version: ["3.12"]
21
+ steps:
22
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23
+ - name: Set up Python ${{ matrix.python-version }}
24
+ uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+ - name: Install dependencies
28
+ run: |
29
+ python -m pip install --upgrade pip
30
+ pip install -r requirements-lint.txt
31
+ - name: Linting docs
32
+ run: tools/sphinx-lint.sh
format.sh
+6
@@ -41,6 +41,7 @@ MYPY_VERSION=$(mypy --version | awk '{print $2}')
41
CODESPELL_VERSION=$(codespell --version)
42
ISORT_VERSION=$(isort --vn)
43
CLANGFORMAT_VERSION=$(clang-format --version | awk '{print $3}')
44
+SPHINX_LINT_VERSION=$(sphinx-lint --version | awk '{print $2}')
45
46
# # params: tool name, tool version, required version
47
tool_version_check() {
@@ -57,6 +58,7 @@ tool_version_check "mypy" "$MYPY_VERSION"
58
tool_version_check "isort" "$ISORT_VERSION"
59
tool_version_check "codespell" "$CODESPELL_VERSION"
60
tool_version_check "clang-format" "$CLANGFORMAT_VERSION"
61
+tool_version_check "sphinx-lint" "$SPHINX_LINT_VERSION"
62
63
YAPF_FLAGS=(
64
'--recursive'
@@ -313,3 +315,7 @@ if ! git diff --quiet &>/dev/null; then
315
else
316
echo "✨🎉 Format check passed! Congratulations! 🎉✨"
317
fi
318
+
319
+echo 'vLLM sphinx-lint:'
320
+tools/sphinx-lint.sh
321
+echo 'vLLM sphinx-lint: Done'
requirements-lint.txt
+1
@@ -6,6 +6,7 @@ ruff==0.6.5
6
codespell==2.3.0
7
isort==5.13.2
8
clang-format==18.1.5
9
+sphinx-lint==1.0.0
10
11
# type checking
12
mypy==1.11.1
tools/sphinx-lint.sh
new
+3
@@ -0,0 +1,3 @@
1
+#!/bin/bash
2
+
3
+sphinx-lint --disable trailing-whitespace,missing-final-newline docs