Skip to content

Latest commit

 

History

History
78 lines (52 loc) · 2.57 KB

DEVELOPMENT.md

File metadata and controls

78 lines (52 loc) · 2.57 KB

Development Instructions

Tests

Most tests run quick, execute them with:

cargo test

Refreshing the cache needs a working internet connection and might take a while. These tests are by default disabled. Include them with

cargo test -- --include-ignored

Use tarpaulin to check for code coverage. Make sure to --include-ignored tests and include the integration tests with --follow-exec. This can take a long time. To generate a HTML report, run the check with

cargo tarpaulin --engine llvm --all-features --workspace --timeout 360 --out Html --follow-exec -- --include-ignored

Benchmarking

First build nps in release mode.

cargo build --release

Then run benchmarks on the produced executable with:

hyperfine './target/release/nps -e neovim'

Git Hooks

Review the hooks in the hooks folder and use them with

git config core.hooksPath hooks

Release

  1. Document future changes in the CHANGELOG.md under "Unreleased". Check if the pre-push hooks pass - apart from tags.

    ./hooks/pre-push
  2. Do a dry-run with

    cargo release [LEVEL|VERSION]

    and review the changes. Possible choices for LEVEL are beta, alpha or rc for development (pre-) releases and major, minor, patch or release (removes the pre-release extension) for production releases.

  3. Execute the cargo release. This will run the tests, tag the release and push to GitHub.

    cargo release [LEVEL|VERSION] --execute --no-publish
  4. Create a pull request for the development branch into main. If all pre-checks succeed, conclude the pull request. A release draft will is created from CHANGELOG.md.

  5. Review the release draft under "Releases" and publish the release.

Merge onto main

GitHub.com does not allow for fast-forward merges on the web UI. This means that the tags created on the development branch will not point to the main branch after merging. To fix this we need to disable the default merging and create our own way.

Setup

  1. Abuse "Setting -> General -> Pull Requests" and "Settings -> Rules -> Ruleset (main)" to create conflicting requirements for the main branch. This disables merging on the web UI. See: https://github.com/orgs/community/discussions/4618#discussioncomment-11652479

  2. Instead, use GitHub actions to fast-forward merge. See https://github.com/sequoia-pgp/fast-forward for details.

Usage

After all tests have passed, comment /fast-forward in the PR discussions.