-
Notifications
You must be signed in to change notification settings - Fork 4
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
chore: add testing using plenary and linting using luacheck #10
chore: add testing using plenary and linting using luacheck #10
Conversation
95d4b91
to
a3b8382
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting this going! Just got a few comments:
- Looks like there's a dupe of
.github/workflows
in project root - Luacheck looks pretty unmaintained, selene would be better (it would also be fewer dev dependencies since we already need cargo for stylua)
- null-ls has an example of how to use it (look at selene.toml and vim.toml)
- gha: NTBBloodbath/selene-action
- This repo doesn't get many issues so let's hold off on the issue templates for now
- Testing setup options doesn't add a lot of value but will increase maintenance. The logic in both trail.lua and nav.lua could use some testing though! We can add a couple tests for those or just leave the test file empty here and tackle those later
All those comments have now been addressed. I added them as separate commits to make reviewing the changes easier. Let me know if you would like me to squash them. |
Thanks! A couple last comments:
I'll get this merged after your updates |
build: enable testing and linting in GitHub for pushes,pull_requests test: setup() with no options feat: configuration is typed using luals types https://luals.github.io/wiki/annotations/ test: some public api is created when setup() is called This doesn't test everything but it should be better than nothing. chore: 'make format' formats all code and tests chore: remove duplicate workflows that were added by accident chore: remove unneeded issue templates for now test: only have one example spec for now, don't test options chore: add linting with the selene lua linter build: run selene in Github instead of luacheck chore: remove luacheckrc, not needed since we want to use selene instead chore: remove 'make init', not needed chore: make sure 'make format' reformats in all lua/ subdirectories More might get added in the future, so it's good to format everything always
c78fe30
to
7d26685
Compare
Oops, you were right. I pushed these changes, but after that I also squashed and separated the changes in this PR into 2 commits. I wanted to make it easy to review the most recent changes while also getting a cleaner history after merging, but looks like my force push made it so that the separate changes aren't visible in this PR as separate commits somehow. Well, I hope they will still be easy to see since the PR is small. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! No worries about the clean commits. I appreciate the thought, it does help with reviewing.
This PR adds testing and linting to the codebase. I think having tests will be a very good idea and will make collaboration much easier in the future. I don't feel that strongly about linting, but it was very easy to add so I figured why not 😄
The testing and linting setup is copied and adapted from https://github.com/S1M0N38/my-awesome-plugin.nvim, a project template for neovim plugin development.
Successful tests in the terminal
Here's how the testing and linting looks like on my computer:
Failed tests in the terminal
The tests can also be run inside neovim (probably more convenient). Here's some examples:
Successful tests in neovim
(ignore the warnings, I haven't looked into how to get rid of them yet)
Failed tests in neovim
(can probably look a bit better if configured correctly)
You can see an example CI run from this commit (follow the ✅ icon to see the builds).
Here's some ideas for future work: