Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Use lua-typecheck-action for all PRs #1160

Closed
1 task done
pysan3 opened this issue Nov 12, 2023 · 7 comments · Fixed by #1161
Closed
1 task done

Proposal: Use lua-typecheck-action for all PRs #1160

pysan3 opened this issue Nov 12, 2023 · 7 comments · Fixed by #1161
Labels
feature Issues related to feature proposals. Please attach a module.

Comments

@pysan3
Copy link
Contributor

pysan3 commented Nov 12, 2023

Issues

  • I have checked existing issues and there are no existing ones with the same request.

Feature description

Recently I've been hearing about neorg more and more and I can see the project growing rapidly and more people contributing to the project.

Whilst that is definitely a good thing, it is inevitable that the codebase will become more messy and will potentially lead to more bugs.

https://github.com/mrcjkb/lua-typecheck-action is a GH Action which checks for type issues using lua_ls and I believe will be able to alert us on many potential issues that the holy untyped-stripting language might bring to us.
I suggest adding this action to this repo as well as adding more type notation into the codebase.

Acceptable type notations are listed here: https://github.com/LuaLS/lua-language-server/wiki/Annotations.

Help

No

Implementation help

Sorry I'm quite busy right now.

@pysan3 pysan3 added the feature Issues related to feature proposals. Please attach a module. label Nov 12, 2023
@github-project-automation github-project-automation bot moved this to added-updated-reopened in sorting neorg issue tracker Nov 12, 2023
@vhyrro
Copy link
Member

vhyrro commented Nov 12, 2023

Yep this sounds like a fantastic idea! Should have some time either later today or tommorow 🤞

@pysan3
Copy link
Contributor Author

pysan3 commented Nov 12, 2023

Sweet! Amazing work @vhyrro !

@pysan3
Copy link
Contributor Author

pysan3 commented Nov 14, 2023

Reference;

mrcjkb/lua-typecheck-action#34

@max397574
Copy link
Contributor

just wondering
do we want to use the neodev types?
shouldn't the long term goal be to use the core ones?

@pysan3
Copy link
Contributor Author

pysan3 commented Nov 14, 2023

neodev.nvim/types/{stable,nightly} folder includes the auto-generated type annotations for all vim core apis, and that's what I was referring to.
Not trying to use neodev's own functionality (neodev.nvim/lua) (in fact, I don't call require("neodev").setup in the action so neodev is doing mostly nothing.

https://github.com/folke/neodev.nvim/blob/main/types/stable/api.lua

On the other hand, if you want to add more plugin dependencies (I know it's not being asked but just fyi) it's easy to add them via checkout action, clone it inside deps and then stick it into the library field in .luarc.json.

@max397574
Copy link
Contributor

max397574 commented Nov 14, 2023

neodev.nvim/types/{stable,nightly} folder includes the auto-generated type annotations for all vim core apis, and that's what I was referring to.
Not trying to use neodev's own functionality (neodev.nvim/lua) (in fact, I don't call require("neodev").setup in the action so neodev is doing mostly nothing.

I know
but most of those annotations are now also in core
for example I no longer use neodev in my setup and I get type checking for vim.api.*, vim.fn.* etc

@pysan3
Copy link
Contributor Author

pysan3 commented Nov 14, 2023

Oh, didn't know that!

That's a nice thing to have but looking at some issues, it's not completed all the way through?
Also, that action is using the nix version of neovim ig? and I have no knowledge of nix but where can I find the $XDG_DATA_HOME/nvim/runtime/lua directory?

If we add that path to lua_ls, I think we can use that instead. I just don't know anything about nix and installing via neodev was easier.
At least I got undeclared global variable vim error when I used it without any parameter so I don't think it works ootb.

vhyrro added a commit that referenced this issue Nov 14, 2023
vhyrro added a commit that referenced this issue Nov 14, 2023
@github-project-automation github-project-automation bot moved this from added-updated-reopened to done in sorting neorg issue tracker Nov 14, 2023
benlubas pushed a commit to benlubas/neorg that referenced this issue Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Issues related to feature proposals. Please attach a module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants