1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77# Contributing guide
Contributions are more than welcome!
Please don't forget to add your changes to the "Unreleased" section of
[the changelog](./CHANGELOG.md) (if applicable).
## Commit messages
This project uses
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
## Development
I use [`nix`](https://nixos.org/download.html#download-nix)
(with flakes enabled) for development and testing.
Formatting is done with [`stylua`](https://github.com/JohnnyMorganz/StyLua).
To enter a development shell:
```console
nix develop
```
To apply formatting, while in a devShell, run
```console
pre-commit run --all
```
If you use [`direnv`](https://direnv.net/),
just run `direnv allow` and you will be dropped in this devShell.
## Tests
### Running tests
I use [`busted`](https://lunarmodules.github.io/busted/) for testing,
but with Neovim as the Lua interpreter.
The easiest way to run tests is with Nix (see below).
If you do not use Nix, you can also run the test suite using `luarocks test`.
For more information on how to set up Neovim as a Lua interpreter, see
- The [neorocks tutorial](https://github.com/nvim-neorocks/neorocks#without-neolua).
Or
- [`nlua`](https://github.com/mfussenegger/nlua).
> [!NOTE]
>
> The Nix devShell sets up `luarocks test` to use Neovim as the interpreter.
### Running tests and checks with Nix
If you just want to run all checks that are available,
run:
```console
nix flake check --print-build-logs
```
To run tests locally
```console
nix build .#checks.<your-system>.ci --print-build-logs
```
For formatting:
```console
nix build .#checks.<your-system>.formatting --print-build-logs
```