Skip to content

Commit

Permalink
fix(lua-ls): only fail if there are diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Aug 20, 2024
1 parent c182c87 commit 51605d9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2612,7 +2612,7 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
};
script = pkgs.writeShellApplication {
name = "lua-ls-lint";
runtimeInputs = [ hooks.lua-ls.package ];
runtimeInputs = [ hooks.lua-ls.package pkgs.jq ];
checkPhase = ""; # The default checkPhase depends on GHC
text = ''
set -e
Expand All @@ -2624,7 +2624,10 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
if [[ -f $logpath/check.json ]]; then
echo "+++++++++++++++ lua-language-server diagnostics +++++++++++++++"
cat $logpath/check.json
exit 1
diagnostic_count=$(jq 'length' $logpath/check.json)
if [ "$diagnostic_count" -gt 0 ]; then
exit 1
fi
fi
'';
};
Expand Down

0 comments on commit 51605d9

Please sign in to comment.