Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4067a16

Browse files
committed
Fix some syntax highlights in coding and contributing guide.
1 parent ed74222 commit 4067a16

File tree

2 files changed

+31
-23
lines changed

2 files changed

+31
-23
lines changed

doc/devel/coding_guide.rst

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ When making a PR, pay attention to:
4545
on GitHub.
4646
* When updating your PR, instead of adding new commits to fix something, please
4747
consider amending your initial commit(s) to keep the history clean.
48-
You can achieve this using::
48+
You can achieve this using
4949

50-
git commit --amend --no-edit
51-
git push [your-remote-repo] [your-branch] --force-with-lease
50+
.. code-block:: bash
51+
52+
git commit --amend --no-edit
53+
git push [your-remote-repo] [your-branch] --force-with-lease
5254
5355
See also :ref:`contributing` for how to make a PR.
5456

@@ -352,22 +354,26 @@ the merge notification) or through the git CLI tools.
352354

353355
Assuming that you already have a local branch ``v2.2.x`` (if not, then
354356
``git checkout -b v2.2.x``), and that your remote pointing to
355-
``https://github.com/matplotlib/matplotlib`` is called ``upstream``::
357+
``https://github.com/matplotlib/matplotlib`` is called ``upstream``:
358+
359+
.. code-block:: bash
356360
357-
git fetch upstream
358-
git checkout v2.2.x # or include -b if you don't already have this.
359-
git reset --hard upstream/v2.2.x
360-
git cherry-pick -m 1 TARGET_SHA
361-
# resolve conflicts and commit if required
361+
git fetch upstream
362+
git checkout v2.2.x # or include -b if you don't already have this.
363+
git reset --hard upstream/v2.2.x
364+
git cherry-pick -m 1 TARGET_SHA
365+
# resolve conflicts and commit if required
362366
363367
Files with conflicts can be listed by ``git status``,
364368
and will have to be fixed by hand (search on ``>>>>>``). Once
365369
the conflict is resolved, you will have to re-add the file(s) to the branch
366-
and then continue the cherry pick::
370+
and then continue the cherry pick:
371+
372+
.. code-block:: bash
367373
368-
git add lib/matplotlib/conflicted_file.py
369-
git add lib/matplotlib/conflicted_file2.py
370-
git cherry-pick --continue
374+
git add lib/matplotlib/conflicted_file.py
375+
git add lib/matplotlib/conflicted_file2.py
376+
git cherry-pick --continue
371377
372378
Use your discretion to push directly to upstream or to open a PR; be
373379
sure to push or PR against the ``v2.2.x`` upstream branch, not ``master``!

doc/devel/contributing.rst

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,13 @@ or manually with ::
440440
logging.basicConfig(level=logging.DEBUG)
441441
import matplotlib.pyplot as plt
442442

443-
Then they will receive messages like::
443+
Then they will receive messages like
444444

445-
DEBUG:matplotlib.backends:backend MacOSX version unknown
446-
DEBUG:matplotlib.yourmodulename:Here is some information
447-
DEBUG:matplotlib.yourmodulename:Here is some more detailed information
445+
.. code-block:: none
446+
447+
DEBUG:matplotlib.backends:backend MacOSX version unknown
448+
DEBUG:matplotlib.yourmodulename:Here is some information
449+
DEBUG:matplotlib.yourmodulename:Here is some more detailed information
448450
449451
Which logging level to use?
450452
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -489,12 +491,10 @@ Matplotlib. For example, for the module::
489491
if bottom == top:
490492
warnings.warn('Attempting to set identical bottom==top')
491493

492-
493494
running the script::
494495

495496
from matplotlib import my_matplotlib_module
496-
my_matplotlib_module.set_range(0, 0) #set range
497-
497+
my_matplotlib_module.set_range(0, 0) # set range
498498

499499
will display::
500500

@@ -509,10 +509,12 @@ Modifying the module to use `._api.warn_external`::
509509
if bottom == top:
510510
_api.warn_external('Attempting to set identical bottom==top')
511511

512-
and running the same script will display::
512+
and running the same script will display
513+
514+
.. code-block:: none
513515
514-
UserWarning: Attempting to set identical bottom==top
515-
my_matplotlib_module.set_range(0, 0) #set range
516+
UserWarning: Attempting to set identical bottom==top
517+
my_matplotlib_module.set_range(0, 0) # set range
516518
517519
.. _logging tutorial: https://docs.python.org/3/howto/logging.html#logging-basic-tutorial
518520

0 commit comments

Comments
 (0)