health.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. local maj_peg = require("maj-peg")
  2. return {
  3. check = function()
  4. vim.health.start("Maj-Peg")
  5. if maj_peg.status().setup == false then
  6. vim.health.warn("Not loaded")
  7. return
  8. end
  9. if maj_peg.status().has_mypy then
  10. vim.health.ok("`mypy` found")
  11. else
  12. vim.health.warn("`mypy` was not found")
  13. if vim.tbl_count(vim.fn.systemlist("echo $VIRTUAL_ENV")) == 0 then
  14. vim.health.warn(
  15. "Missing `mypy` likely due to unset $VIRTUAL_ENV in subshell")
  16. else
  17. vim.health.ok("Check that `mypy` is installed in $VIRTUAL_ENV: " ..
  18. vim.fn.system("echo $VIRTUAL_ENV"))
  19. end
  20. end
  21. if maj_peg.status().has_mypy_baseline then
  22. vim.health.ok("`mypy-baseline` found")
  23. else
  24. vim.health.warn("`mypy-baseline` was not found")
  25. end
  26. if maj_peg.status().setup then
  27. vim.health.ok("Set up")
  28. else
  29. vim.health.warn("Not set up")
  30. end
  31. end
  32. }