Skip to content

Commit 8c30364

Browse files
jeff5ezio-melotti
authored andcommitted
Limit line length to 80 & clean-up nearby formatting. (python#282)
* Limit line length to 80 or less & nearby clean-up. Wide-ranging but essentially trivial adjustment of line length. Also fixes top-level indenting in gdb.rst particularly. * Avoid whitespace elision by editor before literal block
1 parent cc75ec4 commit 8c30364

17 files changed

+156
-132
lines changed

Diff for: buildbots.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Continuous Integration
44
======================
55

66
To assert that there are no regressions in the :doc:`development and maintenance
7-
branches <devcycle>`, Python has a set of dedicated machines (called *buildbots* or
8-
*build slaves*) used for continuous integration. They span a number of
7+
branches <devcycle>`, Python has a set of dedicated machines (called *buildbots*
8+
or *build slaves*) used for continuous integration. They span a number of
99
hardware/operating system combinations. Furthermore, each machine hosts
1010
several *builders*, one per active branch: when a new change is pushed
1111
to this branch on the public Mercurial repository, all corresponding builders
@@ -186,8 +186,8 @@ offenders:
186186
When you think a failure might be transient, it is recommended you confirm by
187187
waiting for the next build. Still, even if the failure does turn out sporadic
188188
and unpredictable, the issue should be reported on the bug tracker; even
189-
better if it can be diagnosed and suppressed by fixing the test's implementation,
190-
or by making its parameters - such as a timeout - more robust.
189+
better if it can be diagnosed and suppressed by fixing the test's
190+
implementation, or by making its parameters - such as a timeout - more robust.
191191

192192

193193
Custom builders

Diff for: committing.rst

+14-12
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,12 @@ repositories means you have to be more careful with your workflow:
212212
This exception should not be abused and be left only for very simple changes.
213213

214214
* You should not commit directly into the ``master`` branch, or any of the
215-
maintenance branches (currently ``2.7`` or ``3.6``). You should commit against
216-
your own feature branch, and create a pull request.
215+
maintenance branches (currently ``2.7`` or ``3.6``).
216+
You should commit against your own feature branch, and create a pull request.
217217

218-
It is recommended to keep a fork of the main repository around, as it allows simple
219-
reversion of all local changes (even "committed" ones) if your local clone gets
220-
into a state you aren't happy with.
218+
It is recommended to keep a fork of the main repository around, as it allows
219+
simple reversion of all local changes (even "committed" ones) if your local
220+
clone gets into a state you aren't happy with.
221221

222222

223223
.. _Git: https://git-scm.com/
@@ -238,15 +238,17 @@ new features. The other branches only receive bug fixes or security fixes.
238238
Backporting Changes to an Older Version
239239
---------------------------------------
240240

241-
When it is determined that a pull request needs to be backported into one or more of
242-
the maintenance branches, a core developer can apply the labels ``needs backport to X.Y``
243-
to the pull request.
241+
When it is determined that a pull request needs to be backported into one or
242+
more of the maintenance branches, a core developer can apply the labels
243+
``needs backport to X.Y`` to the pull request.
244244

245-
After the pull request has been merged, it can be backported using cherry_picker.py_.
245+
After the pull request has been merged, it can be backported using
246+
cherry_picker.py_.
246247

247-
The commit hash can be obtained from the original pull request, or by using ``git log``
248-
on the ``master`` branch. To display the 10 most recent commit hashes and their first
249-
line of the commit message::
248+
The commit hash can be obtained from the original pull request, or by using
249+
``git log`` on the ``master`` branch.
250+
To display the 10 most recent commit hashes and their first line of the commit
251+
message::
250252

251253
git log -10 --oneline
252254

Diff for: communication.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ Python-ideas_ is a mailing list open to the public to discuss ideas on changing
2626
Python. If a new idea does not start here (or python-list_, discussed below),
2727
it will get redirected here.
2828

29-
Sometimes people post new ideas to python-list_ to gather community opinion before
30-
heading to python-ideas_. The list is also sometimes known as comp.lang.python,
31-
the name of the newsgroup it mirrors (it is also known by the abbreviation
32-
c.l.py).
29+
Sometimes people post new ideas to python-list_ to gather community opinion
30+
before heading to python-ideas_. The list is also sometimes known as
31+
comp.lang.python, the name of the newsgroup it mirrors (it is also known by
32+
the abbreviation c.l.py).
3333

3434
The python-committers_ mailing list is a private mailing list for core
3535
developers (the archives are publicly available).

Diff for: compiler.rst

+15-14
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ very beginning of the compiler or the end, you need to care about how the arena
170170
works. All code relating to the arena is in either :file:`Include/pyarena.h` or
171171
:file:`Python/pyarena.c`.
172172

173-
``PyArena_New()`` will create a new arena. The returned ``PyArena`` structure will
174-
store pointers to all memory given to it. This does the bookkeeping of what
175-
memory needs to be freed when the compiler is finished with the memory it used.
176-
That freeing is done with ``PyArena_Free()``. This only needs to be called in
177-
strategic areas where the compiler exits.
173+
``PyArena_New()`` will create a new arena. The returned ``PyArena`` structure
174+
will store pointers to all memory given to it. This does the bookkeeping of
175+
what memory needs to be freed when the compiler is finished with the memory it
176+
used. That freeing is done with ``PyArena_Free()``. This only needs to be
177+
called in strategic areas where the compiler exits.
178178

179179
As stated above, in general you should not have to worry about memory
180180
management when working on the compiler. The technical details have been
@@ -367,23 +367,24 @@ bytecode step of the compiler. Several pieces of code throughout Python depend
367367
on having correct information about what bytecode exists.
368368

369369
First, you must choose a name and a unique identifier number. The official
370-
list of bytecode can be found in :file:`Include/opcode.h`. If the opcode is to take
371-
an argument, it must be given a unique number greater than that assigned to
370+
list of bytecode can be found in :file:`Include/opcode.h`. If the opcode is to
371+
take an argument, it must be given a unique number greater than that assigned to
372372
``HAVE_ARGUMENT`` (as found in :file:`Include/opcode.h`).
373373

374374
Once the name/number pair has been chosen and entered in Include/opcode.h,
375375
you must also enter it into :file:`Lib/opcode.py` and
376376
:file:`Doc/library/dis.rst`.
377377

378378
With a new bytecode you must also change what is called the magic number for
379-
.pyc files. The variable ``MAGIC`` in :file:`Python/import.c` contains the number.
379+
.pyc files. The variable ``MAGIC`` in :file:`Python/import.c` contains the
380+
number.
380381
Changing this number will lead to all .pyc files with the old ``MAGIC``
381382
to be recompiled by the interpreter on import.
382383

383384
Finally, you need to introduce the use of the new bytecode. Altering
384385
:file:`Python/compile.c` and :file:`Python/ceval.c` will be the primary places
385-
to change. But you will also need to change the 'compiler' package. The key files
386-
to do that are :file:`Lib/compiler/pyassem.py` and
386+
to change. But you will also need to change the 'compiler' package.
387+
The key files to do that are :file:`Lib/compiler/pyassem.py` and
387388
:file:`Lib/compiler/pycodegen.py`.
388389

389390
If you make a change here that can affect the output of bytecode that
@@ -392,10 +393,10 @@ sure to delete your old .py(c|o) files! Even though you will end up changing
392393
the magic number if you change the bytecode, while you are debugging your work
393394
you will be changing the bytecode output without constantly bumping up the
394395
magic number. This means you end up with stale .pyc files that will not be
395-
recreated. Running
396-
``find . -name '*.py[co]' -exec rm -f {} ';'`` should delete all .pyc files you
397-
have, forcing new ones to be created and thus allow you test out your new
398-
bytecode properly.
396+
recreated.
397+
Running ``find . -name '*.py[co]' -exec rm -f {} ';'`` should delete all .pyc
398+
files you have, forcing new ones to be created and thus allow you test out your
399+
new bytecode properly.
399400

400401

401402
Code Objects

Diff for: devcycle.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ bug fixes can now be committed. This is when core developers should concentrate
164164
on the task of fixing regressions and other new issues filed by users who have
165165
downloaded the alpha and beta releases.
166166

167-
Being in beta can be viewed much like being in RC_ but without the extra overhead
168-
of needing commit reviews.
167+
Being in beta can be viewed much like being in RC_ but without the extra
168+
overhead of needing commit reviews.
169169

170-
Please see the note in the `In-development (main) branch`_ section above
171-
for new information about the creation of the 3.5 maintenance branch during beta.
170+
Please see the note in the `In-development (main) branch`_ section above for
171+
new information about the creation of the 3.5 maintenance branch during beta.
172172

173173

174174
.. _rc:
@@ -179,8 +179,8 @@ Release Candidate (RC)
179179
A branch preparing for an RC release can only have bugfixes applied that have
180180
been reviewed by other core developers. Generally, these issues must be
181181
severe enough (e.g. crashes) that they deserve fixing before the final release.
182-
All other issues should be deferred to the next development cycle, since stability
183-
is the strongest concern at this point.
182+
All other issues should be deferred to the next development cycle, since
183+
stability is the strongest concern at this point.
184184

185185
You **cannot** skip the peer review during an RC, no matter how small! Even if
186186
it is a simple copy-and-paste change, **everything** requires peer review from

Diff for: developers.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ change or granted access. The procedure for adding or removing users is
1414
described in :ref:`altering-access`.
1515

1616
Note, when giving new commit permissions, be sure to get a contributor agreement
17-
from the committer. See https://www.python.org/psf/contrib/ for details. Commit
18-
privileges should not be given until the contributor agreement has been signed
19-
and received.
17+
from the committer. See https://www.python.org/psf/contrib/ for details.
18+
Commit privileges should not be given until the contributor agreement has been
19+
signed and received.
2020

2121
This file is encoded in UTF-8. If the usual form for a name is not in
2222
a Latin or extended Latin alphabet, make sure to include an ASCII

Diff for: docquality.rst

+12-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ keeping a high level of quality takes a lot of effort. Help is always
88
appreciated with the documentation, and it requires little programming
99
experience (with or without Python).
1010

11-
:ref:`Documenting Python <documenting>` covers the details of how Python's documentation works.
11+
:ref:`Documenting Python <documenting>` covers the details of how Python's
12+
documentation works.
1213
It includes an explanation of the markup used (although you can figure a lot
1314
out simply by looking at pre-existing documentation) and :ref:`how to build
1415
<building-doc>` the documentation (which allows you to see how your changes
@@ -25,8 +26,8 @@ subscribing to the
2526
Documentation issues reported on the `issue tracker`_ are sent here as well as
2627
some bug reports being directly emailed to the mailing list. There is also the
2728
`[email protected] mailing list
28-
<https://mail.python.org/mailman/listinfo/doc-sig>`_ which discusses the
29-
documentation toolchain, projects, standards, etc.
29+
<https://mail.python.org/mailman/listinfo/doc-sig>`_
30+
which discusses the documentation toolchain, projects, standards, etc.
3031

3132

3233
Helping with issues filed on the issue tracker
@@ -38,10 +39,10 @@ typos, to unclear documentation, to something completely lacking documentation.
3839

3940
If you decide to tackle a documentation issue, you can simply submit a
4041
:doc:`pull request <pullrequest>` for the issue. If you are worried that someone
41-
else might be working simultaneously on the issue, simply leave a comment on the issue
42-
saying you are going to try and create a pull request and roughly how long you think
43-
you will take to do it (this allows others to take on the issue if you happen
44-
to forget or lose interest).
42+
else might be working simultaneously on the issue, simply leave a comment on the
43+
issue saying you are going to try and create a pull request and roughly how long
44+
you think you will take to do it (this allows others to take on the issue if you
45+
happen to forget or lose interest).
4546

4647
.. _issue tracker: https://bugs.python.org
4748
.. _documentation issues: https://bugs.python.org/issue?%40search_text=&ignore=file%3Acontent&title=&%40columns=title&id=&%40columns=id&stage=&creation=&creator=&activity=&%40columns=activity&%40sort=activity&actor=&nosy=&type=&components=4&versions=&dependencies=&assignee=&keywords=&priority=&%40group=priority&status=1&%40columns=status&resolution=&nosy_count=&message_count=&%40pagesize=50&%40startwith=0&%40queryname=&%40old-queryname=&%40action=search
@@ -58,9 +59,10 @@ from Python 2).
5859

5960
If you decide to proofread, then read a section of the documentation from start
6061
to finish, filing issues in the issue tracker for each problem you find. Simple
61-
typos don't require an issue of their own, instead submit a pull request directly.
62-
Don't file a single issue for an entire section containing multiple problems as that
63-
makes it harder to break the work up for multiple people to help with.
62+
typos don't require an issue of their own, instead submit a pull request
63+
directly.
64+
Don't file a single issue for an entire section containing multiple problems as
65+
that makes it harder to break the work up for multiple people to help with.
6466

6567

6668
.. _helping-with-the-developers-guide:

Diff for: documenting.rst

+16-13
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ Bad example (creating worry in the mind of a reader):
171171
excessive resource consumption. Never rely on reference counting to
172172
automatically close a file.
173173

174-
Good example (establishing confident knowledge in the effective use of the language):
174+
Good example (establishing confident knowledge in the effective use of the
175+
language):
175176

176177
A best practice for using files is use a try/finally pair to explicitly
177178
close a file after it is used. Alternatively, using a with-statement can
@@ -222,8 +223,8 @@ a typical use case. For instance, the :meth:`str.rpartition` method is better
222223
demonstrated with an example splitting the domain from a URL than it would be
223224
with an example of removing the last word from a line of Monty Python dialog.
224225

225-
The ellipsis for the :py:data:`sys.ps2` secondary interpreter prompt should only be
226-
used sparingly, where it is necessary to clearly differentiate between input
226+
The ellipsis for the :py:data:`sys.ps2` secondary interpreter prompt should only
227+
be used sparingly, where it is necessary to clearly differentiate between input
227228
lines and output lines. Besides contributing visual clutter, it makes it
228229
difficult for readers to cut-and-paste examples so they can experiment with
229230
variations.
@@ -456,7 +457,9 @@ the extension mechanisms of reST, and Sphinx makes heavy use of it.
456457

457458
Basically, a directive consists of a name, arguments, options and content. (Keep
458459
this terminology in mind, it is used in the next chapter describing custom
459-
directives.) Looking at this example, ::
460+
directives.) Looking at this example,
461+
462+
::
460463

461464
.. function:: foo(x)
462465
foo(y, z)
@@ -853,8 +856,8 @@ Syntax highlighting is handled in a smart way:
853856

854857
Longer displays of verbatim text may be included by storing the example text in
855858
an external file containing only plain text. The file may be included using the
856-
``literalinclude`` directive. [1]_ For example, to include the Python source file
857-
:file:`example.py`, use::
859+
``literalinclude`` directive. [1]_ For example, to include the Python source
860+
file :file:`example.py`, use::
858861

859862
.. literalinclude:: example.py
860863

@@ -895,8 +898,8 @@ a matching identifier is found:
895898

896899
.. describe:: mod
897900

898-
The name of a module; a dotted name may be used. This should also be used for
899-
package names.
901+
The name of a module; a dotted name may be used. This should also be used
902+
for package names.
900903

901904
.. describe:: func
902905

@@ -1358,8 +1361,8 @@ pair
13581361
namely ``loop; statement`` and ``statement; loop``.
13591362
triple
13601363
Likewise, ``triple: module; search; path`` is a shortcut that creates three
1361-
index entries, which are ``module; search path``, ``search; path, module`` and
1362-
``path; module search``.
1364+
index entries, which are ``module; search path``, ``search; path, module``
1365+
and ``path; module search``.
13631366
module, keyword, operator, object, exception, statement, builtin
13641367
These all create two index entries. For example, ``module: hashlib``
13651368
creates the entries ``module; hashlib`` and ``hashlib; module``. The
@@ -1418,8 +1421,8 @@ The following is an example taken from the Python Reference Manual::
14181421
Substitutions
14191422
-------------
14201423

1421-
The documentation system provides three substitutions that are defined by default.
1422-
They are set in the build configuration file :file:`conf.py`.
1424+
The documentation system provides three substitutions that are defined by
1425+
default. They are set in the build configuration file :file:`conf.py`.
14231426

14241427
.. describe:: |release|
14251428

@@ -1491,7 +1494,7 @@ Without make
14911494

14921495
Install the Sphinx package and its dependencies from PyPI.
14931496

1494-
Then, from the ``Docs`` directory, run ::
1497+
Then, from the ``Docs`` directory, run::
14951498

14961499
sphinx-build -b<builder> . build/<builder>
14971500

Diff for: fixingissues.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Fixing "easy" Issues (and Beyond)
55

66
When you feel comfortable enough to want to help tackle issues by trying to
77
create a patch to fix an issue, you can start by looking at the `"easy"
8-
issues`_. These issues *should* be ones where it should take no longer than a day
9-
or weekend to fix. But because the "easy" classification is typically done at
10-
triage time it can turn out to be inaccurate, so do feel free to leave a
8+
issues`_. These issues *should* be ones where it should take no longer than a
9+
day or weekend to fix. But because the "easy" classification is typically done
10+
at triage time it can turn out to be inaccurate, so do feel free to leave a
1111
comment if you think the classification no longer applies.
1212

1313
For the truly adventurous looking for a challenge, you can look for issues that

0 commit comments

Comments
 (0)