|
| 1 | +# Contributing to anybadge |
| 2 | +I love your input! I want to make contributing to this project as easy and transparent as possible, whether it's: |
| 3 | + |
| 4 | +- Reporting a bug |
| 5 | +- Discussing the current state of the code |
| 6 | +- Submitting a fix |
| 7 | +- Proposing new features |
| 8 | +- Becoming a maintainer |
| 9 | + |
| 10 | +## I use [Github Flow](https://docs.github.com/en/get-started/quickstart/github-flow), so all code changes happen through pull requests |
| 11 | +Pull requests are the best way to propose changes to the codebase (I use |
| 12 | +[Github Flow](https://docs.github.com/en/get-started/quickstart/github-flow)). I actively welcome your pull requests: |
| 13 | + |
| 14 | +1. Fork the repo and create your branch from `master` |
| 15 | +2. If you've added code that should be tested, add tests |
| 16 | +3. If you've changed APIs, update the documentation |
| 17 | +4. Ensure the test suite passes |
| 18 | +5. Make sure your code lints (tbc) |
| 19 | +6. Issue that pull request! |
| 20 | + |
| 21 | +## Any contributions you make will be under the MIT Software License |
| 22 | +When you submit code changes, your submissions are understood to be under the same |
| 23 | +[MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers |
| 24 | +if that's a concern. |
| 25 | + |
| 26 | +## Report bugs using Github's [issues](https://github.com/jongracecox/anybadge/issues) |
| 27 | +I use GitHub issues to track public bugs. Report a bug by |
| 28 | +[opening a new issue](https://github.com/jongracecox/anybadge/issues/new/choose). |
| 29 | + |
| 30 | +## Write bug reports with detail, background, and sample code |
| 31 | +**Great Bug Reports** tend to have: |
| 32 | + |
| 33 | +- A quick summary and/or background |
| 34 | +- Steps to reproduce |
| 35 | + - Be specific! |
| 36 | + - Give sample code if you can (ideally sample code that *anyone* with a basic setup can run to reproduce) |
| 37 | +- What you expected would happen - (include explanation, screenshot, drawings, etc. to be exact) |
| 38 | +- What actually happens |
| 39 | +- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work) |
| 40 | + |
| 41 | +People *love* thorough bug reports. |
| 42 | + |
| 43 | +## Use a Consistent Coding Style |
| 44 | +Please follow the existing coding style. |
| 45 | + |
| 46 | +## License |
| 47 | +By contributing, you agree that your contributions will be licensed under its MIT License. |
| 48 | + |
| 49 | +# Technical stuff |
| 50 | + |
| 51 | +## Documentation |
| 52 | +The `README.md` file contains a table showing example badges for the different built-in colors. If you modify the |
| 53 | +appearance of badges, or the available colors please update the table using the following code: |
| 54 | + |
| 55 | +```python |
| 56 | +import anybadge |
| 57 | +print("""| Color Name | Hex Code | Example | |
| 58 | +| ---------- | -------- | ------- |""") |
| 59 | +for color in sorted([c for c in anybadge.colors.Color], key=lambda x: x.name): |
| 60 | + file = 'examples/color_' + color.name.lower() + '.svg' |
| 61 | + url = 'https://cdn.rawgit.com/jongracecox/anybadge/master/' + file |
| 62 | + anybadge.Badge(label='Color', value=color, default_color=color.name.lower()).write_badge(file, overwrite=True) |
| 63 | + print("| {color} | {hex} |  |".format(color=color.name.lower(), hex=color.value.upper(), url=url)) |
| 64 | +``` |
0 commit comments