robin/laufey

tiny neovim fork for cozy coding

git clone https://git.robinwobin.dev/robin/laufey

robinmerge: 1dc9728daa1d8a2702

master
15.1 KiB374 linesraw

Contributing to Neovim

Getting started

If you are new to the codebase, read :help dev-quickstart to see how to run tests and start hacking on the codebase.

If you want to help but don't know where to start, here are some low-risk/isolated tasks:

  • Try a complexity:low issue.
  • Fix bugs found by Coverity.
  • Merge a Vim patch (requires strong familiarity with Vim)
    • NOTE: read the above link before sending improvements to "runtime files" (anything in runtime/).
      • Vimscript files are (mostly) maintained by Vim, not Nvim.
      • Lua files are maintained by Nvim.
      • Nvim's filetype detection behavior matches Vim, so changes to filetype detection should be submitted to Vim first.

Reporting problems

  • Check the FAQ.
  • Search existing issues (including closed!)
  • Update Neovim to the latest version to see if your problem persists.
  • Try to reproduce with nvim --clean ("factory defaults").
  • If a specific configuration or plugin is necessary to recreate the problem, use the minimal template in contrib/minimal.lua with nvim --clean -u contrib/minimal.lua after making the necessary changes.
  • Bisect your config: disable plugins incrementally, to narrow down the cause of the issue.
  • Bisect Neovim's source code to find the cause of a regression, if you can. This is extremely helpful.
  • When reporting a crash, include a stacktrace.
  • Use ASAN/UBSAN to get detailed errors for segfaults and undefined behavior.
  • Check the logs. :edit $NVIM_LOG_FILE
  • Include cmake --system-information for build-related issues.

Developer guidelines

  • New functionality should generally be implemented in Lua, not C. PRs #37757, #37831 are excellent examples of this.
  • Read :help dev-quickstart to see how to run tests and start hacking on the codebase.
  • Read :help dev and :help dev-doc if you are working on Nvim core.
  • Read :help dev-ui if you are developing a UI.
  • Read :help dev-api-client if you are developing an API client.
  • Install ninja for faster builds of Nvim.
    sudo apt-get install ninja-build
    make distclean
    make  # Nvim build system uses ninja automatically, if available.
  • Install ccache or sccache for faster rebuilds of Nvim. Nvim will use one of these automatically if it's found. To disable caching use:
    cmake -B build -D CACHE_PRG=OFF

Pull requests (PRs)

Guidelines

  • Don't ask to be assigned to an issue, just send a (reasonably complete) PR and mark it as Draft until it is ready for review.
  • Your PR must include test coverage.
  • Avoid cosmetic changes to unrelated files in the same commit.
  • Use a feature branch instead of the master branch.
  • Use a rebase workflow. After addressing review comments, it's fine to force-push.

AI-assisted work

Using AI for contributions is acceptable, given the following:

  • YOU review the output before sending a non-Draft PR. Do NOT request review until YOU have checked the AI generated PR and verify the following:
  • REMOVE verbosity and blathering from documentation, comments, PR description, commit message, etc. All resources, including names, should be CONCISE and CLEAR. They should contain USEFUL information and nothing more.
  • REMOVE and DEDUPLICATE redundant code, tests, explanations, etc. Explicitness and clarity are GOOD but verbosity, over-explanation, and redundancy is BAD.

Merging to master

For maintainers: when a PR is ready to merge to master,

  • prefer Squash Merge for "single-commit PRs" (when the PR has only one meaningful commit).
  • prefer Merge for "multi-commit PRs" (when the PR has multiple meaningful commits).

Stages: Draft and Ready for review

Pull requests have two stages: Draft and Ready for review.

  1. Create a Draft PR while you are not requesting feedback and still working on the PR.
  2. Change your PR to Ready when the PR is ready for review.
    • You can convert back to Draft at any time.

Do not add labels like [RFC] or [WIP] in the title to indicate the state of your PR: this just adds noise.

PR description

For bugfixes, your PR title should be essentially the same as (1) the "Problem" statement and (2) the test-case name. For example PR #38048:

  • Title: fix(lua): extra CR (\r) in nvim -l output
  • Problem: nvim -l prints an extra \r to stdout: ...
  • Test name: it('outputs the EOF as LF (not CRLF) #36853' ...

Commit messages

Follow the conventional commits guidelines to make reviews easier and to make the VCS/git logs more valuable (try make lintcommit). The structure of a commit message is:

type(scope): subject

Problem:
...

Solution:
...
  • Commit message subject (you can ignore this for "fixup" commits or any commits you expect to be squashed):
    • Prefix with a type:
      • build ci docs feat fix perf refactor revert test vim-patch
    • Append an optional (scope) such as (lsp), (treesitter), (float), …
    • Use the imperative voice: "Fix bug" rather than "Fixed bug" or "Fixes bug."
    • Keep it short (under 72 characters).
  • Commit message body (detail):
    • Concisely describe the Problem/Solution in the commit body. Describing the problem independently of the solution often leads to a better understanding for you, reviewers, and future readers.
      Problem:
      
      Solution:
      
  • Indicate breaking API changes with "!" after the type, and a "BREAKING CHANGE" footer. Example:
    refactor(provider)!: drop support for Python 2
    
    BREAKING CHANGE: refactor to use Python 3 features since Python 2 is no longer supported.
    

Automated builds (CI)

Each pull request must pass the automated builds on GitHub Actions.

  • CI builds are compiled with -Werror, so compiler warnings will fail the build.
  • If any tests fail, the build will fail. See test/README.md#running-tests to run tests locally.
  • CI runs ASan and other analyzers.
    • To run valgrind locally: VALGRIND=1 make test
    • To run ASan/UBSan locally: CC=clang make CMAKE_FLAGS="-DENABLE_ASAN_UBSAN=ON". Note that MSVC requires Release or RelWithDebInfo build type to work properly.
  • The lint build checks that the code is formatted correctly and passes various linter checks.
  • To see CI results faster in your PR, you can temporarily set TEST_FILE in test.yml.

Coverity

Coverity runs against the master build. To view the defects you must request access (Coverity does not have a "public" view), then you will be approved as soon as a maintainer sees the email.

  • Use this format for commit messages (where {id} is the CID (Coverity ID); (example)):
    fix(coverity/{id}): {description}
    
  • Search the Neovim commit history to find examples:
    git log --oneline --no-merges --grep coverity

Sanitizers (ASAN and UBSAN)

ASAN/UBSAN can be used to detect memory errors and other common forms of undefined behavior at runtime in debug builds.

  • To build Neovim with sanitizers enabled, use
    rm -rf build && CMAKE_EXTRA_FLAGS="-DCMAKE_C_COMPILER=clang -DENABLE_ASAN_UBSAN=1" make
    
  • When running Neovim, use
    ASAN_OPTIONS=log_path=/tmp/nvim_asan nvim args...
    
  • If Neovim exits unexpectedly, check /tmp/nvim_asan.{PID} (or your preferred log_path) for log files with error messages.

Coding

Lint

You can run the linter locally by:

make lint  # or lintc, lintlua, lintquery, lintdoc

Style

  • You can format files by using:
    make format  # or formatc, formatlua, formatquery
    This will format changed C, Lua, and treesitter query files with all appropriate flags set.
  • Style rules are (mostly) defined by src/uncrustify.cfg which tries to match the style-guide. To use the Nvim gq command with uncrustify:
    if !empty(findfile('src/uncrustify.cfg', ';'))
      setlocal formatprg=uncrustify\ -q\ -l\ C\ -c\ src/uncrustify.cfg\ --no-backup
    endif

Navigate

Includes

For managing includes in C files, use include-what-you-use.

  • Install include-what-you-use
  • To see which includes needs fixing use the cmake preset iwyu:
    cmake --preset iwyu
    cmake --build build
  • There's also a make target that automatically fixes the suggestions from IWYU:
    make iwyu

See #549 for more details.

Lua runtime files

The Lua runtime/lua/vim/_core/ modules are precompiled to bytecode, so changes won't be usable unless you (1) rebuild Nvim or (2) start Nvim with --luamod-dev and $VIMRUNTIME. For example try adding a function to runtime/lua/vim/_core/editor.lua, then:

VIMRUNTIME=./runtime ./build/bin/nvim --luamod-dev

Documentation

Read :help dev-doc to understand the expected documentation style and conventions.

Generating :help

Many :help docs are autogenerated from (C or Lua) docstrings. To generate the documentation run:

make doc

To validate the documentation files, run:

make lintdoc

If you need to modify or debug the documentation flow, these are the main files:

  • ./src/gen/gen_vimdoc.lua: Main doc generator. Parses C and Lua files to render vimdoc files.

  • ./src/gen/luacats_parser.lua: Documentation parser for Lua files.

  • ./src/gen/cdoc_parser.lua: Documentation parser for C files.

  • ./src/gen/luacats_grammar.lua: Lpeg grammar for LuaCATS

  • ./src/gen/cdoc_grammar.lua: Lpeg grammar for C doc comments

  • ./src/gen/gen_eval_files.lua: Generates documentation and Lua type files from metadata files:

    runtime/lua/vim/*     =>  runtime/doc/lua.txt
    runtime/lua/vim/*     =>  runtime/doc/lua.txt
    runtime/lua/vim/lsp/  =>  runtime/doc/lsp.txt
    src/nvim/api/*        =>  runtime/doc/api.txt
    src/nvim/eval.lua     =>  runtime/doc/vimfn.txt
    src/nvim/options.lua  =>  runtime/doc/options.txt
    
  • ./scripts/lintdoc.lua: Validation and linting of documentation files.

Lua docstrings

Use LuaCATS annotations in Lua docstrings to annotate parameter types, return types, etc. See :help dev-lua-doc.

Run make emmylua-check to check the runtime with EmmyLua. The build downloads the pinned checker automatically. Settings are in .emmyrc.json.

Third-party dependencies

To build Nvim using a different commit of a dependency change the appropriate URL in cmake.deps/deps.txt. For example, to use a different version of luajit replace the value in LUAJIT_URL with the wanted commit hash:

LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/<sha>.tar.gz

Set DEPS_IGNORE_SHA to TRUE in cmake.deps/CMakeLists.txt to skip hash check from cmake.

Alternatively, you may point the URL as a local path where the repository is. This is convenient when bisecting a problem in a dependency with git bisect. This may require running make distclean between each build. Hash checking is always skipped in this case regardless of DEPS_IGNORE_SHA.

LUAJIT_URL /home/user/luajit

Reviewing

Reviewing can be done on GitHub, but you may find it easier to do locally. Using GitHub CLI, you can create a new branch with the contents of a pull request, e.g. #1820:

gh pr checkout https://github.com/neovim/neovim/pull/1820

Use git log -p master..FETCH_HEAD to list all commits in the feature branch which aren't in the master branch; -p shows each commit's diff. To show the whole surrounding function of a change as context, use the -W argument as well.

1Contributing to Neovim
2======================
3
4Getting started
5---------------
6
7If you are new to the codebase, read [:help dev-quickstart](https://neovim.io/doc/user/dev_tools.html#dev-quickstart)
8to see how to run tests and start hacking on the codebase.
9
10If you want to help but don't know where to start, here are some
11low-risk/isolated tasks:
12
13- Try a [complexity:low] issue.
14- Fix bugs found by [Coverity](#coverity).
15- [Merge a Vim patch] (requires strong familiarity with Vim)
16  - NOTE: read the above link before sending improvements to "runtime files" (anything in `runtime/`).
17    - *Vimscript* files are (mostly) maintained by [Vim], not Nvim.
18    - *Lua* files are maintained by *Nvim*.
19    - Nvim's [filetype detection](https://github.com/neovim/neovim/blob/master/runtime/lua/vim/filetype.lua) behavior matches Vim, so changes to filetype detection should be submitted to [Vim] first.
20
21Reporting problems
22------------------
23
24- [Check the FAQ][wiki-faq].
25- [Search existing issues][github-issues] (including closed!)
26- Update Neovim to the latest version to see if your problem persists.
27- Try to reproduce with `nvim --clean` ("factory defaults").
28- If a specific configuration or plugin is necessary to recreate the problem, use the minimal template in `contrib/minimal.lua` with `nvim --clean -u contrib/minimal.lua` after making the necessary changes.
29- [Bisect](https://neovim.io/doc/user/starting.html#bisect) your config: disable plugins incrementally, to narrow down the cause of the issue.
30- [Bisect][git-bisect] Neovim's source code to find the cause of a regression, if you can. This is _extremely_ helpful.
31- When reporting a crash, [include a stacktrace](https://neovim.io/doc/user/dev_tools.html#dev-tools-backtrace).
32- Use [ASAN/UBSAN](#sanitizers-asan-and-ubsan) to get detailed errors for segfaults and undefined behavior.
33- Check the logs. `:edit $NVIM_LOG_FILE`
34- Include `cmake --system-information` for build-related issues.
35
36Developer guidelines
37--------------------
38
39- New functionality should generally be implemented in Lua, not C. PRs [#37757](https://github.com/neovim/neovim/pull/37757), [#37831](https://github.com/neovim/neovim/pull/37831)
40  are excellent examples of this.
41- Read [:help dev-quickstart](https://neovim.io/doc/user/dev_tools.html#dev-quickstart) to see how to run tests and start hacking on the codebase.
42- Read [:help dev](https://neovim.io/doc/user/dev.html#dev) and [:help dev-doc][dev-doc-guide] if you are working on Nvim core.
43- Read [:help dev-ui](https://neovim.io/doc/user/dev.html#dev-ui) if you are developing a UI.
44- Read [:help dev-api-client](https://neovim.io/doc/user/dev.html#dev-api-client) if you are developing an API client.
45- Install `ninja` for faster builds of Nvim.
46  ```bash
47  sudo apt-get install ninja-build
48  make distclean
49  make  # Nvim build system uses ninja automatically, if available.
50  ```
51- Install `ccache` or `sccache` for faster rebuilds of Nvim. Nvim will use one
52  of these automatically if it's found. To disable caching use:
53  ```bash
54  cmake -B build -D CACHE_PRG=OFF
55  ```
56
57Pull requests (PRs)
58---------------------
59
60### Guidelines
61
62- Don't ask to be assigned to an issue, just send a (reasonably complete) PR and
63  mark it as Draft until it is ready for review.
64- Your PR must include [test coverage][run-tests].
65- Avoid cosmetic changes to unrelated files in the same commit.
66- Use a [feature branch][git-feature-branch] instead of the master branch.
67- Use a _rebase workflow_. After addressing review comments, it's fine to force-push.
68
69### AI-assisted work
70
71Using AI for contributions is acceptable, given the following:
72
73- YOU review the output before sending a non-Draft PR. Do NOT request review
74  until YOU have checked the AI generated PR and verify the following:
75- REMOVE verbosity and blathering from documentation, comments, PR description,
76  commit message, etc. All resources, including names, should be CONCISE and
77  CLEAR. They should contain USEFUL information and nothing more.
78- REMOVE and DEDUPLICATE redundant code, tests, explanations, etc. Explicitness
79  and clarity are GOOD but verbosity, over-explanation, and redundancy is BAD.
80
81### Merging to master
82
83For maintainers: when a PR is ready to merge to master,
84
85- prefer _Squash Merge_ for "single-commit PRs" (when the PR has only one meaningful commit).
86- prefer _Merge_ for "multi-commit PRs" (when the PR has multiple meaningful commits).
87
88### Stages: Draft and Ready for review
89
90Pull requests have two stages: Draft and Ready for review.
91
921. [Create a Draft PR][pr-draft] while you are _not_ requesting feedback and
93   still working on the PR.
942. [Change your PR to Ready][pr-ready] when the PR is ready for review.
95    - You can convert back to Draft at any time.
96
97Do __not__ add labels like `[RFC]` or `[WIP]` in the title to indicate the
98state of your PR: this just adds noise.
99
100### PR description
101
102For bugfixes, your PR title should be essentially the same as (1) the
103"Problem" statement and (2) the test-case name. For example [PR #38048](https://github.com/neovim/neovim/pull/38048):
104
105- Title: `fix(lua): extra CR (\r) in nvim -l output`
106- Problem: `nvim -l prints an extra \r to stdout: ...`
107- Test name: `it('outputs the EOF as LF (not CRLF) #36853' ...`
108
109### Commit messages
110
111Follow the [conventional commits guidelines][conventional_commits] to *make reviews easier* and to make
112the VCS/git logs more valuable (try `make lintcommit`). The structure of a commit message is:
113
114    type(scope): subject
115
116    Problem:
117    ...
118
119    Solution:
120    ...
121
122- Commit message **subject** (you can **ignore this for "fixup" commits** or any commits you expect to be squashed):
123    - Prefix with a [_type_](https://github.com/commitizen/conventional-commit-types/blob/master/index.json):
124        - `build ci docs feat fix perf refactor revert test vim-patch`
125    - Append an optional `(scope)` such as `(lsp)`, `(treesitter)`, `(float)`, …
126    - Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
127    - Keep it short (under 72 characters).
128- Commit message **body** (detail):
129    - Concisely describe the Problem/Solution in the commit **body**. [Describing the problem](https://lamport.azurewebsites.net/pubs/state-the-problem.pdf)
130      _independently of the solution_ often leads to a better understanding for you, reviewers, and future readers.
131      ```
132      Problem:
133
134      Solution:
135      ```
136- Indicate breaking API changes with "!" after the type, and a "BREAKING CHANGE" footer. Example:
137  ```
138  refactor(provider)!: drop support for Python 2
139
140  BREAKING CHANGE: refactor to use Python 3 features since Python 2 is no longer supported.
141  ```
142
143### Automated builds (CI)
144
145Each pull request must pass the automated builds on [GitHub Actions].
146
147- CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings
148  will fail the build.
149- If any tests fail, the build will fail. See [test/README.md#running-tests][run-tests] to run tests locally.
150- CI runs [ASan] and other analyzers.
151    - To run valgrind locally: `VALGRIND=1 make test`
152    - To run ASan/UBSan locally: `CC=clang make CMAKE_FLAGS="-DENABLE_ASAN_UBSAN=ON"`.
153      Note that MSVC requires Release or RelWithDebInfo build type to work properly.
154- The [lint](#lint) build checks that the code is formatted correctly and
155  passes various linter checks.
156- To see CI results faster in your PR, you can temporarily set `TEST_FILE` in
157  [test.yml](https://github.com/neovim/neovim/blob/ad8e0cfc1dfd937c2577dc032e524c799a772693/.github/workflows/test.yml#L26).
158
159### Coverity
160
161Coverity runs against the master build. To view the defects you must
162[request access](https://scan.coverity.com/projects/neovim-neovim) (Coverity
163does not have a "public" view), then you will be approved as soon as
164a maintainer sees the email.
165
166- Use this format for commit messages (where `{id}` is the CID (Coverity ID);
167  ([example](https://github.com/neovim/neovim/pull/804))):
168  ```
169  fix(coverity/{id}): {description}
170  ```
171- Search the Neovim commit history to find examples:
172  ```bash
173  git log --oneline --no-merges --grep coverity
174  ```
175
176### Sanitizers (ASAN and UBSAN)
177
178  ASAN/UBSAN can be used to detect memory errors and other common forms of undefined behavior at runtime in debug builds.
179
180- To build Neovim with sanitizers enabled, use
181  ```
182  rm -rf build && CMAKE_EXTRA_FLAGS="-DCMAKE_C_COMPILER=clang -DENABLE_ASAN_UBSAN=1" make
183  ```
184- When running Neovim, use
185  ```
186  ASAN_OPTIONS=log_path=/tmp/nvim_asan nvim args...
187  ```
188- If Neovim exits unexpectedly, check `/tmp/nvim_asan.{PID}` (or your preferred `log_path`) for log files with error messages.
189
190
191Coding
192------
193
194### Lint
195
196You can run the linter locally by:
197
198```bash
199make lint  # or lintc, lintlua, lintquery, lintdoc
200```
201
202### Style
203
204- You can format files by using:
205  ```bash
206  make format  # or formatc, formatlua, formatquery
207  ```
208  This will format changed C, Lua, and treesitter query files with all
209  appropriate flags set.
210- Style rules are (mostly) defined by `src/uncrustify.cfg` which tries to match
211  the [style-guide]. To use the Nvim `gq` command with `uncrustify`:
212  ```vim
213  if !empty(findfile('src/uncrustify.cfg', ';'))
214    setlocal formatprg=uncrustify\ -q\ -l\ C\ -c\ src/uncrustify.cfg\ --no-backup
215  endif
216  ```
217
218### Navigate
219
220- Set `blame.ignoreRevsFile` to ignore [noisy commits](https://github.com/neovim/neovim/commit/2d240024acbd68c2d3f82bc72cb12b1a4928c6bf) in git blame:
221  ```bash
222  git config blame.ignoreRevsFile .git-blame-ignore-revs
223  ```
224
225- Recommendation is to use **[clangd]**.
226  Can use the maintained config in [nvim-lspconfig/clangd].
227- Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim).
228
229### Includes
230
231For managing includes in C files, use [include-what-you-use].
232
233- [Install include-what-you-use][include-what-you-use-install]
234- To see which includes needs fixing use the cmake preset `iwyu`:
235  ```bash
236  cmake --preset iwyu
237  cmake --build build
238  ```
239- There's also a make target that automatically fixes the suggestions from
240  IWYU:
241  ```bash
242  make iwyu
243  ```
244
245See [#549][549] for more details.
246
247### Lua runtime files
248
249The Lua [`runtime/lua/vim/_core/`](./runtime/lua/vim/_core/) modules are
250precompiled to bytecode, so changes won't be usable unless you (1) rebuild Nvim
251or (2) start Nvim with `--luamod-dev` and `$VIMRUNTIME`. For example try adding
252a function to `runtime/lua/vim/_core/editor.lua`, then:
253
254```bash
255VIMRUNTIME=./runtime ./build/bin/nvim --luamod-dev
256```
257
258Documentation
259-------------
260
261Read [:help dev-doc][dev-doc-guide] to understand the expected documentation style and conventions.
262
263### Generating :help
264
265Many `:help` docs are autogenerated from (C or Lua) docstrings. To generate the documentation run:
266
267```bash
268make doc
269```
270
271To validate the documentation files, run:
272
273```bash
274make lintdoc
275```
276
277If you need to modify or debug the documentation flow, these are the main files:
278- `./src/gen/gen_vimdoc.lua`:
279  Main doc generator. Parses C and Lua files to render vimdoc files.
280- `./src/gen/luacats_parser.lua`:
281  Documentation parser for Lua files.
282- `./src/gen/cdoc_parser.lua`:
283  Documentation parser for C files.
284- `./src/gen/luacats_grammar.lua`:
285  Lpeg grammar for LuaCATS
286- `./src/gen/cdoc_grammar.lua`:
287  Lpeg grammar for C doc comments
288- `./src/gen/gen_eval_files.lua`:
289  Generates documentation and Lua type files from metadata files:
290  ```
291  runtime/lua/vim/*     =>  runtime/doc/lua.txt
292  runtime/lua/vim/*     =>  runtime/doc/lua.txt
293  runtime/lua/vim/lsp/  =>  runtime/doc/lsp.txt
294  src/nvim/api/*        =>  runtime/doc/api.txt
295  src/nvim/eval.lua     =>  runtime/doc/vimfn.txt
296  src/nvim/options.lua  =>  runtime/doc/options.txt
297  ```
298
299- `./scripts/lintdoc.lua`: Validation and linting of documentation files.
300
301### Lua docstrings
302
303Use [LuaCATS] annotations in Lua docstrings to annotate parameter types, return
304types, etc. See [:help dev-lua-doc][dev-lua-doc].
305
306Run `make emmylua-check` to check the runtime with [EmmyLua]. The build downloads
307the pinned checker automatically. Settings are in `.emmyrc.json`.
308
309Third-party dependencies
310------------------------
311
312To build Nvim using a different commit of a dependency change the appropriate
313URL in `cmake.deps/deps.txt`. For example, to use a different version of luajit
314replace the value in `LUAJIT_URL` with the wanted commit hash:
315
316```bash
317LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/<sha>.tar.gz
318```
319
320Set `DEPS_IGNORE_SHA` to `TRUE` in `cmake.deps/CMakeLists.txt` to skip hash
321check from cmake.
322
323Alternatively, you may point the URL as a local path where the repository is.
324This is convenient when bisecting a problem in a dependency with `git bisect`.
325This may require running `make distclean` between each build. Hash checking is
326always skipped in this case regardless of `DEPS_IGNORE_SHA`.
327
328```bash
329LUAJIT_URL /home/user/luajit
330```
331
332Reviewing
333---------
334
335Reviewing can be done on GitHub, but you may find it easier to do locally.
336Using [GitHub CLI][gh], you can create a new branch with the contents of a pull
337request, e.g. [#1820][1820]:
338
339```bash
340gh pr checkout https://github.com/neovim/neovim/pull/1820
341```
342
343Use [`git log -p master..FETCH_HEAD`][git-history-filtering] to list all
344commits in the feature branch which aren't in the `master` branch; `-p`
345shows each commit's diff. To show the whole surrounding function of a change
346as context, use the `-W` argument as well.
347
348[549]: https://github.com/neovim/neovim/issues/549
349[1820]: https://github.com/neovim/neovim/pull/1820
350[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
351[GitHub Actions]: https://github.com/neovim/neovim/actions
352[Vim]: https://github.com/vim/vim
353[clangd]: https://clangd.llvm.org
354[Merge a Vim patch]: https://neovim.io/doc/user/dev_vimpatch.html
355[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
356[conventional_commits]: https://www.conventionalcommits.org
357[dev-doc-guide]: https://neovim.io/doc/user/dev.html#dev-doc
358[dev-lua-doc]: https://neovim.io/doc/user/dev.html#dev-lua-doc
359[LuaCATS]: https://luals.github.io/wiki/annotations/
360[EmmyLua]: https://github.com/EmmyLuaLs/emmylua-analyzer-rust
361[gcc-warnings]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
362[gh]: https://cli.github.com/
363[git-bisect]: http://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git
364[git-feature-branch]: https://www.atlassian.com/git/tutorials/comparing-workflows
365[git-history-filtering]: https://www.atlassian.com/git/tutorials/git-log/filtering-the-commit-history
366[github-issues]: https://github.com/neovim/neovim/issues
367[include-what-you-use-install]: https://github.com/include-what-you-use/include-what-you-use#how-to-install
368[include-what-you-use]: https://github.com/include-what-you-use/include-what-you-use#using-with-cmake
369[nvim-lspconfig/clangd]: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#clangd
370[pr-draft]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
371[pr-ready]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request
372[run-tests]: https://github.com/neovim/neovim/blob/master/runtime/doc/dev_test.txt
373[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
374[wiki-faq]: https://neovim.io/doc/user/faq.html