|
| 1 | +Contributing to go-yaml |
| 2 | +======================= |
| 3 | + |
| 4 | +Thank you for your interest in contributing to go-yaml! |
| 5 | + |
| 6 | +This document provides guidelines and instructions for contributing to this |
| 7 | +project. |
| 8 | + |
| 9 | + |
| 10 | +## Code of Conduct |
| 11 | + |
| 12 | +By participating in this project, you agree to follow our Code of Conduct. |
| 13 | + |
| 14 | +We expect all contributors to: |
| 15 | +- Be respectful and inclusive |
| 16 | +- Use welcoming and inclusive language |
| 17 | +- Be collaborative and constructive |
| 18 | +- Focus on what is best for both the Go and YAML communities |
| 19 | + |
| 20 | + |
| 21 | +## How to Contribute |
| 22 | + |
| 23 | + |
| 24 | +### Reporting Issues |
| 25 | + |
| 26 | +Before submitting an issue, please: |
| 27 | +- Check if the issue already exists in our issue tracker |
| 28 | +- Use a clear and descriptive title |
| 29 | +- Provide detailed steps to reproduce the issue |
| 30 | +- Include relevant code samples and error messages |
| 31 | +- Specify your Go version and operating system |
| 32 | + |
| 33 | + |
| 34 | +### Pull Requests |
| 35 | + |
| 36 | +1. Fork the repository |
| 37 | +1. Create a new branch for your changes |
| 38 | +1. Make your changes following our coding conventions |
| 39 | + - If you are not sure about the coding conventions, please ask |
| 40 | + - Look at the existing code for examples |
| 41 | +1. Write clear commit messages |
| 42 | +1. Update tests and documentation |
| 43 | +1. Submit a pull request |
| 44 | + |
| 45 | + |
| 46 | +### Coding Conventions |
| 47 | + |
| 48 | +- Follow standard Go coding conventions |
| 49 | +- Use `gofmt` to format your code |
| 50 | +- Write descriptive comments for non-obvious code |
| 51 | +- Add tests for your work |
| 52 | +- Keep line length to 80 characters |
| 53 | +- Use meaningful variable and function names |
| 54 | +- Start doc and comment sentences on a new line |
| 55 | + |
| 56 | + |
| 57 | +### Commit Conventions |
| 58 | + |
| 59 | +- No merge commits |
| 60 | +- Commit subject line should: |
| 61 | + - Start with a capital letter |
| 62 | + - Not end with a period |
| 63 | + - Be no more than 50 characters |
| 64 | + |
| 65 | + |
| 66 | +### Testing |
| 67 | + |
| 68 | +- Run `make review` before submitting changes |
| 69 | +- Ensure all tests pass |
| 70 | +- Add new tests for new functionality |
| 71 | +- Update existing tests when modifying functionality |
| 72 | + |
| 73 | + |
| 74 | +## Development Setup |
| 75 | + |
| 76 | +- Install Go (see [go.mod](https://github.com/yaml/go-yaml/blob/main/go.mod) for |
| 77 | + minimum required version) |
| 78 | +- Fork and clone the repository |
| 79 | +- Make your changes |
| 80 | +- Run tests and linters |
| 81 | + |
| 82 | + |
| 83 | +## Using the Makefile |
| 84 | + |
| 85 | +The repository contains a `GNUmakefile` that provides a number of useful |
| 86 | +targets: |
| 87 | + |
| 88 | +- `make review` runs the tests and linters |
| 89 | +- `make test` runs the tests |
| 90 | +- `make test v=1 count=3` runs the tests with options |
| 91 | +- `make test GO-VERSION=1.23.4` runs the tests with a specific Go version |
| 92 | +- `make shell` opens a shell with the project's dependencies set up |
| 93 | +- `make shell GO-VERSION=1.23.4` opens a shell with a specific Go version |
| 94 | +- `make fmt` runs `go fmt` |
| 95 | +- `make tidy` runs `go mod tidy` |
| 96 | +- `make install` runs `go install` |
| 97 | +- `make distclean` cleans the project completely |
| 98 | + |
| 99 | + |
| 100 | +## Getting Help |
| 101 | + |
| 102 | +If you need help, you can: |
| 103 | +- Open an issue with your question |
| 104 | +- Read through our documentation |
| 105 | +- Join our [Slack channel](https://cloud-native.slack.com/archives/C08PPAT8PS7) |
| 106 | + |
| 107 | + |
| 108 | +## We are a Work in Progress |
| 109 | + |
| 110 | +This project is very much a team effort. |
| 111 | +We are just getting things rolling and trying to get the foundations in place. |
| 112 | +There are lots of opinions and ideas about how to do things, even within the |
| 113 | +core team. |
| 114 | + |
| 115 | +Once our process is more mature, we will likely change the rules here. |
| 116 | +We'll make the new rules as a team. |
| 117 | +For now, please stick to the rules as they are. |
| 118 | + |
| 119 | +This project is focused on serving the needs of both the Go and YAML |
| 120 | +communities. |
| 121 | +Sometimes those needs can be in conflict, but we'll try to find common ground. |
| 122 | + |
| 123 | + |
| 124 | +## Thank You |
| 125 | + |
| 126 | +Thank you for contributing to go-yaml! |
0 commit comments