Skip to content

Commit e300321

Browse files
committed
chore: add spell check and rst check
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 2f8fe4c commit e300321

File tree

5 files changed

+26
-12
lines changed

5 files changed

+26
-12
lines changed

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ repos:
55
- id: check-toml
66
- id: check-yaml
77
- id: end-of-file-fixer
8+
- id: mixed-line-ending
89
- id: trailing-whitespace
910

1011
- repo: https://github.com/pre-commit/mirrors-mypy
@@ -21,3 +22,16 @@ repos:
2122
- id: ruff
2223
args: [ --fix, --show-fixes ]
2324
- id: ruff-format
25+
26+
- repo: https://github.com/pre-commit/pygrep-hooks
27+
rev: "v1.10.0"
28+
hooks:
29+
- id: rst-backticks
30+
- id: rst-directive-colons
31+
- id: rst-inline-touching-normal
32+
33+
- repo: https://github.com/codespell-project/codespell
34+
rev: "v2.4.1"
35+
hooks:
36+
- id: codespell
37+
args: ["-Ldynamc,notin"]

CHANGELOG.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Changelog
7171
* Parse raw metadata (:issue:`671`)
7272
* Import underlying parser functions as an underscored variable (:issue:`663`)
7373
* Improve error for local version label with unsupported operators (:issue:`675`)
74-
* Add dedicated error for specifiers with incorrect `.*` suffix
74+
* Add dedicated error for specifiers with incorrect ``.*`` suffix
7575
* Replace spaces in platform names with underscores (:issue:`620`)
7676
* Relax typing of ``_key`` on ``_BaseVersion`` (:issue:`669`)
7777
* Handle prefix match with zeros at end of prefix correctly (:issue:`674`)
@@ -174,8 +174,8 @@ No unreleased changes.
174174
.. note:: This release was subsequently yanked, and these changes were included in 20.7.
175175

176176
* Fix flit configuration, to include LICENSE files (:issue:`357`)
177-
* Make `intel` a recognized CPU architecture for the `universal` macOS platform tag (:issue:`361`)
178-
* Add some missing type hints to `packaging.requirements` (issue:`350`)
177+
* Make ``intel`` a recognized CPU architecture for the ``universal`` macOS platform tag (:issue:`361`)
178+
* Add some missing type hints to ``packaging.requirements`` (issue:`350`)
179179

180180
20.5 - 2020-11-27
181181
~~~~~~~~~~~~~~~~~
@@ -227,7 +227,7 @@ No unreleased changes.
227227

228228
* Add ``major``, ``minor``, and ``micro`` aliases to ``packaging.version.Version`` (:issue:`225`)
229229

230-
* Properly mark ``packaging`` has being fully typed by adding a `py.typed` file (:issue:`226`)
230+
* Properly mark ``packaging`` has being fully typed by adding a ``py.typed`` file (:issue:`226`)
231231

232232
19.2 - 2019-09-18
233233
~~~~~~~~~~~~~~~~~

docs/metadata.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Metadata
44
.. currentmodule:: packaging.markers
55

66

7-
Both `source distributions`_ and `binary distributions`
7+
Both `source distributions`_ and `binary distributions`_
88
(_sdists_ and _wheels_, respectively) contain files recording the
99
`core metadata`_ for the distribution. This information is used for
1010
everything from recording the name of the distribution to the

src/packaging/metadata.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ def _parse_project_urls(data: list[str]) -> dict[str, str]:
193193
# be the missing value, then they'd have multiple '' values that
194194
# overwrite each other in a accumulating dict.
195195
#
196-
# The other potentional issue is that it's possible to have the
196+
# The other potential issue is that it's possible to have the
197197
# same label multiple times in the metadata, with no solid "right"
198198
# answer with what to do in that case. As such, we'll do the only
199-
# thing we can, which is treat the field as unparseable and add it
199+
# thing we can, which is treat the field as unparsable and add it
200200
# to our list of unparsed fields.
201201
parts = [p.strip() for p in pair.split(",", 1)]
202202
parts.extend([""] * (max(0, 2 - len(parts)))) # Ensure 2 items
@@ -209,8 +209,8 @@ def _parse_project_urls(data: list[str]) -> dict[str, str]:
209209
label, url = parts
210210
if label in urls:
211211
# The label already exists in our set of urls, so this field
212-
# is unparseable, and we can just add the whole thing to our
213-
# unparseable data and stop processing it.
212+
# is unparsable, and we can just add the whole thing to our
213+
# unparsable data and stop processing it.
214214
raise KeyError("duplicate labels in project urls")
215215
urls[label] = url
216216

@@ -424,7 +424,7 @@ def parse_email(data: bytes | str) -> tuple[RawMetadata, dict[str, list[str]]]:
424424
except KeyError:
425425
unparsed[name] = value
426426
# Nothing that we've done has managed to parse this, so it'll just
427-
# throw it in our unparseable data and move on.
427+
# throw it in our unparsable data and move on.
428428
else:
429429
unparsed[name] = value
430430

@@ -441,7 +441,7 @@ def parse_email(data: bytes | str) -> tuple[RawMetadata, dict[str, list[str]]]:
441441
else:
442442
if payload:
443443
# Check to see if we've already got a description, if so then both
444-
# it, and this body move to unparseable.
444+
# it, and this body move to unparsable.
445445
if "description" in raw:
446446
description_header = cast(str, raw.pop("description"))
447447
unparsed.setdefault("description", []).extend(

tests/test_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def mock_ios(monkeypatch):
5959
monkeypatch.setattr(sys, "platform", "ios")
6060

6161
# Mock a fake architecture that will fit the expected pattern, but
62-
# wont actually be a legal multiarch.
62+
# won't actually be a legal multiarch.
6363
monkeypatch.setattr(
6464
sys.implementation,
6565
"_multiarch",

0 commit comments

Comments
 (0)