If you want to help but don't know where to start, here are some low-risk/isolated tasks:
$NVIM_LOG_FILE
, if it exists.cmake --system-information
for build-related issues.:help dev
if you are working on Nvim core.:help dev-ui
if you are developing a UI.:help dev-api-client
if you are developing an API client.ninja
for faster builds of Nvim.
sudo apt-get install ninja-build
make distclean
make # Nvim build system uses ninja automatically, if available.
[WIP]
pull request as soon as possible.master
into your PR when there are conflicts or when master
introduces breaking changes.ri
git alias:
[alias]
ri = "!sh -c 't=\"${1:-master}\"; s=\"${2:-HEAD}\"; mb=\"$(git merge-base \"$t\" \"$s\")\"; if test \"x$mb\" = x ; then o=\"$t\"; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\"; if test \"x$lm\" = x ; then o=\"$mb\"; else o=\"$lm\"; fi; fi; test $# -gt 0 && shift; test $# -gt 0 && shift; git rebase --interactive \"$o\" \"$@\"'"
This avoids unnecessary rebases yet still allows you to combine related
commits, separate monolithic commits, etc.exec make -C build unittest
between each
pick/edit/reword.Pull requests have three stages: [WIP]
(Work In Progress), [RFC]
(Request
For Comment) and [RDY]
(Ready).
[RFC]
is assumed by default, do not put "RFC" in the PR title (it adds
noise to merge commit messages).[WIP]
to the PR title if you are not requesting feedback and the work
is still in flux.[RDY]
to the PR title if you are done and only waiting on merge.Follow the convential commits guidelines to make reviews easier and to make the VCS/git logs more valuable. The general structure of a commit message is as follows:
<type>([optional scope]): <description>
[optional body]
[optional footer(s)]
doc:
, test:
runtime:
, ...
style
or lint
.(lsp)
, (treesitter)
, (multigrid)
, ...
Each pull request must pass the automated builds on Travis CI, sourcehut and AppVeyor.
-Werror
, so compiler warnings
will fail the build.VALGRIND=1 make test
CC=clang make CMAKE_FLAGS="-DCLANG_ASAN_UBSAN=ON"
CI for freebsd and openbsd runs on sourcehut.
# To get a full backtrace: # 1. Rebuild with debug info. rm -rf nvim.core build gmake CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCI_BUILD=ON -DMIN_LOG_LEVEL=3" nvim # 2. Run the failing test to generate a new core file. TEST_FILE=test/functional/foo.lua gmake functionaltest lldb build/bin/nvim -c nvim.core ```
View the Clang report to see potential bugs found by the Clang scan-build analyzer.
git log --oneline --no-merges --grep clang
scan-build
like this:
rm -rf build/
scan-build --use-analyzer=/usr/bin/clang make
View the PVS report to see potential bugs found by PVS Studio.
{id}
is the PVS warning-id)):
PVS/V{id}: {description}
git log --oneline --no-merges --grep PVS
./scripts/pvscheck.sh
to run PVS locally.Coverity runs against the master build. To view the defects, just request access; you will be approved.
{id}
is the CID (Coverity ID);
(example)):
coverity/{id}: {description}
git log --oneline --no-merges --grep coverity
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 -DCLANG_ASAN_UBSAN=1" make
When running neovim, use
UBSAN_OPTIONS=print_stacktrace=1 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.
You can run the linter locally by:
make lint
The lint step downloads the master error list and excludes them, so only lint errors related to the local changes are reported.
You can lint a single file (but this will not exclude legacy errors):
./src/clint.py src/nvim/ops.c
The repo includes a .clang-format
config file which (mostly) matches the
style-guide. You can use clang-format
to format code with the gq
operator in Nvim:
if !empty(findfile('.clang-format', ';'))
setlocal formatprg=clang-format\ -style=file
endif
ctags
binary provided by your distro, is
unmaintained and won't recognize many function signatures in Neovim source.)To help review pull requests, start with this checklist.
Reviewing can be done on GitHub, but you may find it easier to do locally.
Using hub
, you can create a new branch with the contents of a pull
request, e.g. #1820:
hub 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.