# Contributing

Source: https://docs.lightair.app/developers/core/contributing

> How to report a problem or send a change to lightair-core or the Lightair desktop app, what a good change looks like, and the contributor licence agreement.

In short:
- Issues, ideas and bug reports are welcome on both public repositories.
- Code contributions are merged only from people who've agreed to the Lightair Contributor Licence Agreement, which is still a draft. Until it's final, outside contributions aren't merged.
- Under the agreement you keep your copyright and let the copyright holder license your work under the GPL and other terms.

Lightair's public repositories are [Lightair-Project/lightair-core](https://github.com/Lightair-Project/lightair-core)
(the shared crates) and [Lightair-Project/lightair](https://github.com/Lightair-Project/lightair)
(the desktop app). Both are [dual-licensed](/developers/core/licensing), so contributions work a
little differently from a plain GPL project.

## Report a problem

Open an issue on the repository it concerns. Say what you did, what you expected and what
happened instead.

For a security problem, open an issue asking for a private contact, without any details.

## The contributor licence agreement

A contribution can be merged only after its author has agreed to the Lightair Contributor Licence
Agreement. One agreement covers both repositories; its text is lightair-core's
[`docs/CLA.md`](https://github.com/Lightair-Project/lightair-core/blob/main/docs/CLA.md).

:::note
The agreement is a draft and isn't in force yet. Until it's published in its final form, outside
contributions aren't being merged. Issues, ideas and bug reports are welcome now.
:::

In short, as the draft stands:

- **You keep the copyright** in your contributions. The agreement gives a licence; it doesn't
  transfer ownership.
- **You grant a copyright licence** to the copyright holder, and to anyone who receives the
  projects from them: perpetual, worldwide, non-exclusive, royalty-free and irrevocable, to use,
  change, publish, distribute and sublicense your contributions under any terms, including the
  GPL and commercial licences.
- **You grant a patent licence** for any patent you own or control that covers your
  contribution, so it can be made, used, sold and distributed as part of the projects and work
  built on them.
- **You confirm** that the work is your own (or you have the right to submit it), that your
  employer or anyone else with rights in it has agreed or waived them, and that you've named any
  third-party material in it, with its source and licence.
- **Nothing obliges** the copyright holder to use your contribution. What goes in stays available
  to everyone under the GPL.

How you sign will be set when the agreement is final.

The agreement exists because the copyright holder licenses the code on two sets of terms: without
it, a contribution couldn't be used in all of Lightair's products, so it can't be merged.

## What a good change looks like

- One idea per change, with a commit message that says what changes and why.
- `cargo xtask check` passes: it runs clippy and every test. In lightair-core, the change comes
  with tests for what it changes.
- Only the files the change needs, and formatting changes only in the files it touches.
- No code copied from elsewhere. If a file comes from another project, say where from and under
  which licence, and expect to be asked whether it can be used on both sets of terms. Permissive
  licences such as MIT and Apache-2.0 can be; GPL code by others can't.
- In lightair-core, the desktop app keeps building and its tests keep passing, since it's built on
  these crates.

## Related

- [Licensing](/developers/core/licensing)
- [Crates](/developers/core/crates)
