From 7fa80c34d7b748600eb0d7421430f5af87dc42db Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 6 Oct 2022 12:14:32 -0700 Subject: [PATCH] Infra + many PEPs: Add Sphinx Lint and fix errors (#2816) * PEP 555, 653: Fix inline literal missing (escaped) space after literal * Add newline at end of file * PEP 692: Add newline at end of file * PEP 633: Fix missing space before role * Run sphinx-lint in pre-commit * PEP 639: Remove rogue backticks * PEP 372: Remove rogue backticks * PEP 462: Add missing underscore after closing backtick in hyperlink * PEP 481: Add missing underscore after closing backtick in hyperlinks * PEP 507: Add missing underscore after closing backtick in hyperlinks * PEP 453: Add missing underscore after closing backtick in hyperlinks, and convert to links * PEP 534: Fix inline literal missing (escaped) space after literal * PEP 372, 453, 462: Redirect BPO to GH --- .pre-commit-config.yaml | 11 +++++- pep-0372.txt | 23 +++--------- pep-0453.txt | 61 ++++++++++++------------------- pep-0462.txt | 15 +------- pep-0481.txt | 17 +-------- pep-0507.txt | 19 ++-------- pep-0534.txt | 15 +------- pep-0555.rst | 12 +----- pep-0633.rst | 11 +----- pep-0639.rst | 2 +- pep-0653.rst | 13 +------ pep-0692.rst | 2 +- pep_sphinx_extensions/LICENCE.rst | 2 +- 13 files changed, 53 insertions(+), 150 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 653f07ee9..7e864ea5e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ default_stages: [commit] repos: # General file checks and fixers - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.3.0 hooks: - id: mixed-line-ending name: "Normalize mixed line endings" @@ -66,6 +66,15 @@ repos: - id: tox-ini-fmt name: "Format tox.ini" + - repo: https://github.com/sphinx-contrib/sphinx-lint + rev: v0.6.1 + hooks: + - id: sphinx-lint + name: "Sphinx lint" + # Temporarily disable "role-with-double-backticks" due to false positive: + # https://github.com/sphinx-contrib/sphinx-lint/issues/34 + args: ["--disable=role-with-double-backticks,trailing-whitespace"] + # RST checks - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.9.0 diff --git a/pep-0372.txt b/pep-0372.txt index 0027c0b7b..84d044330 100644 --- a/pep-0372.txt +++ b/pep-0372.txt @@ -1,7 +1,5 @@ PEP: 372 Title: Adding an ordered dictionary to collections -Version: $Revision$ -Last-Modified: $Date$ Author: Armin Ronacher , Raymond Hettinger Status: Final @@ -27,7 +25,7 @@ Patch A working Py3.1 patch including tests and documentation is at: - `OrderedDict patch `_ + `OrderedDict patch `_ The check-in was in revisions: 70101 and 70102 @@ -148,7 +146,7 @@ constructor? Is the ordered dict a dict subclass? Why? - Yes. Like ``defaultdict``, an ordered dictionary `` subclasses ``dict``. + Yes. Like ``defaultdict``, an ordered dictionary subclasses ``dict``. Being a dict subclass make some of the methods faster (like ``__getitem__`` and ``__len__``). More importantly, being a dict subclass lets ordered dictionaries be usable with tools like json that @@ -197,7 +195,7 @@ How well does OrderedDict work with the json module, PyYAML, and ConfigParser? In Py2.6, the object_hook for json decoders passes-in an already built dictionary so order is lost before the object hook sees it. This problem is being fixed for Python 2.7/3.1 by adding a new hook that - preserves order (see http://bugs.python.org/issue5381 ). + preserves order (see https://github.com/python/cpython/issues/49631 ). With the new hook, order can be preserved:: >>> jtext = '{"one": 1, "two": 2, "three": 3, "four": 4, "five": 5}' @@ -264,7 +262,7 @@ Reference Implementation An implementation with tests and documentation is at: - `OrderedDict patch `_ + `OrderedDict patch `_ The proposed version has several merits: @@ -308,21 +306,10 @@ of the source file. References ========== -.. [1] http://bugs.python.org/issue1371075 +.. [1] https://github.com/python/cpython/issues/42649 Copyright ========= This document has been placed in the public domain. - - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - coding: utf-8 - End: diff --git a/pep-0453.txt b/pep-0453.txt index a8f69cf2c..2bfd7699a 100644 --- a/pep-0453.txt +++ b/pep-0453.txt @@ -1,7 +1,5 @@ PEP: 453 Title: Explicit bootstrapping of pip in Python installations -Version: $Revision$ -Last-Modified: $Date$ Author: Donald Stufft , Nick Coghlan BDFL-Delegate: Martin von Löwis @@ -32,7 +30,7 @@ PEP Acceptance This PEP was accepted for inclusion in Python 3.4 by Martin von Löwis on Tuesday 22nd October, 2013. -`Issue 19347 `__ has been created to +`Issue 19347 `__ has been created to track the implementation of this PEP. @@ -1021,49 +1019,38 @@ site-packages directory rather than the system site-packages). References ========== -.. [1] Discussion thread 1 (distutils-sig) - (https://mail.python.org/pipermail/distutils-sig/2013-August/022529.html) +* `Discussion thread 1 (distutils-sig) + `_ -.. [2] Discussion thread 2 (distutils-sig) - (https://mail.python.org/pipermail/distutils-sig/2013-September/022702.html) +* `Discussion thread 2 (distutils-sig) + `_ -.. [3] Discussion thread 3 (python-dev) - (https://mail.python.org/pipermail/python-dev/2013-September/128723.html) +* `Discussion thread 3 (python-dev) + `_ -.. [4] Discussion thread 4 (python-dev) - (https://mail.python.org/pipermail/python-dev/2013-September/128780.html) +* `Discussion thread 4 (python-dev) + `_ -.. [5] Discussion thread 5 (python-dev) - (https://mail.python.org/pipermail/python-dev/2013-September/128894.html) +* `Discussion thread 5 (python-dev) + `_ -.. [#cert-verification] pip/requests certificate management concerns - (https://mail.python.org/pipermail/python-dev/2013-October/129755.html) +.. [#cert-verification] `pip/requests certificate management concerns + `_ -.. [#windows-incompatibility] Windows installer compatibility concerns - (https://mail.python.org/pipermail/distutils-sig/2013-October/022855.html) +.. [#windows-incompatibility] `Windows installer compatibility concerns + `_ -.. [#ubuntu] `Ubuntu ` -.. [#debian] `Debian ` -.. [#fedora] `Fedora ` -.. [#homebrew] `Homebrew ` -.. [#macports] `MacPorts ` -.. [#fink] `Fink ` -.. [#ContinuumIO] `Anaconda ` -.. [#ActiveState] `ActivePython ` -.. [#Enthought] `Enthought Canopy ` +.. [#ubuntu] `Ubuntu `__ +.. [#debian] `Debian `__ +.. [#fedora] `Fedora `__ +.. [#homebrew] `Homebrew `__ +.. [#macports] `MacPorts `__ +.. [#fink] `Fink `__ +.. [#ContinuumIO] `Anaconda `__ +.. [#ActiveState] `ActivePython `__ +.. [#Enthought] `Enthought Canopy `__ Copyright ========= This document has been placed in the public domain. - - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - coding: utf-8 - End: diff --git a/pep-0462.txt b/pep-0462.txt index ba4ae5dc9..0c2c7d778 100644 --- a/pep-0462.txt +++ b/pep-0462.txt @@ -1,7 +1,5 @@ PEP: 462 Title: Core development workflow automation for CPython -Version: $Revision$ -Last-Modified: $Date$ Author: Nick Coghlan Status: Withdrawn Type: Process @@ -403,7 +401,7 @@ Mercurial vs Gerrit/git Gerrit uses git as the actual storage mechanism for patches, and automatically handles merging of approved patches. By contrast, Kallithea -use the RhodeCode created `vcs ` library as +use the RhodeCode created `vcs `_ library as an abstraction layer over specific DVCS implementations (with Mercurial and git backends currently available). @@ -511,7 +509,7 @@ Our current approach to handling NEWS file updates regularly results in spurious conflicts when merging bug fixes forward from an active maintenance branch to a later branch. -`Issue #18967* `__ discusses some +`Issue #18967* `__ discusses some possible improvements in that area, which would be beneficial regardless of whether or not we adopt Zuul as a workflow automation tool. @@ -696,12 +694,3 @@ Copyright ========= This document has been placed in the public domain. - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - coding: utf-8 - End: diff --git a/pep-0481.txt b/pep-0481.txt index f693e66ff..ff80b0379 100644 --- a/pep-0481.txt +++ b/pep-0481.txt @@ -1,7 +1,5 @@ PEP: 481 Title: Migrate CPython to Git, Github, and Phabricator -Version: $Revision$ -Last-Modified: $Date$ Author: Donald Stufft Status: Withdrawn Type: Process @@ -345,22 +343,11 @@ workflow less reusable with other projects. References ========== -.. [#openhub-stats] `Open Hub Statistics ` -.. [#hg-git] `Hg-Git mercurial plugin ` +.. [#openhub-stats] `Open Hub Statistics `_ +.. [#hg-git] `Hg-Git mercurial plugin `_ Copyright ========= This document has been placed in the public domain. - - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - coding: utf-8 - End: diff --git a/pep-0507.txt b/pep-0507.txt index b12f57c70..e4ace277d 100644 --- a/pep-0507.txt +++ b/pep-0507.txt @@ -1,7 +1,5 @@ PEP: 507 Title: Migrate CPython to Git and GitLab -Version: $Revision$ -Last-Modified: $Date$ Author: Barry Warsaw Status: Rejected Type: Process @@ -310,23 +308,12 @@ Open issues References ========== -.. [#openhub-stats] `Open Hub Statistics ` -.. [#hg-git] `Hg-Git mercurial plugin ` -.. [#GitLab] `https://about.gitlab.com/` +.. [#openhub-stats] `Open Hub Statistics `_ +.. [#hg-git] `Hg-Git mercurial plugin `_ +.. [#GitLab] ``_ Copyright ========= This document has been placed in the public domain. - - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - coding: utf-8 - End: diff --git a/pep-0534.txt b/pep-0534.txt index b6e649fbe..4959943d5 100644 --- a/pep-0534.txt +++ b/pep-0534.txt @@ -1,7 +1,5 @@ PEP: 534 Title: Improved Errors for Missing Standard Library Modules -Version: $Revision$ -Last-Modified: $Date$ Author: Tomáš Orsava , Petr Viktorin , Nick Coghlan @@ -116,7 +114,7 @@ with two additional functions: * ``sysconfig.get_optional_modules()``, which will list optional public top level standard library module names -The results of ``sysconfig.get_optional_modules()``and the existing +The results of ``sysconfig.get_optional_modules()`` and the existing ``sys.builtin_module_names`` will both be subsets of the full list provided by the new ``sysconfig.get_stdlib_modules()`` function. @@ -374,14 +372,3 @@ Copyright ========= This document has been placed in the public domain. - - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - coding: utf-8 - End: diff --git a/pep-0555.rst b/pep-0555.rst index f001601aa..23e7b7893 100644 --- a/pep-0555.rst +++ b/pep-0555.rst @@ -359,7 +359,7 @@ For code that does not use ``contextvars``, the additions are O(1) and essential More on implementation '''''''''''''''''''''' -The rest of the functionality, including ``contextvars.leaking_yields``, contextvars.capture()``, ``contextvars.get_local_state()`` and ``contextvars.clean_context()`` are in fact quite straightforward to implement, but their implementation will be discussed further in later versions of this proposal. Caching of assigned values is somewhat more complicated, and will be discussed later, but it seems that most cases should achieve O(1) complexity. +The rest of the functionality, including ``contextvars.leaking_yields``, ``contextvars.capture()``, ``contextvars.get_local_state()`` and ``contextvars.clean_context()`` are in fact quite straightforward to implement, but their implementation will be discussed further in later versions of this proposal. Caching of assigned values is somewhat more complicated, and will be discussed later, but it seems that most cases should achieve O(1) complexity. Backwards compatibility ======================= @@ -403,13 +403,3 @@ Copyright ========= This document has been placed in the public domain. - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - coding: utf-8 - End: diff --git a/pep-0633.rst b/pep-0633.rst index becf2af99..8bcbecf70 100644 --- a/pep-0633.rst +++ b/pep-0633.rst @@ -65,7 +65,7 @@ In the specification of multiple requirements with the same distribution name (where environment markers choose the appropriate dependency), the chosen solution is similar to `Poetry`_'s, where an array of requirements is allowed. -The direct-reference keys closely align with and utilise pep:`610` and +The direct-reference keys closely align with and utilise :pep:`610` and :pep:`440` as to reduce differences in the packaging ecosystem and rely on previous work in specification. @@ -741,12 +741,3 @@ Copyright This document is placed in the public domain or under the CC0-1.0-Universal license, whichever is more permissive. - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - coding: utf-8 - End: diff --git a/pep-0639.rst b/pep-0639.rst index 183017a72..fbbe70490 100644 --- a/pep-0639.rst +++ b/pep-0639.rst @@ -781,7 +781,7 @@ Converting legacy metadata Tools MUST NOT use the contents of the ``license.text`` ``[project]`` key (or equivalent tool-specific format), license classifiers or the value of the core metadata ``License`` field -to fill the top-level string value of the ``license`` key `` +to fill the top-level string value of the ``license`` key or the core metadata ``License-Expression`` field without informing the user and requiring unambiguous, affirmative user action to select and confirm the desired license expression value before proceeding. diff --git a/pep-0653.rst b/pep-0653.rst index 527f0bff9..2c80548eb 100644 --- a/pep-0653.rst +++ b/pep-0653.rst @@ -107,7 +107,7 @@ Specification Additions to the object model ----------------------------- -The ``__match_container__ ``and ``__match_class__`` attributes will be added to ``object``. +The ``__match_container__`` and ``__match_class__`` attributes will be added to ``object``. ``__match_container__`` should be overridden by classes that want to match mapping or sequence patterns. ``__match_class__`` should be overridden by classes that want to change the default behavior when matching class patterns. @@ -871,14 +871,3 @@ Copyright This document is placed in the public domain or under the CC0-1.0-Universal license, whichever is more permissive. - - - -.. - Local Variables: - mode: indented-text - indent-tabs-mode: nil - sentence-end-double-space: t - fill-column: 70 - coding: utf-8 - End: diff --git a/pep-0692.rst b/pep-0692.rst index 1d6d9b2b7..f35010930 100644 --- a/pep-0692.rst +++ b/pep-0692.rst @@ -602,4 +602,4 @@ Copyright ========= This document is placed in the public domain or under the -CC0-1.0-Universal license, whichever is more permissive. \ No newline at end of file +CC0-1.0-Universal license, whichever is more permissive. diff --git a/pep_sphinx_extensions/LICENCE.rst b/pep_sphinx_extensions/LICENCE.rst index f147a8023..c4665c1ad 100644 --- a/pep_sphinx_extensions/LICENCE.rst +++ b/pep_sphinx_extensions/LICENCE.rst @@ -1,2 +1,2 @@ This files in this directory are placed in the public domain or under the -CC0-1.0-Universal license, whichever is more permissive. \ No newline at end of file +CC0-1.0-Universal license, whichever is more permissive.