|
| 1 | +# Contribute to `scaleway-cli` |
| 2 | + |
| 3 | +`scaleway-cli` is Apache 2.0 licensed and accepts contributions via GitHub. |
| 4 | +This document will cover how to contribute to the project and report issues. |
| 5 | + |
| 6 | +<p align="center"><img width="50%" src="../docs/static_files/cli-artwork.png" /></p> |
| 7 | + |
| 8 | +## Topics |
| 9 | + |
| 10 | +- [Reporting Security Issues](#reporting-security-issues) |
| 11 | +- [Reporting Issues](#reporting-issues) |
| 12 | +- [Suggesting feature](#suggesting-feature) |
| 13 | +- [Contributing Code](#contributing-code) |
| 14 | +- [Community Guidelines](#community-guidelines) |
| 15 | + |
| 16 | +## Reporting security issues |
| 17 | + |
| 18 | +Please refer to our [security policy](../SECURITY.md). |
| 19 | + |
| 20 | +## Reporting issues |
| 21 | + |
| 22 | +A great way to contribute to the project is to send a detailed report when you encounter a bug. |
| 23 | +We always appreciate a well-written, thorough bug report, and will thank you for it! |
| 24 | +Before opening a new issue, we appreciate you reviewing open issues to see if there are any similar requests. |
| 25 | +If there is a match, thumbs up the issue with a 👍 and leave a comment if you have additional information. |
| 26 | + |
| 27 | +When reporting an issue, please include information displayed by the `scw version` command. |
| 28 | + |
| 29 | +## Suggesting a feature |
| 30 | + |
| 31 | +When requesting a feature, some of the questions we want to answer are: |
| 32 | + |
| 33 | +- What value does this feature bring to end users? |
| 34 | +- How urgent is the need (nice to have feature or need to have)? |
| 35 | +- Does this align with the goals of `scaleway-cli`? |
| 36 | + |
| 37 | +## Contributing code |
| 38 | + |
| 39 | +Before contributing to the code, make sure you have read about the [continuous code deployment](docs/CONTINUOUS_CODE_DEPLOYMENT.md) process we are using on this repo. |
| 40 | + |
| 41 | +### Submit code |
| 42 | + |
| 43 | +To submit code: |
| 44 | + |
| 45 | +- Create a fork of the project |
| 46 | +- Create a topic branch from where you want to base your work (usually master) |
| 47 | +- Add tests to cover contributed code |
| 48 | +- Push your commit(s) to your topic branch on your fork |
| 49 | +- Open a pull request against `scaleway-cli` `master` branch that follows [PR guidelines](#pull-request-guidelines) |
| 50 | + |
| 51 | +The [maintainers](MAINTAINERS.md) of `scaleway-cli` use a "Let's Get This Merged" (LGTM) message in the pull request to note that the commits are ready to merge. |
| 52 | +After one or more maintainer states LGTM, we will merge. |
| 53 | +If you have questions or comments on your code, feel free to correct these in your branch through new commits. |
| 54 | + |
| 55 | +### Pull Request Guidelines |
| 56 | + |
| 57 | +The goal of the following guidelines is to have Pull Requests (PRs) that are fairly easy to review and comprehend, and code that is easy to maintain in the future. |
| 58 | + |
| 59 | +- **Pull Request title should respect [conventional commits](https://www.conventionalcommits.org/en/v1.0.0) specifications** and be clear on what is being changed. |
| 60 | + The scope is the namespace on which the changes are made or `core` for changes which concern the whole CLI. Examples: |
| 61 | + - A fix for `scw init` will be titled `fix(init): ...` |
| 62 | + - A fix for the argument parser will be titled `fix(core): ...` |
| 63 | + - A new instance feature (in `scw instance ...`) will be title `feat(instance): ...` |
| 64 | +- **Keep it readable for human reviewers** and prefer a subset of functionality (code) with tests and documentation over delivering them separately |
| 65 | +- **Don't forget commenting code** to help reviewers understand and to keep [our Go Report Card](https://goreportcard.com/report/github.com/scaleway/scaleway-sdk-go) at A+ |
| 66 | +- **Notify Work In Progress PRs** by prefixing the title with `[WIP]` |
| 67 | +- **Please, keep us updated.** |
| 68 | + We will try our best to merge your PR, but please notice that PRs may be closed after 30 days of inactivity. |
| 69 | + |
| 70 | +Your pull request should be rebased against the `master` branch. |
| 71 | + |
| 72 | +Keep in mind only the **pull request title** will be used as commit message as we stash all commits on merge. |
| 73 | + |
| 74 | +## Community guidelines |
| 75 | + |
| 76 | +See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). |
| 77 | + |
| 78 | +Thank you for reading through all of this, if you have any question feel free to [reach us](README.md#reach-us)! |
| 79 | + |
| 80 | +## Developer documentation |
| 81 | + |
| 82 | +### When to use dash vs underscore |
| 83 | + |
| 84 | +We SHOULD use dash `"-"` for: |
| 85 | +- command namespaces, resource, verb |
| 86 | +- argument names |
| 87 | +- key names in the human formatted results |
| 88 | +- UUID |
| 89 | + |
| 90 | +We SHOULD use underscore `"_"` for: |
| 91 | +- response value results, except UUID |
| 92 | +- argument values |
| 93 | + |
| 94 | +Example: |
| 95 | +```bash |
| 96 | +> scw my-namespace my-resource get id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| 97 | +id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| 98 | +some-key some_value |
| 99 | +other-key other_value |
| 100 | +``` |
| 101 | + |
| 102 | +### Commands validation |
| 103 | + |
| 104 | +Some validation is done internally on Scaleway's side: see [scaleway-sdk-go/docs/CONTINUOUS_CODE_DEPLOYMENT.md](https://github.com/scaleway/scaleway-sdk-go/blob/master/docs/CONTINUOUS_CODE_DEPLOYMENT.md) |
| 105 | +This is true for: |
| 106 | +- command namespaces, resource, verb |
| 107 | + |
| 108 | +The rest is manually checked for now. |
0 commit comments