reformat contributing doc
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 295e1e7 · Browse files · 1 file·+119 added−82 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+119 added−82 removed
- other:+119 added−82 removed
Provenance
- Commit
8e2fb46- Tree
56f3e48- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
295e1e7
1 file changed+119 added−82 removed
modified:CONTRIBUTING.rst+119 added-82 removed
1 unmodified line2 ==========================3 4 Thank you for considering contributing to Flask!5 6+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:12 12-* The ``#get-help`` channel on our Discord chat: https://discordapp.com/invite/t6rrQZH13+- The ``#get-help`` channel on our Discord chat:14+ https://discord.gg/t6rrQZH15 14- * The IRC channel ``#pocoo`` on FreeNode is linked to Discord, but15- Discord is preferred.16+ - The IRC channel ``#pocoo`` on FreeNode is linked to Discord, but17+ Discord is preferred.18 19+- The mailing list flask@python.org for long term discussion or larger17-* The mailing list flask@python.org for long term discussion or larger issues.18-* Ask on `Stack Overflow`_. Search with Google first using:19- ``site:stackoverflow.com flask {search term, exception message, etc.}``20+ issues.21+- Ask on `Stack Overflow`_. Search with Google first using:22+ ``site:stackoverflow.com flask {search term, exception message, etc.}``23 24 .. _Stack Overflow: https://stackoverflow.com/questions/tagged/flask?sort=linked25 26+27 Reporting issues28 ----------------29 26-- Describe what you expected to happen.27-- If possible, include a `minimal reproducible example`_ to help us28- identify the issue. This also helps check that the issue is not with29- your own code.30-- Describe what actually happened. Include the full traceback if there was an31- exception.32-- List your Python, Flask, and Werkzeug versions. If possible, check if this33- issue is already fixed in the repository.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.38 39 .. _minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example40 41+42 Submitting patches43 ------------------44 40-- Use `Black`_ to autoformat your code. This should be done for you as a41- git `pre-commit`_ hook, which gets installed when you run ``pip install -e .[dev]``.42- You may also wish to use Black's `Editor integration`_.43-- Include tests if your patch is supposed to solve a bug, and explain44- clearly under which circumstances the bug happens. Make sure the test fails45- without your patch.46-- Include a string like "Fixes #123" in your commit message47- (where 123 is the issue you fixed).48- See `Closing issues using keywords49- <https://help.github.com/articles/creating-a-pull-request/>`__.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/>`__.54 55+56 First time setup57 ~~~~~~~~~~~~~~~~58 54-- Download and install the `latest version of git`_.55-- Configure git with your `username`_ and `email`_::59+- Download and install the `latest version of git`_.60+- Configure git with your `username`_ and `email`_.61 57- git config --global user.name 'your name'58- git config --global user.email 'your email'62+ .. code-block:: text63 60-- Make sure you have a `GitHub account`_.61-- Fork Flask to your GitHub account by clicking the `Fork`_ button.62-- `Clone`_ your GitHub fork locally::64+ $ git config --global user.name 'your name'65+ $ git config --global user.email 'your email'66 64- git clone https://github.com/{username}/flask65- cd flask67+- Make sure you have a `GitHub account`_.68+- Fork Flask to your GitHub account by clicking the `Fork`_ button.69+- `Clone`_ your GitHub fork locally.70 67-- Add the main repository as a remote to update later::71+ .. code-block:: text72 73+ $ git clone https://github.com/{username}/flask74+ $ cd flask75+76+- Add the main repository as a remote to update later::77+78+ .. code-block:: text79+80 git remote add pallets https://github.com/pallets/flask81 git fetch pallets82 72-- Create a virtualenv::83+- Create a virtualenv.84 74- python3 -m venv env75- . env/bin/activate76- # or "env\Scripts\activate" on Windows85+ .. code-block:: text86 78-- Install Flask in editable mode with development dependencies::87+ $ python3 -m venv env88+ $ . env/bin/activate89 80- pip install -e ".[dev]"90+ On Windows, activating is different.91 82-- Install the `pre-commit framework`_.83-- Install the pre-commit hooks::92+ .. code-block:: text93 85- pre-commit install --install-hooks94+ > env\Scripts\activate95 96+- Install Flask in editable mode with development dependencies.97+98+ .. code-block:: text99+100+ $ pip install -e ".[dev]"101+102+- Install the `pre-commit framework`_.103+- Install the pre-commit hooks.104+105+ .. code-block:: text106+107+ $ pre-commit install108+109 .. _GitHub account: https://github.com/join110 .. _latest version of git: https://git-scm.com/downloads111 .. _username: https://help.github.com/en/articles/setting-your-username-in-git112 .. _email: https://help.github.com/en/articles/setting-your-commit-email-address-in-git113 .. _Fork: https://github.com/pallets/flask/fork114 .. _Clone: https://help.github.com/en/articles/fork-a-repo#step-2-create-a-local-clone-of-your-fork115 .. _pre-commit framework: https://pre-commit.com/#install116 117+118 Start coding119 ~~~~~~~~~~~~120 121 - Create a branch to identify the issue you would like to work on. If122 you're submitting a bug or documentation fix, branch off of the100- latest ".x" branch::123+ latest ".x" branch.124 102- git checkout -b your-branch-name origin/1.0.x125+ .. code-block:: text126 127+ $ git checkout -b your-branch-name origin/1.0.x128+129 If you're submitting a feature addition or change, branch off of the105- "master" branch::130+ "master" branch.131 107- git checkout -b your-branch-name origin/master132+ .. code-block:: text133 109-- Using your favorite editor, make your changes, `committing as you go`_.110-- Include tests that cover any code changes you make. Make sure the test fails111- without your patch. `Run the tests <contributing-testsuite_>`_.112-- Push your commits to GitHub and `create a pull request`_ by using::134+ $ git checkout -b your-branch-name origin/master135 114- git push --set-upstream origin your-branch-name136+- Using your favorite editor, make your changes,137+ `committing as you go`_.138+- Include tests that cover any code changes you make. Make sure the139+ test fails without your patch.140+ `Run the tests <contributing-testsuite_>`_.141+- Push your commits to GitHub and `create a pull request`_.142 116-- Celebrate 🎉143+ .. code-block:: text144 145+ $ git push --set-upstream origin your-branch-name146+147 .. _committing as you go: https://dont-be-afraid-to-commit.readthedocs.io/en/latest/git/commandlinegit.html#commit-your-changes148 .. _Black: https://black.readthedocs.io149 .. _Editor integration: https://black.readthedocs.io/en/stable/editor_integration.html150 .. _pre-commit: https://pre-commit.com151 .. _create a pull request: https://help.github.com/en/articles/creating-a-pull-request152 153+154 .. _contributing-testsuite: #running-the-tests155 156 Running the tests157 ~~~~~~~~~~~~~~~~~158 129-Run the basic test suite with::159+Run the basic test suite with pytest.160 131- pytest161+.. code-block:: text162 133-This only runs the tests for the current environment. Whether this is relevant134-depends on which part of Flask you're working on. Travis-CI will run the full135-suite when you submit your pull request.163+ $ pytest164 165+This only runs the tests for the current environment. Whether this is166+relevant depends on which part of Flask you're working on. CI will run167+the full suite when you submit your pull request.168+169 The full test suite takes a long time to run because it tests multiple170 combinations of Python and dependencies. If you don't have a Python171 version installed, it will be skipped with a warning message at the end.140-Run::172 142- tox173+.. code-block:: text174 175+ $ tox176+177+178 Running test coverage179 ~~~~~~~~~~~~~~~~~~~~~180 181 Generating a report of lines that do not have test coverage can indicate148-where to start contributing. Run ``pytest`` using ``coverage`` and generate a149-report on the terminal and as an interactive HTML document::182+where to start contributing. Run ``pytest`` using ``coverage`` and183+generate a report on the terminal and as an interactive HTML document.184 151- coverage run -m pytest152- coverage report153- coverage html154- # then open htmlcov/index.html185+.. code-block:: text186 187+ $ coverage run -m pytest188+ $ coverage report189+ $ coverage html # then open htmlcov/index.html190+191 Read more about `coverage <https://coverage.readthedocs.io>`_.192 193 Running the full test suite with ``tox`` will combine the coverage reports194 from all runs.1 unmodified line196 197 Building the docs198 ~~~~~~~~~~~~~~~~~199 165-Build the docs in the ``docs`` directory using Sphinx::200+Build the docs in the ``docs`` directory using Sphinx.201 167- cd docs168- pip install -r requirements.txt169- make html202+.. code-block:: text203 204+ $ cd docs205+ $ make html206+207 Open ``_build/html/index.html`` in your browser to view the docs.208 209 Read more about `Sphinx <https://www.sphinx-doc.org/en/master/>`_.210 211 212 Caution: zero-padded file modes213 -------------------------------214 179-This repository contains several zero-padded file modes that may cause issues180-when pushing this repository to git hosts other than GitHub. Fixing this is181-destructive to the commit history, so we suggest ignoring these warnings. If it182-fails to push and you're using a self-hosted git service like GitLab, you can183-turn off repository checks in the admin panel.215+This repository contains several zero-padded file modes that may cause216+issues when pushing this repository to Git hosts other than GitHub.217+Fixing this is destructive to the commit history, so we suggest ignoring218+these warnings. If it fails to push and you're using a self-hosted Git219+service like GitLab, you can turn off repository checks in the admin220+panel.221 185-These files can also cause issues while cloning. If you have ::222+These files can also cause issues while cloning if you have223+``fsckObjects`` enabled with either of the following in your git config.224 225+.. code-block::226+227 [fetch]188- fsckobjects = true228+ fsckObjects = true229 190-or ::191-230 [receive]231 fsckObjects = true232 195-set in your git configuration file, cloning this repository will fail. The only196-solution is to set both of the above settings to false while cloning, and then197-setting them back to true after the cloning is finished.233+The only solution is to set both of the above to ``false``, clone, and234+then set them back to ``true`` after.