2021-11-17 17:30:11 +04:00
# Contributing
Contributors are very welcome! **No contribution is too small and all contributions are valued.**
Some suggestions to get started:
- You can look at the [good first issue][good-first-issue] label on the issue tracker.
- Help with packaging on various distributions needed!
- To use print debugging to the [Helix log file][log-file], you must:
* Print using `log::info!` , `warn!` , or `error!` . (`log::info!("helix!")`)
2023-02-19 22:52:12 +04:00
* Pass the appropriate verbosity level option for the desired log level. (`hx -v < file > ` for info, more `v` s for higher verbosity)
* Want to display the logs in a separate file instead of using the `:log-open` command in your compiled Helix editor? Start your debug version with `cargo run -- --log foo.log` and in a new terminal use `tail -f foo.log`
- Instead of running a release version of Helix, while developing you may want to run in debug mode with `cargo run` which is way faster to compile
- Looking for even faster compile times? Give a try to [mold ](https://github.com/rui314/mold )
2021-11-17 17:30:11 +04:00
- If your preferred language is missing, integrating a tree-sitter grammar for
it and defining syntax highlight queries for it is straight forward and
doesn't require much knowledge of the internals.
We provide an [architecture.md][architecture.md] that should give you
a good overview of the internals.
# Auto generated documentation
Some parts of [the book][docs] are autogenerated from the code itself,
like the list of `:commands` and supported languages. To generate these
files, run
```shell
2021-11-21 22:55:08 +04:00
cargo xtask docgen
2021-11-17 17:30:11 +04:00
```
2023-09-13 18:37:39 +04:00
inside the project. We use [xtask][xtask] as an ad-hoc task runner.
To preview the book itself, install [mdbook][mdbook]. Then, run
```shell
mdbook serve book
```
and visit [http://localhost:3000 ](http://localhost:3000 ).
2021-11-17 17:30:11 +04:00
2023-03-11 18:03:19 +04:00
# Testing
## Unit tests/Documentation tests
Run `cargo test --workspace` to run unit tests and documentation tests in all packages.
## Integration tests
2022-06-05 00:08:34 +04:00
Integration tests for helix-term can be run with `cargo integration-test` . Code
contributors are strongly encouraged to write integration tests for their code.
Existing tests can be used as examples. Helpers can be found in
2022-08-29 07:23:00 +04:00
[helpers.rs][helpers.rs]. The log level can be set with the `HELIX_LOG_LEVEL`
environment variable, e.g. `HELIX_LOG_LEVEL=debug cargo integration-test` .
2022-08-11 17:57:17 +04:00
2024-07-28 20:40:50 +04:00
Contributors using MacOS might encounter `Too many open files (os error 24)`
failures while running integration tests. This can be resolved by increasing
the default value (e.g. to `10240` from `256` ) by running `ulimit -n 10240` .
2022-09-23 10:58:00 +04:00
## Minimum Stable Rust Version (MSRV) Policy
2024-12-03 19:01:52 +04:00
Helix keeps an intentionally low MSRV for the sake of easy building and packaging
downstream. We follow [Firefox's MSRV policy]. Once Firefox's MSRV increases we
may bump ours as well, but be sure to check that popular distributions like Ubuntu
package the new MSRV version. When increasing the MSRV, update these three places:
2022-09-23 10:58:00 +04:00
2024-12-03 19:01:52 +04:00
* the `workspace.package.rust-version` key in `Cargo.toml` in the repository root
* the `env.MSRV` key at the top of `.github/workflows/build.yml`
* the `toolchain.channel` key in `rust-toolchain.toml`
[Firefox's MSRV policy]: https://firefox-source-docs.mozilla.org/writing-rust-code/update-policy.html
2022-08-11 17:57:17 +04:00
[good-first-issue]: https://github.com/helix-editor/helix/labels/E-easy
[log-file]: https://github.com/helix-editor/helix/wiki/FAQ#access-the-log-file
[architecture.md]: ./architecture.md
[docs]: https://docs.helix-editor.com/
[xtask]: https://github.com/matklad/cargo-xtask
2023-09-13 18:37:39 +04:00
[mdbook]: https://rust-lang.github.io/mdBook/guide/installation.html
2022-08-11 17:57:17 +04:00
[helpers.rs]: ../helix-term/tests/test/helpers.rs