|
| 1 | +# Contributing guide |
| 2 | + |
| 3 | +Contributions are more than welcome! |
| 4 | + |
| 5 | +This document assumes that you already know how to use GitHub and Git. |
| 6 | +If that's not the case, we recommend [learning about it first here](https://docs.github.com/en/get-started/quickstart/hello-world). |
| 7 | + |
| 8 | +## Strict No LLM / No AI Policy |
| 9 | + |
| 10 | +No LLMs for issues. |
| 11 | + |
| 12 | +No LLMs for pull requests. |
| 13 | + |
| 14 | +No LLMs for comments on issues/PRs, including translation. |
| 15 | +English is encouraged, but not required. |
| 16 | +You are welcome to post in your native language and rely on others |
| 17 | +to have their own translation tools of choice to interpret your words. |
| 18 | + |
| 19 | +## First-time contributors |
| 20 | + |
| 21 | +I label issues that I think should be easy for first-time contributors |
| 22 | +with [`good-first-issue`](https://github.com/mrcjkb/telescope-manix/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22good%20first%20issue%22). |
| 23 | + |
| 24 | +## Commit messages |
| 25 | + |
| 26 | +This project uses [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). |
| 27 | + |
| 28 | +## Development |
| 29 | + |
| 30 | +I use |
| 31 | + |
| 32 | +- [`nix`](https://nixos.org/download.html#download-nix) for development and testing. |
| 33 | +- [`stylua`](https://github.com/JohnnyMorganz/StyLua), |
| 34 | + [`.editorconfig`](https://editorconfig.org/), |
| 35 | + and [`alejandra`](https://github.com/kamadorueda/alejandra) |
| 36 | + for formatting. |
| 37 | +- [`luacheck`](https://github.com/mpeterv/luacheck), |
| 38 | + and [`markdownlint`](https://github.com/DavidAnson/markdownlint), |
| 39 | + for linting. |
| 40 | +- [`lua-language-server`](https://github.com/sumneko/lua-language-server/wiki/Diagnosis-Report#create-a-report) |
| 41 | + for static type checking. |
| 42 | + |
| 43 | +### Type safety |
| 44 | + |
| 45 | +Lua is incredibly responsive, giving immediate feedback for configuration. |
| 46 | +But its dynamic typing makes Neovim plugins susceptible to unexpected bugs |
| 47 | +at the wrong time. |
| 48 | +To mitigate this, I rely on [LuaCATS annotations](https://luals.github.io/wiki/annotations/), |
| 49 | +which are checked in CI. |
| 50 | + |
| 51 | +### Development using Nix |
| 52 | + |
| 53 | +To enter a development shell: |
| 54 | + |
| 55 | +```console |
| 56 | +nix-shell |
| 57 | +``` |
| 58 | + |
| 59 | +or (with flakes enabled) |
| 60 | + |
| 61 | +```console |
| 62 | +nix develop |
| 63 | +``` |
| 64 | + |
| 65 | +To apply formatting, while in a devShell, run |
| 66 | + |
| 67 | +```console |
| 68 | +pre-commit run --all |
| 69 | +``` |
| 70 | + |
| 71 | +If you use [`direnv`](https://direnv.net/), |
| 72 | +just run `direnv allow` and you will be dropped in this devShell. |
| 73 | + |
| 74 | +For formatting and linting: |
| 75 | + |
| 76 | +```console |
| 77 | +nix-build -A pre-commit-check |
| 78 | +``` |
| 79 | + |
| 80 | +Or (with flakes enabled) |
| 81 | + |
| 82 | +```console |
| 83 | +nix build .#checks.<your-system>.formatting --print-build-logs |
| 84 | +``` |
| 85 | + |
| 86 | +If you have flakes enabled and just want to run all checks that are available, run: |
| 87 | + |
| 88 | +```console |
| 89 | +nix flake check --print-build-logs |
| 90 | +``` |
0 commit comments