on master help sign in
bat/CONTRIBUTING.md
70 lines 2.4 kB history raw
1# Contributing
3Thank you for considering to contribute to `bat`!
7## Add an entry to the changelog
9If your contribution changes the behavior of `bat` (as opposed to a typo-fix
10in the documentation), please update the [`CHANGELOG.md`](CHANGELOG.md) file
11and describe your changes. This makes the release process much easier and
12therefore helps to get your changes into a new `bat` release faster.
14The top of the `CHANGELOG` contains a *"unreleased"* section with a few
15subsections (Features, Bugfixes, …). Please add your entry to the subsection
16that best describes your change.
18Entries follow this format:
19```
20- Short description of what has been changed, see #123 (@user)
21```
22Here, `#123` is the number of the original issue and/or your pull request.
23Please replace `@user` by your GitHub username.
26## Development
28Please check out the [Development](https://github.com/sharkdp/bat#development)
29section in the README.
32## Adding a new feature
34Please consider opening a
35[feature request ticket](https://github.com/sharkdp/bat/issues/new?assignees=&labels=feature-request&template=feature_request.md)
36first in order to give us a chance to discuss the feature first.
39## Adding new syntaxes/languages or themes
41Before you make a pull request that adds a new syntax or theme, please read
42the [Customization](https://github.com/sharkdp/bat#customization) section
43in the README first.
45If you really think that a particular syntax or theme should be added for all
46users, please read the corresponding
47[documentation](https://github.com/sharkdp/bat/blob/master/doc/assets.md)
48first.
51## Regression tests
53You are strongly encouraged to add regression tests. Regression tests are great,
54not least because they:
56* ensure that your contribution will never completely stop working,
58* makes code review easier, because it becomes very clear what the code is
59 supposed to do.
61For functional changes, you most likely want to add a test to
62[`tests/integration_tests.rs`](https://github.com/sharkdp/bat/blob/master/tests/integration_tests.rs).
63Look at existing tests to know how to write a new test. In short, you will
64invoke the `bat` binary with a certain set of arguments, and then assert on
65stdout/stderr.
67To learn how to write regression tests for theme and syntax changes, read the
68[Syntax
69tests](https://github.com/sharkdp/bat/blob/master/doc/assets.md#syntax-tests)
70section in `assets.md`.