2020-10-28 04:39:54 +00:00
|
|
|
# Contributing
|
2020-10-28 04:35:35 +00:00
|
|
|
|
2020-10-29 18:46:36 +00:00
|
|
|
Thank you for considering to contribute to `bat`!
|
2020-10-28 04:35:35 +00:00
|
|
|
|
|
|
|
|
2020-10-29 18:46:36 +00:00
|
|
|
|
|
|
|
## Add an entry to the changelog
|
|
|
|
|
|
|
|
If your contribution changes the behavior of `bat` (as opposed to a typo-fix
|
|
|
|
in the documentation), please update the [`CHANGELOG.md`](CHANGELOG.md) file
|
2020-12-01 18:38:14 +00:00
|
|
|
and describe your changes. This makes the release process much easier and
|
2020-10-29 18:46:36 +00:00
|
|
|
therefore helps to get your changes into a new `bat` release faster.
|
|
|
|
|
|
|
|
The top of the `CHANGELOG` contains a *"unreleased"* section with a few
|
|
|
|
subsections (Features, Bugfixes, …). Please add your entry to the subsection
|
2020-12-01 18:38:14 +00:00
|
|
|
that best describes your change.
|
2020-10-29 18:46:36 +00:00
|
|
|
|
|
|
|
Entries follow this format:
|
2020-10-28 04:39:54 +00:00
|
|
|
```
|
2020-10-28 04:35:35 +00:00
|
|
|
- Short description of what has been changed, see #123 (@user)
|
2020-10-28 04:39:54 +00:00
|
|
|
```
|
2020-10-29 18:46:36 +00:00
|
|
|
Here, `#123` is the number of the original issue and/or your pull request.
|
|
|
|
Please replace `@user` by your GitHub username.
|
2020-10-29 18:51:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Development
|
|
|
|
|
|
|
|
Please check out the [Development](https://github.com/sharkdp/bat#development)
|
|
|
|
section in the README.
|
|
|
|
|
|
|
|
|
2020-10-29 18:52:55 +00:00
|
|
|
## Adding a new feature
|
|
|
|
|
|
|
|
Please consider opening a
|
|
|
|
[feature request ticket](https://github.com/sharkdp/bat/issues/new?assignees=&labels=feature-request&template=feature_request.md)
|
2022-10-09 08:18:35 +00:00
|
|
|
first in order to give us a chance to discuss the details and specifics of the potential new feature before you go and build it.
|
2020-10-29 18:52:55 +00:00
|
|
|
|
|
|
|
|
2020-10-29 18:51:16 +00:00
|
|
|
## Adding new syntaxes/languages or themes
|
|
|
|
|
|
|
|
Before you make a pull request that adds a new syntax or theme, please read
|
|
|
|
the [Customization](https://github.com/sharkdp/bat#customization) section
|
|
|
|
in the README first.
|
|
|
|
|
|
|
|
If you really think that a particular syntax or theme should be added for all
|
|
|
|
users, please read the corresponding
|
|
|
|
[documentation](https://github.com/sharkdp/bat/blob/master/doc/assets.md)
|
|
|
|
first.
|
2022-02-26 16:03:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Regression tests
|
|
|
|
|
2022-10-09 08:18:35 +00:00
|
|
|
You are **strongly encouraged** to add regression tests. Regression tests are great,
|
2022-02-26 16:03:54 +00:00
|
|
|
not least because they:
|
|
|
|
|
2022-10-09 22:44:45 +00:00
|
|
|
* ensure that your contribution will never completely stop working.
|
2022-02-26 16:03:54 +00:00
|
|
|
|
2022-10-09 22:44:45 +00:00
|
|
|
* makes code reviews easier, because it becomes very clear what the code is
|
2022-02-26 16:03:54 +00:00
|
|
|
supposed to do.
|
|
|
|
|
|
|
|
For functional changes, you most likely want to add a test to
|
|
|
|
[`tests/integration_tests.rs`](https://github.com/sharkdp/bat/blob/master/tests/integration_tests.rs).
|
|
|
|
Look at existing tests to know how to write a new test. In short, you will
|
|
|
|
invoke the `bat` binary with a certain set of arguments, and then assert on
|
|
|
|
stdout/stderr.
|
|
|
|
|
|
|
|
To learn how to write regression tests for theme and syntax changes, read the
|
|
|
|
[Syntax
|
|
|
|
tests](https://github.com/sharkdp/bat/blob/master/doc/assets.md#syntax-tests)
|
|
|
|
section in `assets.md`.
|