Skip to content

Commit 5ede6f0

Browse files
authored
🔀 Merge pull request #96 from davep/codespell
Add codespell checking
2 parents 9d10af3 + a826d17 commit 5ede6f0

10 files changed

+23
-8
lines changed

.github/workflows/style-lint-and-test.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
echo ${{ matrix.python-version }} > .python-version
3737
make setup
3838
39+
- name: Check for typos
40+
run: make spellcheck
41+
3942
- name: Check the Code style
4043
run: make codestyle
4144

.pre-commit-config.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ repos:
88
args: [ --fix, --select, I ]
99
# Run the formatter.
1010
- id: ruff-format
11+
- repo: https://github.com/codespell-project/codespell
12+
rev: v2.4.1
13+
hooks:
14+
- id: codespell

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ like something that makes sense for Hike I'll turn it into an issue
1717
from there.
1818

1919
Be sure to [have a look over the TODO
20-
isues](https://github.com/davep/hike/issues?q=is%3Aissue+is%3Aopen+label%3ATODO)
20+
issues](https://github.com/davep/hike/issues?q=is%3Aissue+is%3Aopen+label%3ATODO)
2121
before leaving a request, it might be I'm already planning on implementing
2222
whatever it is you're asking for.
2323

Makefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
app := hike
22
src := src/
33
tests := tests/
4+
docs := docs/
45
run := rye run
56
test := rye test
67
python := $(run) python
78
lint := rye lint -- --select I
89
fmt := rye fmt
910
mypy := $(run) mypy
1011
mkdocs := $(run) mkdocs
12+
spell := $(run) codespell
1113

1214
##############################################################################
1315
# Local "interactive testing" of the code.
@@ -64,8 +66,12 @@ stricttypecheck: # Perform a strict static type checks with mypy
6466
test: # Run the unit tests
6567
$(test) -v
6668

69+
.PHONY: spellcheck
70+
spellcheck: # Spell check the code
71+
$(spell) *.md $(src) $(docs) $(tests)
72+
6773
.PHONY: checkall
68-
checkall: codestyle lint stricttypecheck test # Check all the things
74+
checkall: spellcheck codestyle lint stricttypecheck test # Check all the things
6975

7076
##############################################################################
7177
# Documentation.

docs/source/commands.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ There are some commands that interact with the navigation panel. These are:
5757

5858
Ensures that the navigation panel is opened and then jumps to the bookmarks.
5959

60-
#### `conents`
60+
#### `contents`
6161

6262
!!! aliases
6363

docs/source/configuration.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ generally use a name (`number_sign`, `at`, `asterisk`, etc...).
6969

7070
!!! tip
7171

72-
If you want to test and discover all of the key names and combiantions
72+
If you want to test and discover all of the key names and combinations
7373
that will work, you may want to install
7474
[`textual-dev`](https://github.com/Textualize/textual-dev) and use the
7575
`textual keys` command.
@@ -178,10 +178,10 @@ You can show or hide the navigation panel. This can be done in Hike with the
178178

179179
!!! tip
180180

181-
You can force nagivation [visible](index.md#-navigation) or
181+
You can force navigation [visible](index.md#-navigation) or
182182
[hidden](index.md#-no-navigation) via [the command
183183
line](index.md#command-line-options).
184-
Note that this *also* configures the visability of the navigation panel
184+
Note that this *also* configures the visibility of the navigation panel
185185
for future runs of Hike.
186186

187187
Here is Hike with the navigation panel visible:

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ dev-dependencies = [
7878
"pytest>=8.3.4",
7979
"mkdocs-material>=9.6.11",
8080
"markdown-exec>=1.10.3",
81+
"codespell>=2.4.1",
8182
]
8283

8384
[tool.hatch.metadata]

requirements-dev.lock

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ charset-normalizer==3.4.1
3939
click==8.1.8
4040
# via mkdocs
4141
# via textual-dev
42+
codespell==2.4.1
4243
colorama==0.4.6
4344
# via mkdocs-material
4445
distlib==0.3.9

src/hike/data/location_types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def looks_urllike(candidate: str) -> bool:
5555
"""Does the given value look like a URL?
5656
5757
Args:
58-
candiate: The candidate to test.
58+
candidate: The candidate to test.
5959
6060
Returns:
6161
`True` if the string looks like a URL, `False` if not.

tests/unit/test_command_line_commands.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ExampleCommand(InputCommand):
3232
(" TEstER ", True),
3333
(" TESting ", True),
3434
("", False),
35-
("te", False),
35+
("te", False), # codespell:ignore
3636
),
3737
)
3838
def test_is_command(look_for: str, found: bool) -> None:

0 commit comments

Comments
 (0)