From 4dc3b613beef3024b48809eab02bd18533618fa8 Mon Sep 17 00:00:00 2001 From: Harry Mellor <19981378+hmellor@users.noreply.github.com> Date: Sun, 12 Jan 2025 23:06:17 +0000 Subject: [PATCH] Move pymarkdownlnt to pre-commit Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> --- .github/workflows/doc-lint.yml | 32 -------------------------------- .pre-commit-config.yaml | 8 ++++++-- format.sh | 6 ------ requirements-lint.txt | 1 - tools/doc-lint.sh | 3 --- 5 files changed, 6 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/doc-lint.yml delete mode 100755 tools/doc-lint.sh diff --git a/.github/workflows/doc-lint.yml b/.github/workflows/doc-lint.yml deleted file mode 100644 index 2f5ee8bbfd8c5..0000000000000 --- a/.github/workflows/doc-lint.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Lint documentation - -on: - push: - branches: - - main - paths: - - "docs/**" - pull_request: - branches: - - main - paths: - - "docs/**" - -jobs: - doc-lint: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.12"] - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements-lint.txt - - name: Linting docs - run: tools/doc-lint.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 18c12c44d18ef..8046f7fb672d5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,5 +12,9 @@ repos: hooks: - id: isort # codespell -# isort -# clang-format \ No newline at end of file +# clang-format +- repo: https://github.com/jackdewinter/pymarkdown + rev: v0.9.27 + hooks: + - id: pymarkdown + files: docs/.* diff --git a/format.sh b/format.sh index de471ddaf9bcd..c6df321aabccd 100755 --- a/format.sh +++ b/format.sh @@ -35,7 +35,6 @@ check_command clang-format MYPY_VERSION=$(mypy --version | awk '{print $2}') CODESPELL_VERSION=$(codespell --version) CLANGFORMAT_VERSION=$(clang-format --version | awk '{print $3}') -PYMARKDOWNLNT_VERSION=$(pymarkdownlnt version | awk '{print $1}') # # params: tool name, tool version, required version tool_version_check() { @@ -49,7 +48,6 @@ tool_version_check() { tool_version_check "mypy" "$MYPY_VERSION" tool_version_check "codespell" "$CODESPELL_VERSION" tool_version_check "clang-format" "$CLANGFORMAT_VERSION" -tool_version_check "pymarkdownlnt" "$PYMARKDOWNLNT_VERSION" # Run mypy echo 'vLLM mypy:' @@ -176,7 +174,3 @@ if ! git diff --quiet &>/dev/null; then else echo "✨🎉 Format check passed! Congratulations! 🎉✨" fi - -echo 'vLLM doc-lint:' -tools/doc-lint.sh -echo 'vLLM doc-lint: Done' diff --git a/requirements-lint.txt b/requirements-lint.txt index 363c99625c10b..41eef9cab3f41 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -4,7 +4,6 @@ toml==0.10.2 tomli==2.0.2 codespell==2.3.0 clang-format==18.1.5 -pymarkdownlnt==0.9.26 # type checking mypy==1.11.1 diff --git a/tools/doc-lint.sh b/tools/doc-lint.sh deleted file mode 100755 index 19a55ddfa91c4..0000000000000 --- a/tools/doc-lint.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -pymarkdownlnt scan docs -r