Skip to content

Commit

Permalink
pre-commit: Add hook to check client capabilities
Browse files Browse the repository at this point in the history
- Ensure that the data can be parsed as `InitializeParams`
- Ensure that the JSON files are formatted consistently
  • Loading branch information
alcarney committed Oct 21, 2023
1 parent 6594820 commit b72a067
Show file tree
Hide file tree
Showing 7 changed files with 789 additions and 743 deletions.
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ repos:
hooks:
- id: check-yaml
- id: end-of-file-fixer
exclude: 'lib/pytest-lsp/pytest_lsp/clients/.*\.json'
- id: trailing-whitespace

- repo: https://github.com/psf/black
Expand Down Expand Up @@ -62,3 +63,13 @@ repos:
- textual
- websockets
files: 'lib/lsp-devtools/lsp_devtools/.*\.py'

- repo: local
hooks:
- id: check-capabilities
name: check-capabilities
language: python
additional_dependencies:
- lsprotocol
files: 'lib/pytest-lsp/pytest_lsp/clients/.*\.json'
entry: python scripts/check_capabilities.py
2 changes: 1 addition & 1 deletion lib/pytest-lsp/pytest_lsp/clients/neovim_v0.6.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@
}
}
}
}
}
Loading

0 comments on commit b72a067

Please sign in to comment.