1e73685ebSopenharmony_ci# Contributing
2e73685ebSopenharmony_ci
3e73685ebSopenharmony_ci## Contents
4e73685ebSopenharmony_ci
5e73685ebSopenharmony_ci- [Introduction](#introduction)
6e73685ebSopenharmony_ci- [Code of Conduct](#code-of-conduct)
7e73685ebSopenharmony_ci- [Matrix Room](#matrix-room)
8e73685ebSopenharmony_ci- [Reporting Bugs and Suggesting Improvements](#reporting-bugs-and-suggesting-improvements)
9e73685ebSopenharmony_ci- [Contribution Workflow](#contribution-workflow)
10e73685ebSopenharmony_ci- [Quality Standards](#quality-standards)
11e73685ebSopenharmony_ci- [Release Process](#release-process)
12e73685ebSopenharmony_ci
13e73685ebSopenharmony_ci## Introduction
14e73685ebSopenharmony_ci
15e73685ebSopenharmony_ciHello, and welcome to the contributing guide for Codespan!
16e73685ebSopenharmony_ci
17e73685ebSopenharmony_ciCodespan is mostly maintained in the spare time of contributors,
18e73685ebSopenharmony_ciso immediate reactions are not to be expected!
19e73685ebSopenharmony_ciBy following this guide you'll make it easier for us to address your issues or incorporate your contributions.
20e73685ebSopenharmony_ci
21e73685ebSopenharmony_ciWe look forward to working with you!
22e73685ebSopenharmony_ci
23e73685ebSopenharmony_ci## Code of Conduct
24e73685ebSopenharmony_ci
25e73685ebSopenharmony_ciPlease note that this project is released with a [Code of Conduct](./CODE_OF_CONDUCT.md).
26e73685ebSopenharmony_ciBy participating in this project you agree to abide by its terms.
27e73685ebSopenharmony_ci
28e73685ebSopenharmony_ci## Matrix Room
29e73685ebSopenharmony_ci
30e73685ebSopenharmony_ciJoining the matrix room at [#codespan:matrix.org][codespan-matrix] is a good way to get in touch with the developers and community.
31e73685ebSopenharmony_ci
32e73685ebSopenharmony_ci[codespan-matrix]: https://app.element.io/#/room/#codespan:matrix.org
33e73685ebSopenharmony_ci
34e73685ebSopenharmony_ci## Reporting Bugs and Suggesting Improvements
35e73685ebSopenharmony_ci
36e73685ebSopenharmony_ciBugs (unwanted behaviour) and suggested improvements are tracked as [GitHub issues][github-issues].
37e73685ebSopenharmony_ciBefore reporting an issue, please check the following points:
38e73685ebSopenharmony_ci
39e73685ebSopenharmony_ci1. The issue is caused by `codespan-reporting` itself and not by how it is used.
40e73685ebSopenharmony_ci  Have a look at the documentation if you are not sure.
41e73685ebSopenharmony_ci  If the documentation is not helpful, you can contact the developers at the above matrix chat address or make an issue.
42e73685ebSopenharmony_ci1. Your issue has not already been reported by someone else.
43e73685ebSopenharmony_ci  Please look through the open issues in the [issue tracker][github-issues].
44e73685ebSopenharmony_ci
45e73685ebSopenharmony_ciWhen reporting an issue, please add as much relevant information as possible.
46e73685ebSopenharmony_ciThis will help developers and maintainers to resolve your issue. Some things you might consider:
47e73685ebSopenharmony_ci
48e73685ebSopenharmony_ci* Use a descriptive title.
49e73685ebSopenharmony_ci* Describe how a problem can be reproduced. Ideally give a minimal example.
50e73685ebSopenharmony_ci* Explain what exactly is the problem and what you expect instead. If it is related to rendering, add screenshots or other illustrations.
51e73685ebSopenharmony_ci
52e73685ebSopenharmony_ci[github-issues]: https://github.com/brendanzab/codespan/issues
53e73685ebSopenharmony_ci
54e73685ebSopenharmony_ci## Contribution Workflow
55e73685ebSopenharmony_ci
56e73685ebSopenharmony_ciFollow these steps to contribute to the project:
57e73685ebSopenharmony_ci
58e73685ebSopenharmony_ci1. Make a fork of the [codespan repository][codespan-repo].
59e73685ebSopenharmony_ci1. Within your fork, create a branch for your contribution. Use a meaningful name.
60e73685ebSopenharmony_ci1. Create your contribution, meeting all [contribution quality standards](#quality-standards).
61e73685ebSopenharmony_ci1. Ensure all the tests pass (`cargo test`).
62e73685ebSopenharmony_ci1. [Create a pull request][create-a-pr] against the `master` branch of the repository.
63e73685ebSopenharmony_ci1. Once the pull request is reviewed and CI passes, it will be merged.
64e73685ebSopenharmony_ci
65e73685ebSopenharmony_ci[codespan-repo]: https://github.com/brendanzab/codespan
66e73685ebSopenharmony_ci[create-a-pr]: https://help.github.com/articles/creating-a-pull-request-from-a-fork/
67e73685ebSopenharmony_ci
68e73685ebSopenharmony_ci## Quality Standards
69e73685ebSopenharmony_ci
70e73685ebSopenharmony_ciMost quality and style standards are checked automatically by the CI build.
71e73685ebSopenharmony_ciContributions should:
72e73685ebSopenharmony_ci
73e73685ebSopenharmony_ci- Separate each **logical change** into its own commit.
74e73685ebSopenharmony_ci- Include tests for any new functionality and fixed issues in your pull request.
75e73685ebSopenharmony_ci- Update the changelogs with any added, removed, changed, or fixed functionality.
76e73685ebSopenharmony_ci- Document public functions.
77e73685ebSopenharmony_ci- Format code with `cargo fmt`.
78e73685ebSopenharmony_ci- Avoid adding `unsafe` code.
79e73685ebSopenharmony_ci  If it is necessary, provide an explanatory comment on any `unsafe` block explaining its rationale and why it's safe.
80e73685ebSopenharmony_ci- Add a descriptive message for each commit.
81e73685ebSopenharmony_ci  Follow [these commit message guidelines][commit-messages].
82e73685ebSopenharmony_ci- Document your pull requests.
83e73685ebSopenharmony_ci  Include the reasoning behind each change, and the testing done.
84e73685ebSopenharmony_ci
85e73685ebSopenharmony_ci[commit-messages]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
86e73685ebSopenharmony_ci
87e73685ebSopenharmony_ci## Release Process
88e73685ebSopenharmony_ci
89e73685ebSopenharmony_ci1. Bump the version numbers of each crate appropriately.
90e73685ebSopenharmony_ci1. Update the changelogs with the new version ranges.
91e73685ebSopenharmony_ci1. Create a new PR for the release, and if it passes CI merge it.
92e73685ebSopenharmony_ci1. Create a new tag for the release, pointing to the merge commit.
93e73685ebSopenharmony_ci1. Run the following commands in order from the root of the repository.
94e73685ebSopenharmony_ci    Note that doing this too quickly may result in an error,
95e73685ebSopenharmony_ci    due to a server-side delay in crate publishing:
96e73685ebSopenharmony_ci    ```
97e73685ebSopenharmony_ci    cd codespan-reporting && cargo publish; cd ..
98e73685ebSopenharmony_ci    cd codespan && cargo publish; cd ..
99e73685ebSopenharmony_ci    cd codespan-lsp && cargo publish; cd ..
100e73685ebSopenharmony_ci    ```
101