Add more docs for contributing (#9)

* Make the pre-commit hook use the stylua binary installed on the system
* Add docs for contributing
This commit is contained in:
Marc 2023-04-08 13:01:19 +03:00 committed by GitHub
parent 7a098964c6
commit 4b96ddcfbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 2 deletions

View File

@ -2,4 +2,4 @@ repos:
- repo: https://github.com/JohnnyMorganz/StyLua
rev: v0.17.1
hooks:
- id: stylua-github
- id: stylua-system

View File

@ -164,6 +164,27 @@ A customizable Neovim plugin to run code inside the editor
## Contribution
If you find that some handlers for a specific language are missing, feel free to open a pull request by adding them in the [lua/runner/handlers/init.lua](lua/runner/handlers/init.lua) file.
This project uses [StyLua](https://github.com/JohnnyMorganz/StyLua) for enforcing code style, and has a [pre-commit](https://pre-commit.com/) hook setup for running it automatically. `runner.nvim` also has a Github Action that runs the linter on every Pull request. If a check doesn't pass on a specific Pull request, please lint the code and commit it again.
For running them locally, you have to have them installed on your system:
- [StyLua Installation](https://github.com/JohnnyMorganz/StyLua#installation)
- [pre-commit Installation](https://pre-commit.com/#install)
#### Some useful commands:
- Install the pre-commit hook
```bash
pre-commit install
```
- Check for StyLua errors
```bash
stylua --check lua/
```
- Fix StyLua errors
```bash
stylua lua/
```
Licensed under the [MIT license](./LICENSE).