Skip to content

Commit dd72f45

Browse files
committed
Fix typos and add Codespell GitHub Actions
1 parent a1799c8 commit dd72f45

File tree

30 files changed

+44
-36
lines changed

30 files changed

+44
-36
lines changed

.codespellignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
deriver
2+
exampel
3+
failer
4+
spawnve

bin/lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export LANG="${ENCODING:-en_US.UTF-8}"
1111
set -x
1212

1313
# Actually run our tests.
14+
python -m codespell_lib -S "*.po,*.js,*.json,*.svg,*.scss" -I .codespellignore
1415
python -m flake8 .
1516
python -m black --check *.py warehouse/ tests/
1617
python -m isort --check *.py warehouse/ tests/

docs/development/malware-checks.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ directory, and exported from ``__init__.py``. The checks in
5959
`tests/common/checks/`_ can serve as templates for developing new checks. Simply
6060
copy/paste the desired check template into `warehouse/malware/checks/`_ and edit
6161
the `dunder init file`_ to get started. Complex checks that consist of more than
62-
a signle file should be housed in a subdirectory of `warehouse/malware/checks/`_.
62+
a single file should be housed in a subdirectory of `warehouse/malware/checks/`_.
6363

6464
All malware check classes should inherit from
6565
``warehouse.malware.checks.base.MalwareCheckBase``, define a `scan` method, and
@@ -88,7 +88,7 @@ the following ``kwargs`` for ``"event_hook"`` checks:
8888
* ``file_url``: the file url when the ``hooked_object`` is a ``File``
8989

9090
All verdicts **must** be associated with a particular object. For
91-
``"event_hook"`` checks, the ``obj_id`` should be propogated to verdicts
91+
``"event_hook"`` checks, the ``obj_id`` should be propagated to verdicts
9292
generated by that check. The `MalwareVerdict model`_ contains more information
9393
about required and optional verdict fields.
9494

docs/development/token-scanning.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ GitHub's Token scanning feature used to be called "Token Scanning" and is now
3333
"Secret Scanning". You may find the 2 names. GitHub scans public commits with
3434
the regex above (actually the limit to at least 130 characters long). For all
3535
tokens identified within a "push" event, they send us reports in bulk. The
36-
format is explained thouroughly in `their doc
36+
format is explained thoroughly in `their doc
3737
<https://docs.github.com/en/developers/overview/secret-scanning>`_ as well as
3838
in the `warehouse implementation ticket
3939
<https://github.com/pypa/warehouse/issues/6051>`_.

requirements/lint.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ types-requests
2323
types-setuptools
2424
types-sqlalchemy-utils
2525
types-stdlib-list
26+
codespell

requirements/lint.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ click==8.1.3 \
5151
# via
5252
# black
5353
# curlylint
54+
codespell==2.1.0 \
55+
--hash=sha256:19d3fe5644fef3425777e66f225a8c82d39059dcfe9edb3349a8a2cf48383ee5 \
56+
--hash=sha256:b864c7d917316316ac24272ee992d7937c3519be4569209c5b60035ac5d569b5
57+
# via -r requirements/lint.in
5458
curlylint==0.13.1 \
5559
--hash=sha256:008b9d160f3920404ac12efb05c0a39e209cb972f9aafd956b79c5f4e2162752 \
5660
--hash=sha256:9546ea82cdfc9292fd6fe49dca28587164bd315782a209c0a46e013d7f38d2fa

tests/frontend/setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import "@babel/polyfill";
4040
// Monkeypatch the global fetch API
4141
fetch = require("jest-fetch-mock"); // eslint-disable-line no-global-assign
4242

43-
// Make TextEncoder and cryto available in the global scope
43+
// Make TextEncoder and crypto available in the global scope
4444
// in the same way as in a browser environment
4545
window.TextEncoder = require("util").TextEncoder;
4646
const WebCrypto = require("node-webcrypto-ossl");

tests/unit/email/test_init.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ def test_send_admin_new_organization_requested_email(
420420
admin_user = pretend.stub(
421421
id="admin",
422422
username="admin",
423-
name="PyPI Adminstrator",
423+
name="PyPI Administrator",
424424
425425
primary_email=pretend.stub(email="[email protected]", verified=True),
426426
)
@@ -524,7 +524,7 @@ def test_send_admin_new_organization_approved_email(
524524
admin_user = pretend.stub(
525525
id="admin",
526526
username="admin",
527-
name="PyPI Adminstrator",
527+
name="PyPI Administrator",
528528
529529
primary_email=pretend.stub(email="[email protected]", verified=True),
530530
)
@@ -628,7 +628,7 @@ def test_send_admin_new_organization_declined_email(
628628
admin_user = pretend.stub(
629629
id="admin",
630630
username="admin",
631-
name="PyPI Adminstrator",
631+
name="PyPI Administrator",
632632
633633
primary_email=pretend.stub(email="[email protected]", verified=True),
634634
)

tests/unit/integration/github/test_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_invalid_token_leak_request():
5252
),
5353
(
5454
{"type": "failer", "token": "a", "url": "b"},
55-
"Cannot extract token from recieved match",
55+
"Cannot extract token from received match",
5656
"extraction",
5757
),
5858
],
@@ -594,7 +594,7 @@ def metrics_increment(key):
594594
origin="github",
595595
)
596596
assert metrics == {
597-
"warehouse.token_leak.github.recieved": 1,
597+
"warehouse.token_leak.github.received": 1,
598598
"warehouse.token_leak.github.processed": 1,
599599
"warehouse.token_leak.github.valid": 1,
600600
}
@@ -637,7 +637,7 @@ def metrics_increment(key):
637637
origin="github",
638638
)
639639
assert metrics == {
640-
"warehouse.token_leak.github.recieved": 1,
640+
"warehouse.token_leak.github.received": 1,
641641
"warehouse.token_leak.github.error.format": 1,
642642
}
643643

@@ -667,7 +667,7 @@ def metrics_increment(key):
667667
origin="github",
668668
)
669669
assert metrics == {
670-
"warehouse.token_leak.github.recieved": 1,
670+
"warehouse.token_leak.github.received": 1,
671671
"warehouse.token_leak.github.error.invalid": 1,
672672
}
673673

tests/unit/integration/vulnerabilities/osv/test_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def find_service(self, *a, **k):
169169
assert response.status_int == 400
170170
assert metrics == {
171171
(
172-
"warehouse.vulnerabilties.error.payload.json_error",
172+
"warehouse.vulnerabilities.error.payload.json_error",
173173
("origin:osv",),
174174
): 1,
175175
}

0 commit comments

Comments
 (0)