Skip to content

Commit

Permalink
docs: add CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Oct 21, 2023
1 parent a55bbd0 commit 02eff31
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# 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) for development and testing.
- [`stylua`](https://github.com/JohnnyMorganz/StyLua),
[`.editorconfig`](https://editorconfig.org/),
and [`alejandra`](https://github.com/kamadorueda/alejandra)
for formatting.
- [`luacheck`](https://github.com/mpeterv/luacheck),
and [`markdownlint`](https://github.com/DavidAnson/markdownlint),
for linting.
- [`sumneko-lua-language-server`](https://github.com/sumneko/lua-language-server/wiki/Diagnosis-Report#create-a-report)
for static type checking.

### Running tests

This plugin uses [`busted`](https://lunarmodules.github.io/busted/) for testing.

The best way to run tests is with Nix (see below),
because this includes tests that take different
envrionments into account (e.g. with/without `rust-analyzer`, `cargo`, ...).

If you do not use Nix, you can run a basic version of the test suite using
`luarocks test`.
For more information, see the [neorocks tutorial](https://github.com/nvim-neorocks/neorocks#without-neolua).

### Development using Nix

> **Note**
>
> [Flakes](https://nixos.wiki/wiki/Flakes) must be enabled.
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

To run tests locally

```console
nix build .#checks.<your-system>.haskell-tools-test --print-build-logs
```

For formatting and linting:

```console
nix build .#checks.<your-system>.formatting --print-build-logs
```

If you have flakes enabled and just want to run all checks that are available, run:

```console
nix flake check --print-build-logs
```

0 comments on commit 02eff31

Please sign in to comment.