Closed gegoune closed 3 years ago
@terrortylor This PR is missing tests. I have never written one before and am not sure how to do that. Some guidance would be really appreciated. Wasn't sure what to call hook
setting. Maybe something more descriptive such as pre_comment_hook
?
Sorry been awol. Sure, take a look at the tests in the tests directory, and the Makefile for how to run. You will need plentary (https://github.com/nvim-lua/plenary.nvim)
Suggestion for a test would be to create a clouse function and set that in the hook that modified a variable local to the test (maybe a counter), comment out some code, toggle it and check that that the variable is modified as expected.
You've some very opinionated readme changes there too ;) (I don't really mind they are all sensible!)
EDIT: Actually a lot of the README style changes seem pointless, and I'm not really on board with them
Really looking forward to this getting merged, can we just remove any unnecessary doc changes? That should be it's own PR anyways imo.
Still missing tests, tried to give it a go but never used plenary and wrote tests, do you mind helping out a bit?
hey, regarding tests I can help for sure! I'm super busy atm but maybe we can do a pair session? I'll approve and merge for now (looks fine) and then we can arrange a time to go over it together?
Ah, perfect, that's very nice of you, thanks!
hook
setting allowing users to pass in arbitrary function to call before readingcommentstring
vim.api
vim.api.nvim_command
with native API<Cmd>
instead of:
in key mappings to avoid changing modesCloses #6