update contributing guide
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parent 3ee366a · Browse files · 1 file·+55 added−73 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+55 added−73 removed
- other:+55 added−73 removed
Provenance
- Commit
a54f6ee- Tree
edcf561- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
3ee366a
1 file changed+55 added−73 removed
modified:CONTRIBUTING.rst+55 added-73 removed
5 unmodified lines6 7 Support questions8 -----------------9 10-Please, don't use the issue tracker for this. Use one of the following11-resources for questions about your own code:10+Please, don't use the issue tracker for this. The issue tracker is a11+tool to address bugs and feature requests in Flask itself. Use one of12+the following resources for questions about using Flask or issues with13+your own code:14 15 - The ``#get-help`` channel on our Discord chat:16 https://discord.gg/t6rrQZH15-16- - The IRC channel ``#pocoo`` on FreeNode is linked to Discord, but17- Discord is preferred.18-17 - The mailing list flask@python.org for long term discussion or larger18 issues.19 - Ask on `Stack Overflow`_. Search with Google first using:22- ``site:stackoverflow.com flask {search term, exception message, etc.}``20+ ``site:stackoverflow.com python flask {search term, exception message, etc.}``21 22 .. _Stack Overflow: https://stackoverflow.com/questions/tagged/flask?sort=linked23 24 25 Reporting issues26 ----------------27 28+Include the following information in your post:29+30 - Describe what you expected to happen.31 - If possible, include a `minimal reproducible example`_ to help us32 identify the issue. This also helps check that the issue is not with33 your own code.34 - Describe what actually happened. Include the full traceback if there35 was an exception.36 - List your Python, Flask, and Werkzeug versions. If possible, check37- if this issue is already fixed in the repository.37+ if this issue is already fixed in the latest releases or the latest38+ code in the repository.39 40 .. _minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example41 42 43 Submitting patches44 ------------------45 45-- Use `Black`_ to autoformat your code. This should be done for you as46- a Git `pre-commit`_ hook, set up below. You may also wish to use47- Black's `Editor integration`_.48-- Include tests if your patch is supposed to solve a bug, and explain49- clearly under which circumstances the bug happens. Make sure the50- test fails without your patch.51-- Include a string like "Fixes #123" in your commit message (where 12352- is the issue you fixed). See `Closing issues using keywords53- <https://help.github.com/articles/creating-a-pull-request/>`__.46+If there is not an open issue for what you want to submit, prefer47+opening one for discussion before working on a PR. You can work on any48+issue that doesn't have an open PR linked to it or a maintainer assigned49+to it. These show up in the sidebar. No need to ask if you can work on50+an issue that interests you.51 52+Include the following in your patch:53 54+- Use `Black`_ to format your code. This and other tools will run55+ automatically if you install `pre-commit`_ using the instructions56+ below.57+- Include tests if your patch adds or changes code. Make sure the test58+ fails without your patch.59+- Update any relevant docs pages and docstrings. Docs pages and60+ docstrings should be wrapped at 72 characters.61+- Add an entry in ``CHANGES.rst``. Use the same style as other62+ entries. Also include ``.. versionchanged::`` inline changelogs in63+ relevant docstrings.64+65+.. _Black: https://black.readthedocs.io66+.. _pre-commit: https://pre-commit.com67+68+69 First time setup70 ~~~~~~~~~~~~~~~~71 72 - Download and install the `latest version of git`_.5 unmodified lines78 $ git config --global user.email 'your email'79 80 - Make sure you have a `GitHub account`_.81 - Fork Flask to your GitHub account by clicking the `Fork`_ button.69-- `Clone`_ your GitHub fork locally.82+- `Clone`_ the main repository locally.83 84 .. code-block:: text85 73- $ git clone https://github.com/{username}/flask86+ $ git clone https://github.com/pallets/flask87 $ cd flask88 76-- Add the main repository as a remote to update later.89+- Add your fork as a remote to push your work to. Replace90+ ``{username}`` with your username. This names the remote "fork", the91+ default Pallets remote is "origin".92 93 .. code-block:: text94 80- $ git remote add pallets https://github.com/pallets/flask81- $ git fetch pallets95+ git remote add fork https://github.com/{username}/flask96 97 - Create a virtualenv.98 99 .. code-block:: text18 unmodified lines118 .. code-block:: text119 120 $ pre-commit install121 108-.. _GitHub account: https://github.com/join122 .. _latest version of git: https://git-scm.com/downloads123 .. _username: https://help.github.com/en/articles/setting-your-username-in-git124 .. _email: https://help.github.com/en/articles/setting-your-commit-email-address-in-git125+.. _GitHub account: https://github.com/join126 .. _Fork: https://github.com/pallets/flask/fork127 .. _Clone: https://help.github.com/en/articles/fork-a-repo#step-2-create-a-local-clone-of-your-fork114-.. _pre-commit framework: https://pre-commit.com/#install128 129 130 Start coding131 ~~~~~~~~~~~~3 unmodified lines135 latest ".x" branch.136 137 .. code-block:: text138 139+ $ git fetch origin126- $ git checkout -b your-branch-name origin/1.0.x140+ $ git checkout -b your-branch-name origin/1.1.x141 142 If you're submitting a feature addition or change, branch off of the143 "master" branch.144 145 .. code-block:: text146 147+ $ git fetch origin148 $ git checkout -b your-branch-name origin/master149 150 - Using your favorite editor, make your changes,151 `committing as you go`_.152 - Include tests that cover any code changes you make. Make sure the138- test fails without your patch.139- `Run the tests <contributing-testsuite_>`_.140-- Push your commits to GitHub and `create a pull request`_.153+ test fails without your patch. Run the tests as described below.154+- Push your commits to your fork on GitHub and155+ `create a pull request`_. Link to the issue being addressed with156+ ``fixes #123`` in the pull request.157 158 .. code-block:: text159 144- $ git push --set-upstream origin your-branch-name160+ $ git push --set-upstream fork your-branch-name161 162 .. _committing as you go: https://dont-be-afraid-to-commit.readthedocs.io/en/latest/git/commandlinegit.html#commit-your-changes147-.. _Black: https://black.readthedocs.io148-.. _Editor integration: https://black.readthedocs.io/en/stable/editor_integration.html149-.. _pre-commit: https://pre-commit.com163 .. _create a pull request: https://help.github.com/en/articles/creating-a-pull-request164 165 153-.. _contributing-testsuite: #running-the-tests154-166 Running the tests167 ~~~~~~~~~~~~~~~~~168 169 Run the basic test suite with pytest.1 unmodified line171 .. code-block:: text172 173 $ pytest174 164-This only runs the tests for the current environment. Whether this is165-relevant depends on which part of Flask you're working on. CI will run166-the full suite when you submit your pull request.175+This runs the tests for the current environment, which is usually176+sufficient. CI will run the full suite when you submit your pull177+request. You can run the full test suite with tox if you don't want to178+wait.179 168-The full test suite takes a long time to run because it tests multiple169-combinations of Python and dependencies. If you don't have a Python170-version installed, it will be skipped with a warning message at the end.171-180 .. code-block:: text181 182 $ tox183 2 unmodified lines186 ~~~~~~~~~~~~~~~~~~~~~187 188 Generating a report of lines that do not have test coverage can indicate189 where to start contributing. Run ``pytest`` using ``coverage`` and182-generate a report on the terminal and as an interactive HTML document.190+generate a report.191 192 .. code-block:: text193 194+ $ pip install coverage195 $ coverage run -m pytest187- $ coverage report188- $ coverage html # then open htmlcov/index.html196+ $ coverage html197 190-Read more about `coverage <https://coverage.readthedocs.io>`_.198+Open ``htmlcov/index.html`` in your browser to explore the report.199 192-Running the full test suite with ``tox`` will combine the coverage reports193-from all runs.200+Read more about `coverage <https://coverage.readthedocs.io>`__.201 202 203 Building the docs204 ~~~~~~~~~~~~~~~~~6 unmodified lines211 $ make html212 213 Open ``_build/html/index.html`` in your browser to view the docs.214 208-Read more about `Sphinx <https://www.sphinx-doc.org/en/master/>`_.209-210-211-Caution: zero-padded file modes212--------------------------------213-214-This repository contains several zero-padded file modes that may cause215-issues when pushing this repository to Git hosts other than GitHub.216-Fixing this is destructive to the commit history, so we suggest ignoring217-these warnings. If it fails to push and you're using a self-hosted Git218-service like GitLab, you can turn off repository checks in the admin219-panel.220-221-These files can also cause issues while cloning if you have222-``fsckObjects`` enabled with either of the following in your git config.223-224-.. code-block::225-226- [fetch]227- fsckObjects = true228-229- [receive]230- fsckObjects = true231-232-The only solution is to set both of the above to ``false``, clone, and233-then set them back to ``true`` after.215+Read more about `Sphinx <https://www.sphinx-doc.org/en/stable/>`__.