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

Skip to content

Commit e1c7bce

Browse files
authored
Lint: Upgrade linters, enable backtick check & fix new errors (python#2825)
* PEP 240: Fix issue detected by Sphinx-Lint * PEP 357: Fix issue detected by Sphinx-Lint * PEP 447: Fix issue detected by Sphinx-Lint * PEP 461: Fix issue detected by Sphinx-Lint * Lint: Autoupdate pre-commit hook versions * Lint: Re-enable --role-with-double-backticks now that FP is fixed
1 parent e810b67 commit e1c7bce

5 files changed

Lines changed: 9 additions & 45 deletions

File tree

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ repos:
4343
name: "Check YAML"
4444

4545
- repo: https://github.com/psf/black
46-
rev: 22.3.0
46+
rev: 22.10.0
4747
hooks:
4848
- id: black
4949
name: "Format with Black"
@@ -67,20 +67,20 @@ repos:
6767
name: "Format tox.ini"
6868

6969
- repo: https://github.com/sphinx-contrib/sphinx-lint
70-
rev: v0.6.1
70+
rev: v0.6.6
7171
hooks:
7272
- id: sphinx-lint
7373
name: "Sphinx lint"
74-
# Temporarily disable "role-with-double-backticks" due to false positive:
75-
# https://github.com/sphinx-contrib/sphinx-lint/issues/34
76-
args: ["--disable=role-with-double-backticks,trailing-whitespace"]
74+
args: ["--disable=trailing-whitespace"]
7775

7876
# RST checks
7977
- repo: https://github.com/pre-commit/pygrep-hooks
8078
rev: v1.9.0
8179
hooks:
8280
- id: rst-backticks
8381
name: "Check RST: No single backticks"
82+
files: '^pep-\d\.txt|\.rst$'
83+
types: [text]
8484
- id: rst-inline-touching-normal
8585
name: "Check RST: No backticks touching text"
8686
files: '^pep-\d+\.txt|\.rst$'
@@ -92,7 +92,7 @@ repos:
9292

9393
# Manual codespell check
9494
- repo: https://github.com/codespell-project/codespell
95-
rev: v2.1.0
95+
rev: v2.2.1
9696
hooks:
9797
- id: codespell
9898
name: "Check for common misspellings in text files"

pep-0240.txt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
PEP: 240
22
Title: Adding a Rational Literal to Python
3-
Version: $Revision$
4-
Last-Modified: $Date$
53
Author: Christopher A. Craig <[email protected]>, Moshe Zadka <[email protected]>
64
Status: Rejected
75
Type: Standards Track
@@ -61,7 +59,7 @@ mentioned above. The following migration is suggested:
6159
to cause all such literals to be treated as rational numbers.
6260

6361
2. Python 3.0 will have a warning, turned on by default, about
64-
such literals in the absence of a `` __future__`` statement. The
62+
such literals in the absence of a ``__future__`` statement. The
6563
warning message will contain information about the ``__future__``
6664
statement, and indicate that to get floating point literals,
6765
they should be suffixed with "e0".
@@ -97,11 +95,3 @@ Copyright
9795
=========
9896

9997
This document has been placed in the public domain.
100-
101-
102-
103-
..
104-
Local Variables:
105-
mode: indented-text
106-
indent-tabs-mode: nil
107-
End:

pep-0357.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
PEP: 357
22
Title: Allowing Any Object to be Used for Slicing
3-
Version: $Revision$
4-
Last-Modified: $Date$
53
Author: Travis Oliphant <[email protected]>
64
Status: Final
75
Type: Standards Track
@@ -237,13 +235,3 @@ Copyright
237235
=========
238236

239237
This document is placed in the public domain.
240-
241-
242-
..
243-
Local Variables:
244-
mode: indented-text
245-
indent-tabs-mode: nil
246-
sentence-end-double-space: t
247-
fill-column: 70
248-
coding: utf-8
249-
End:

pep-0447.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
PEP: 447
22
Title: Add __getdescriptor__ method to metaclass
3-
Version: $Revision$
4-
Last-Modified: $Date$
53
Author: Ronald Oussoren <[email protected]>
64
Status: Deferred
75
Type: Standards Track
@@ -117,7 +115,7 @@ Aside: Attribute resolution algorithm in Python
117115
-----------------------------------------------
118116

119117
The attribute resolution process as implemented by ``object.__getattribute__``
120-
(or PyObject_GenericGetAttr`` in CPython's implementation) is fairly
118+
(or ``PyObject_GenericGetAttr`` in CPython's implementation) is fairly
121119
straightforward, but not entirely so without reading C code.
122120

123121
The current CPython implementation of object.__getattribute__ is basically

pep-0461.txt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
PEP: 461
22
Title: Adding % formatting to bytes and bytearray
3-
Version: $Revision$
4-
Last-Modified: $Date$
53
Author: Ethan Furman <[email protected]>
64
Status: Final
75
Type: Standards Track
@@ -55,7 +53,7 @@ All the numeric formatting codes (``d``, ``i``, ``o``, ``u``, ``x``, ``X``,
5553
``e``, ``E``, ``f``, ``F``, ``g``, ``G``, and any that are subsequently added
5654
to Python 3) will be supported, and will work as they do for str, including
5755
the padding, justification and other related modifiers (currently ``#``, ``0``,
58-
``-``, `` `` (space), and ``+`` (plus any added to Python 3)). The only
56+
``-``, space, and ``+`` (plus any added to Python 3)). The only
5957
non-numeric codes allowed are ``c``, ``b``, ``a``, and ``s`` (which is a
6058
synonym for b).
6159

@@ -243,13 +241,3 @@ Copyright
243241
=========
244242

245243
This document has been placed in the public domain.
246-
247-
248-
..
249-
Local Variables:
250-
mode: indented-text
251-
indent-tabs-mode: nil
252-
sentence-end-double-space: t
253-
fill-column: 70
254-
coding: utf-8
255-
End:

0 commit comments

Comments
 (0)