aboutsummaryrefslogtreecommitdiffstats
path: root/.github/ci
diff options
context:
space:
mode:
authorkylo252 <59826753+kylo252@users.noreply.github.com>2021-11-13 09:43:37 +0100
committerGitHub <noreply@github.com>2021-11-13 00:43:37 -0800
commitf19b12f5275f5a571131b4c663aafc5780323efe (patch)
tree63df48ff1ed36e9c37275bd3a4c4ef621822668e /.github/ci
parentdocs: update server_configurations.md (diff)
downloadnvim-lspconfig-f19b12f5275f5a571131b4c663aafc5780323efe.tar
nvim-lspconfig-f19b12f5275f5a571131b4c663aafc5780323efe.tar.gz
nvim-lspconfig-f19b12f5275f5a571131b4c663aafc5780323efe.tar.bz2
nvim-lspconfig-f19b12f5275f5a571131b4c663aafc5780323efe.tar.lz
nvim-lspconfig-f19b12f5275f5a571131b4c663aafc5780323efe.tar.xz
nvim-lspconfig-f19b12f5275f5a571131b4c663aafc5780323efe.tar.zst
nvim-lspconfig-f19b12f5275f5a571131b4c663aafc5780323efe.zip
fix(ci): avoid failing "dirname"-cleanup PRs (#1405)
Diffstat (limited to '.github/ci')
-rw-r--r--.github/ci/run_sanitizer.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/.github/ci/run_sanitizer.sh b/.github/ci/run_sanitizer.sh
new file mode 100644
index 00000000..4098d8a7
--- /dev/null
+++ b/.github/ci/run_sanitizer.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+set -e
+
+REF_BRANCH="$1"
+PR_BRANCH="$2"
+
+# checks for added lines that contain search pattern and prints them
+SEARCH_PATTERN="(dirname|fn\.cwd)"
+
+if git diff --pickaxe-all -U0 -G "${SEARCH_PATTERN}" "${REF_BRANCH}" "${PR_BRANCH}" -- '*.lua' | grep -Ev '(configs|utils)\.lua$' | grep -E "^\+.*${SEARCH_PATTERN}" ; then
+ echo
+ echo 'String "dirname" found. There is a high risk that this might contradict the directive:'
+ echo '"Do not add vim.fn.cwd or util.path.dirname in root_dir".'
+ echo "see: https://github.com/neovim/nvim-lspconfig/blob/master/CONTRIBUTING.md#adding-a-server-to-lspconfig."
+ exit 1
+fi