diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2025-04-21 13:43:00 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-21 13:43:00 -0700 |
| commit | 44ba712bc3015cce9b599d18f947d85a630e512b (patch) | |
| tree | ae71e900e2c0c8f34bca009c4ec1f3e0d3d21051 /.github | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-44ba712bc3015cce9b599d18f947d85a630e512b.tar nvim-lspconfig-44ba712bc3015cce9b599d18f947d85a630e512b.tar.gz nvim-lspconfig-44ba712bc3015cce9b599d18f947d85a630e512b.tar.bz2 nvim-lspconfig-44ba712bc3015cce9b599d18f947d85a630e512b.tar.lz nvim-lspconfig-44ba712bc3015cce9b599d18f947d85a630e512b.tar.xz nvim-lspconfig-44ba712bc3015cce9b599d18f947d85a630e512b.tar.zst nvim-lspconfig-44ba712bc3015cce9b599d18f947d85a630e512b.zip | |
ci(lint): use client:exec_cmd() #3755
Use `client:exec_cmd()` instead of calling
`request("workspace/executeCommand")` directly.
Diffstat (limited to '.github')
| -rw-r--r-- | .github/ci/lint.sh (renamed from .github/ci/run_sanitizer.sh) | 12 | ||||
| -rw-r--r-- | .github/workflows/lint.yml | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/.github/ci/run_sanitizer.sh b/.github/ci/lint.sh index 6f1577da..38ea57eb 100644 --- a/.github/ci/run_sanitizer.sh +++ b/.github/ci/lint.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # USAGE: To run locally: -# bash .github/ci/run_sanitizer.sh origin/master HEAD +# bash .github/ci/lint.sh origin/master HEAD set -e @@ -27,6 +27,15 @@ _check_lsp_cmd_prefix() { fi } +# Enforce client:exec_cmd(). +_check_exec_cmd() { + if git grep -P 'workspace.executeCommand' -- 'lsp/*.lua' ; then + echo + echo 'Use client:exec_cmd() instead of calling request("workspace/executeCommand") directly. Example: lsp/pyright.lua' + exit 1 + fi +} + _check_deprecated_utils() { # checks for added lines that contain search pattern and prints them SEARCH_PATTERN='(path\.dirname|fn\.cwd)' @@ -50,4 +59,5 @@ _check_deprecated_utils() { _check_cmd_buflocal _check_lsp_cmd_prefix +_check_exec_cmd _check_deprecated_utils diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 346ad478..20b9b6ae 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - run: | - if ! bash .github/ci/run_sanitizer.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}; then + if ! bash .github/ci/lint.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}; then exit 1 fi |
