|
| 1 | +# Contributing to `flask-cors` |
| 2 | + |
| 3 | +Contributions are welcome, and they are greatly appreciated! |
| 4 | +Every little bit helps, and credit will always be given. |
| 5 | + |
| 6 | +You can contribute in many ways: |
| 7 | + |
| 8 | +# Types of Contributions |
| 9 | + |
| 10 | +## Report Bugs |
| 11 | + |
| 12 | +Report bugs at https://github.com/corydolphin/flask-cors/issues |
| 13 | + |
| 14 | +If you are reporting a bug, please include: |
| 15 | + |
| 16 | +- Your operating system name and version. |
| 17 | +- Any details about your local setup that might be helpful in troubleshooting. |
| 18 | +- Detailed steps to reproduce the bug. |
| 19 | + |
| 20 | +## Fix Bugs |
| 21 | + |
| 22 | +Look through the GitHub issues for bugs. |
| 23 | +Anything tagged with "bug" and "help wanted" is open to whoever wants to implement a fix for it. |
| 24 | + |
| 25 | +## Implement Features |
| 26 | + |
| 27 | +Look through the GitHub issues for features. |
| 28 | +Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it. |
| 29 | + |
| 30 | +## Write Documentation |
| 31 | + |
| 32 | +flask-cors could always use more documentation, whether as part of the official docs, in docstrings, or even on the web in blog posts, articles, and such. |
| 33 | + |
| 34 | +## Submit Feedback |
| 35 | + |
| 36 | +The best way to send feedback is to file an issue at https://github.com/corydolphin/flask-cors/issues. |
| 37 | + |
| 38 | +If you are proposing a new feature: |
| 39 | + |
| 40 | +- Explain in detail how it would work. |
| 41 | +- Keep the scope as narrow as possible, to make it easier to implement. |
| 42 | +- Remember that this is a volunteer-driven project, and that contributions |
| 43 | + are welcome :) |
| 44 | + |
| 45 | +# Get Started! |
| 46 | + |
| 47 | +Ready to contribute? Here's how to set up `flask-cors` for local development. |
| 48 | +Please note this documentation assumes you already have `uv` and `Git` installed and ready to go. |
| 49 | + |
| 50 | +1. Fork the `flask-cors` repo on GitHub. |
| 51 | + |
| 52 | +2. Clone your fork locally: |
| 53 | + |
| 54 | +```bash |
| 55 | +cd <directory_in_which_repo_should_be_created> |
| 56 | +git clone [email protected]:YOUR_NAME/flask-cors.git |
| 57 | +``` |
| 58 | + |
| 59 | +3. Now we need to install the environment. Navigate into the directory |
| 60 | + |
| 61 | +```bash |
| 62 | +cd flask-cors |
| 63 | +``` |
| 64 | + |
| 65 | +Then, install and activate the environment with: |
| 66 | + |
| 67 | +```bash |
| 68 | +uv sync |
| 69 | +``` |
| 70 | + |
| 71 | +4. Install pre-commit to run linters/formatters at commit time: |
| 72 | + |
| 73 | +```bash |
| 74 | +uv run pre-commit install |
| 75 | +``` |
| 76 | + |
| 77 | +5. Create a branch for local development: |
| 78 | + |
| 79 | +```bash |
| 80 | +git checkout -b name-of-your-bugfix-or-feature |
| 81 | +``` |
| 82 | + |
| 83 | +Now you can make your changes locally. |
| 84 | + |
| 85 | +6. Don't forget to add test cases for your added functionality to the `tests` directory. |
| 86 | + |
| 87 | +7. When you're done making changes, check that your changes pass the formatting tests. |
| 88 | + |
| 89 | +```bash |
| 90 | +make check |
| 91 | +``` |
| 92 | + |
| 93 | +Now, validate that all unit tests are passing: |
| 94 | + |
| 95 | +```bash |
| 96 | +make test |
| 97 | +``` |
| 98 | + |
| 99 | +9. Before raising a pull request you should also run tox. |
| 100 | + This will run the tests across different versions of Python: |
| 101 | + |
| 102 | +```bash |
| 103 | +tox |
| 104 | +``` |
| 105 | + |
| 106 | +This requires you to have multiple versions of python installed. |
| 107 | +This step is also triggered in the CI/CD pipeline, so you could also choose to skip this step locally. |
| 108 | + |
| 109 | +10. Commit your changes and push your branch to GitHub: |
| 110 | + |
| 111 | +```bash |
| 112 | +git add . |
| 113 | +git commit -m "Your detailed description of your changes." |
| 114 | +git push origin name-of-your-bugfix-or-feature |
| 115 | +``` |
| 116 | + |
| 117 | +11. Submit a pull request through the GitHub website. |
| 118 | + |
| 119 | +# Pull Request Guidelines |
| 120 | + |
| 121 | +Before you submit a pull request, check that it meets these guidelines: |
| 122 | + |
| 123 | +1. The pull request should include tests. |
| 124 | + |
| 125 | +2. If the pull request adds functionality, the docs should be updated. |
| 126 | + Put your new functionality into a function with a docstring, and add the feature to the list in `README.md`. |
0 commit comments