# gh-pr-comments ⚠️ Warning: This plugin is in active development. Simple neovim plugin for working with comments on your local branch and GitHub PR. ## Requirements - `GITHUB_TOKEN` environment variable - [`gh`](https://cli.github.com/) CLI ## TODO - [x] rename to gh-pr-comments.nvim - [x] add clear virtualtext autocmd - [x] goto first line with comment opening file - [x] keymap to cycle through comment linenumbers in a file - [x] virtualtext should just show number of comments on the line and add keymap to open all in scratch buffer - [x] add diff hunk above comments view - [x] fix if comment has new lines - [ ] when in inspect comment mode, ctrl+n should go to the next comment in the same buffer - [ ] don't use whole diff hunk, just the comment maybe? - [ ] smarter left/right comment location (to help figure out which line to use) - [ ] add ability to reply - [ ] add opts to pass into config for keymaps/window size - [ ] subject_type (The level at which the comment is targeted, can be a diff line or a file.) ## Development [GitHub PR Comments Endpoint](https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#list-review-comments-on-a-pull-request) ### Run tests Running tests requires either - [luarocks][luarocks] - or [busted][busted] and [nlua][nlua] to be installed[^1]. [^1]: The test suite assumes that `nlua` has been installed using luarocks into `~/.luarocks/bin/`. You can then run: ```bash luarocks test --local # or busted ``` Or if you want to run a single test file: ```bash luarocks test spec/path_to_file.lua --local # or busted spec/path_to_file.lua ``` If you see an error like `module 'busted.runner' not found`: ```bash eval $(luarocks path --no-bin) ``` For this to work you need to have Lua 5.1 set as your default version for luarocks. If that's not the case you can pass `--lua-version 5.1` to all the luarocks commands above. `rockspec-format`: https://github.com/luarocks/luarocks/wiki/Rockspec-format `luarocks`: https://luarocks.org `luarocks-api-key`: https://luarocks.org/settings/api-keys `gh-actions-secrets`: https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository `busted`: https://lunarmodules.github.io/busted/ `nlua`: https://github.com/mfussenegger/nlua `use-this-template`: https://github.com/new?template_name=nvim-lua-plugin-template&template_owner=nvim-lua