diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2025-04-26 06:01:04 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-26 06:01:04 -0700 |
| commit | 85e09220a878b19e62eec98872db4c74f711d167 (patch) | |
| tree | 84460d3ee438c5a168675f1a94949c6d8eae972c /.github | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-85e09220a878b19e62eec98872db4c74f711d167.tar nvim-lspconfig-85e09220a878b19e62eec98872db4c74f711d167.tar.gz nvim-lspconfig-85e09220a878b19e62eec98872db4c74f711d167.tar.bz2 nvim-lspconfig-85e09220a878b19e62eec98872db4c74f711d167.tar.lz nvim-lspconfig-85e09220a878b19e62eec98872db4c74f711d167.tar.xz nvim-lspconfig-85e09220a878b19e62eec98872db4c74f711d167.tar.zst nvim-lspconfig-85e09220a878b19e62eec98872db4c74f711d167.zip | |
ci: check legacy configs, drop "comment" #3781
- Disallow adding new legacy configs.
- Drop the "comment" CI job. It is over-engineered, and adds redundant comments on PRs.
Diffstat (limited to '.github')
| -rw-r--r-- | .github/ci/lint.sh | 21 | ||||
| -rw-r--r-- | .github/workflows/comment-config-changes.yml | 19 | ||||
| -rw-r--r-- | .github/workflows/lint.yml | 2 |
3 files changed, 22 insertions, 20 deletions
diff --git a/.github/ci/lint.sh b/.github/ci/lint.sh index 39cb0d3a..4f4f49b5 100644 --- a/.github/ci/lint.sh +++ b/.github/ci/lint.sh @@ -8,6 +8,25 @@ set -e REF_BRANCH="$1" PR_BRANCH="$2" +_fail() { + echo + printf "lint.sh: %s\n" "$@" + exit 1 +} + +_check_generated_docs() { + if ! git diff "${REF_BRANCH}"..."${PR_BRANCH}" --exit-code -- doc/configs.md doc/configs.txt; then + _fail '`configs.md` or `configs.txt` will be regenerated by the docgen CI process. Edit the Lua source file instead.' \ + ' For details on generating documentation, see: https://github.com/neovim/nvim-lspconfig/blob/master/CONTRIBUTING.md#generating-docs' + fi +} + +_check_legacy_configs() { + if ! git diff "${REF_BRANCH}"..."${PR_BRANCH}" --exit-code -- lua/lspconfig/configs/ ; then + _fail 'Configs in `lua/lspconfig/configs/*` are deprecated. Add or update configs in `lsp/*` instead.' + fi +} + # Enforce buffer-local commands. _check_cmd_buflocal() { if git grep -P 'nvim_create_user_command' -- 'lsp/*.lua' ; then @@ -85,6 +104,8 @@ _check_deprecated_utils() { fi } +_check_generated_docs +_check_legacy_configs _check_cmd_buflocal _check_brief_placement _check_lsp_cmd_prefix diff --git a/.github/workflows/comment-config-changes.yml b/.github/workflows/comment-config-changes.yml deleted file mode 100644 index 5bcc8008..00000000 --- a/.github/workflows/comment-config-changes.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: "Check changes to config" -on: [pull_request_target] -jobs: - check-config-changes: - runs-on: ubuntu-latest - permissions: - pull-requests: write - env: - PR_NUMBER: ${{ github.event.pull_request.number }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} - - run: | - if ! git diff origin/$GITHUB_BASE_REF...$(git branch --show-current) --exit-code -- doc/configs.md doc/configs.txt; then - gh pr comment $PR_NUMBER --body 'Note that `configs.md` or `configs.txt` will be regenerated by the docgen CI process. Edit the Lua source file instead. For details on generating documentation, see: https://github.com/neovim/nvim-lspconfig/blob/master/CONTRIBUTING.md#generating-docs' - fi diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 20b9b6ae..208b0d48 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,7 +9,7 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: - deprecated-functions: + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 |
