|
| 1 | +# Contributing |
| 2 | + |
| 3 | +First off, let me thank you for considering contributing to this project! |
| 4 | +Your help is greatly appreciated. |
| 5 | + |
| 6 | +> ℹ️ Don't know how to contribute? Feel free to open an issue, |
| 7 | +> and I can guide you through the process. |
| 8 | +
|
| 9 | +## How to Contribute |
| 10 | + |
| 11 | +This project is built with [Bashly](https://bashly.dev/), a tool for building |
| 12 | +Bash CLI applications. Refer to the Bashly website to learn more about how |
| 13 | +the structure of a Bashly project works. |
| 14 | + |
| 15 | +### Contributing (to) default prompts and variables |
| 16 | + |
| 17 | +If you want to contribute new default prompts or variables, please follow these steps: |
| 18 | + |
| 19 | +1. Fork the repository and clone it to your local machine. |
| 20 | +2. Create a new branch for your changes. |
| 21 | +3. If you want to add change the default prompt or change the variables of an existing |
| 22 | + commit standard, say `conventional-commits`: |
| 23 | + 1. Navigate to the `defaults/prompts/conventional-commits/` |
| 24 | + directory. |
| 25 | + 2. Then alter the prompt or variables file in |
| 26 | + `defaults/prompts/conventional-commits/default.md` and `defaults/prompts/conventional-commits/default-vars.yaml` |
| 27 | + |
| 28 | + If you want to add a new variation of an existing commit standard, say |
| 29 | + `conventional-commits` with a variation called `my-variation`: |
| 30 | + 1. Navigate to the `defaults/prompts/conventional-commits/` |
| 31 | + directory. |
| 32 | + 2. Create new prompt and variable files named |
| 33 | + `my-variation.md` and `my-variation-vars.yaml` respectively. |
| 34 | + 3. Populate these files with the appropriate content for your new variation. |
| 35 | + |
| 36 | + If you want to add a completely new commit standard: |
| 37 | + 1. Create a new directory under `defaults/prompts/` with the name of your |
| 38 | + new commit standard. e.g. `my-commit-standard` |
| 39 | + 2. Inside that directory, create two files: |
| 40 | + - `default.md`: This file should contain the default prompt in Markdown format. |
| 41 | + - `default-vars.yaml`: This file should contain the default variables |
| 42 | + in YAML format. |
| 43 | + 3. Populate these files with the appropriate content for your new commit standard. |
| 44 | + |
| 45 | +4. After making your changes, run the test suite to ensure everything is working |
| 46 | + correctly. (see the [Testing Your Changes](#testing-your-changes) section below) |
| 47 | +5. If you have added a new commit standard or variation: |
| 48 | + - create some tests for it. A good place would be the |
| 49 | + `spec/render_prompt_spec.sh` file. |
| 50 | + - consider updating the documentation to include information about your addition. |
| 51 | + |
| 52 | +### Generating a new release |
| 53 | + |
| 54 | +To generate a new release of `cfme`, run `bashly generate` to regenerate the |
| 55 | +`cfme` script with the latest changes, based on the changes in `src`. |
| 56 | + |
| 57 | +Then |
| 58 | + |
| 59 | +```bash |
| 60 | +rm release/cfme |
| 61 | +mv cfme release/cfme |
| 62 | +``` |
| 63 | + |
| 64 | +## Testing Your Changes |
| 65 | + |
| 66 | +Generate a new version of the `cfme` script by running: |
| 67 | + |
| 68 | +```bash |
| 69 | +bashly generate |
| 70 | +``` |
| 71 | + |
| 72 | +This script needs to be at the root of the directory for the tests to run correctly. |
| 73 | + |
| 74 | +`cfme` uses [Shellspec](https://shellspec.info/) for testing. To run the test suite, |
| 75 | +make sure you have Shellspec installed, then run, from the root of the repository: |
| 76 | + |
| 77 | +```bash |
| 78 | +shellspec --shell bash |
| 79 | +``` |
| 80 | + |
| 81 | +Refer to the Shellspec documentation for more details on writing and running tests. |
| 82 | + |
| 83 | +Getting stuck or need help writing tests? Feel free to open an issue. |
| 84 | +If you open up a PR without tests, please mention that clearly in the description. |
| 85 | + |
| 86 | +## Submitting Your Changes |
| 87 | + |
| 88 | +Once you are satisfied with your changes and have tested them, you can submit |
| 89 | +them for review: |
| 90 | + |
| 91 | +1. If you haven't already, open up an issue describing what you plan to change. |
| 92 | +2. Push your branch to your forked repository. |
| 93 | +3. Open a Pull Request (PR) against the `main` branch of this repository. |
| 94 | +4. Provide a clear description of the changes you have made and any relevant |
| 95 | + information for the reviewers. |
| 96 | +5. Mention the related issue number (e.g. `Closes #123`). |
| 97 | + |
| 98 | +Done! Your contribution will be reviewed, and if everything looks good, |
| 99 | +it will be merged into the main codebase. |
| 100 | +Thank you for helping to improve this project! |
0 commit comments