aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
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.yml2
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