Skip to content

Commit

Permalink
Merge pull request #487 from mrcjkb/lua-ls
Browse files Browse the repository at this point in the history
fix(lua-ls): only fail if there are diagnostics
  • Loading branch information
sandydoo authored Aug 21, 2024
2 parents 1064a45 + 51605d9 commit 6cedaa7
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 @@ -2674,7 +2674,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 @@ -2686,7 +2686,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 6cedaa7

Please sign in to comment.