Update hooks and pin stylua and luacheck to match pre-commit

This commit is contained in:
ViViDboarder 2023-06-09 13:20:28 -07:00
parent 8404ef0005
commit e36656e67d
2 changed files with 17 additions and 13 deletions

View File

@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
@ -14,9 +14,17 @@ repos:
vim/colors/.*\.vim
)$
- repo: https://github.com/johnnymorganz/stylua
rev: v0.15.2
rev: v0.17.1
hooks:
- id: stylua-github
- repo: https://github.com/lunarmodules/luacheck
rev: v1.1.0
hooks:
- id: luacheck
args:
- --globals
- vim
- --
- repo: local
hooks:
- id: sort-json
@ -25,12 +33,3 @@ repos:
entry: ./scripts/sort-json.sh
files: "(\\.json$|^neovim/packer_snapshots/)"
types: [text]
- id: luacheck
name: Luacheck
entry: luacheck
args:
- --globals
- vim
- --
language: system
types: [lua]

View File

@ -139,7 +139,9 @@ function install_linters() {
# Lua
if want_lang lua || want_lang neovim ;then
maybe_run luarocks --local install luacheck luafilesystem
maybe_run luarocks --local install luafilesystem
# Version pinned to version in pre-commit
maybe_run luarocks --local install luacheck 1.1.0
fi
# Docker
@ -197,12 +199,15 @@ function install_fixers() {
# Lua
if want_lang lua || want_lang neovim ;then
# Version pinned to version in pre-commit
local stylua_version=0.17.1
if ! release-gitter --git-url "https://github.com/JohnnyMorganz/StyLua" \
--version "v$stylua_version" \
--map-arch arm64=aarch64 \
--map-system Windows=windows --map-system Linux=linux --map-system Darwin=macos \
--extract-all --exec "chmod +x ~/bin/stylua" \
"stylua-{system}-{arch}.zip" ~/bin ; then
maybe_run cargo install stylua
maybe_run cargo install --version "$stylua_version" stylua
fi
fi