Skip to content

Commit c43d871

Browse files
committed
Fix typos discovered by codespell
1 parent 364697e commit c43d871

File tree

7 files changed

+68
-9
lines changed

7 files changed

+68
-9
lines changed

.pre-commit-config.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Learn more about this config here: https://pre-commit.com/
2+
3+
# To enable these pre-commit hooks run: `uv tool install pre-commit`
4+
# or `pipx install pre-commit` or `brew install pre-commit`, etc.
5+
# Then in the project root directory run `pre-commit install`
6+
7+
repos:
8+
#- repo: https://github.com/pre-commit/pre-commit-hooks
9+
# rev: v6.0.0
10+
# hooks:
11+
# - id: check-added-large-files
12+
# - id: check-ast
13+
# - id: check-builtin-literals
14+
# - id: check-case-conflict
15+
# - id: check-docstring-first
16+
# - id: check-executables-have-shebangs
17+
# - id: check-json
18+
# - id: check-merge-conflict
19+
# - id: check-shebang-scripts-are-executable
20+
# - id: check-symlinks
21+
# - id: check-toml
22+
# - id: check-vcs-permalinks
23+
# - id: check-xml
24+
# - id: check-yaml
25+
# - id: debug-statements
26+
# - id: destroyed-symlinks
27+
# - id: detect-private-key
28+
# - id: end-of-file-fixer
29+
# - id: file-contents-sorter
30+
# - id: fix-byte-order-marker
31+
# - id: forbid-new-submodules
32+
# - id: forbid-submodules
33+
# - id: mixed-line-ending
34+
# args:
35+
# - --fix=lf
36+
# - id: requirements-txt-fixer
37+
# - id: sort-simple-yaml
38+
# - id: trailing-whitespace
39+
40+
- repo: https://github.com/codespell-project/codespell
41+
rev: v2.4.1
42+
hooks:
43+
- id: codespell # See pyproject.toml for args
44+
additional_dependencies:
45+
- tomli
46+
47+
- repo: https://github.com/pre-commit/mirrors-mypy
48+
rev: v1.17.1
49+
hooks:
50+
- id: mypy
51+
52+
- repo: https://github.com/astral-sh/ruff-pre-commit
53+
rev: v0.12.11
54+
hooks:
55+
- id: ruff-check
56+
# - id: ruff-format

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1616

1717
## 0.28.0 (28th November, 2024)
1818

19-
Be aware that the default *JSON request bodies now use a more compact representation*. This is generally considered a prefered style, tho may require updates to test suites.
19+
Be aware that the default *JSON request bodies now use a more compact representation*. This is generally considered a preferred style, tho may require updates to test suites.
2020

2121
The 0.28 release includes a limited set of deprecations...
2222

@@ -151,7 +151,7 @@ Our revised [SSL documentation](docs/advanced/ssl.md) covers how to implement th
151151

152152
### Removed
153153

154-
* The `rfc3986` dependancy has been removed. (#2252)
154+
* The `rfc3986` dependency has been removed. (#2252)
155155

156156
## 0.23.3 (4th January, 2023)
157157

docs/advanced/ssl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import certifi
2929
import httpx
3030
import ssl
3131

32-
# This SSL context is equivelent to the default `verify=True`.
32+
# This SSL context is equivalent to the default `verify=True`.
3333
ctx = ssl.create_default_context(cafile=certifi.where())
3434
client = httpx.Client(verify=ctx)
3535
```
@@ -46,7 +46,7 @@ ctx = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
4646
client = httpx.Client(verify=ctx)
4747
```
4848

49-
Loding an alternative certificate verification store using [the standard SSL context API](https://docs.python.org/3/library/ssl.html)...
49+
Loading an alternative certificate verification store using [the standard SSL context API](https://docs.python.org/3/library/ssl.html)...
5050

5151
```python
5252
import httpx

httpx/_multipart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def __init__(self, name: str, value: FileTypes) -> None:
130130
# This large tuple based API largely mirror's requests' API
131131
# It would be good to think of better APIs for this that we could
132132
# include in httpx 2.0 since variable length tuples(especially of 4 elements)
133-
# are quite unwieldly
133+
# are quite unwieldy
134134
if isinstance(value, tuple):
135135
if len(value) == 2:
136136
# neither the 3rd parameter (content_type) nor the 4th (headers)

httpx/_urlparse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ def urlparse(url: str = "", **kwargs: str | None) -> ParseResult:
250250
# Replace "raw_path" with "path" and "query".
251251
if "raw_path" in kwargs:
252252
raw_path = kwargs.pop("raw_path") or ""
253-
kwargs["path"], seperator, kwargs["query"] = raw_path.partition("?")
254-
if not seperator:
253+
kwargs["path"], separator, kwargs["query"] = raw_path.partition("?")
254+
if not separator:
255255
kwargs["query"] = None
256256

257257
# Ensure that IPv6 "host" addresses are always escaped with "[...]".

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,13 @@ filterwarnings = [
123123
"ignore: trio.MultiError is deprecated since Trio 0.22.0:trio.TrioDeprecationWarning"
124124
]
125125
markers = [
126-
"copied_from(source, changes=None): mark test as copied from somewhere else, along with a description of changes made to accodomate e.g. our test setup",
126+
"copied_from(source, changes=None): mark test as copied from somewhere else, along with a description of changes made to accommodate e.g. our test setup",
127127
"network: marks tests which require network connection. Used in 3rd-party build environments that have network disabled."
128128
]
129129

130130
[tool.coverage.run]
131131
omit = ["venv/*"]
132132
include = ["httpx/*", "tests/*"]
133+
134+
[tool.codespell]
135+
ignore-words-list = "asend,te"

tests/models/test_url.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def test_url_leading_dot_prefix_on_relative_url():
285285

286286
def test_param_with_space():
287287
# Params passed as form key-value pairs should be form escaped,
288-
# Including the special case of "+" for space seperators.
288+
# Including the special case of "+" for space separators.
289289
url = httpx.URL("http://webservice", params={"u": "with spaces"})
290290
assert str(url) == "http://webservice?u=with+spaces"
291291

0 commit comments

Comments
 (0)