diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91beed9..c6da5e8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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] diff --git a/install-language-servers.sh b/install-language-servers.sh index 9b4d29f..4bce039 100755 --- a/install-language-servers.sh +++ b/install-language-servers.sh @@ -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