Skip to content

Commit 89822f8

Browse files
authored
Merge pull request #1888 from Borda/precommit/typos
lint: add typos check
2 parents 3d3c86c + 813520c commit 89822f8

File tree

9 files changed

+24
-11
lines changed

9 files changed

+24
-11
lines changed

Diff for: .pre-commit-config.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
repos:
2+
- repo: https://github.com/codespell-project/codespell
3+
rev: v2.2.4
4+
hooks:
5+
- id: codespell
6+
additional_dependencies: [tomli]
7+
# args: ["--write-changes"] # consider enabling for auto-fif
8+
exclude: "test/fixtures/"
9+
210
- repo: https://github.com/astral-sh/ruff-pre-commit
311
rev: v0.4.3
412
hooks:

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ In the less common case that you do not want to install test dependencies, `pip
101101

102102
#### With editable *dependencies* (not preferred, and rarely needed)
103103

104-
In rare cases, you may want to work on GitPython and one or both of its [gitdb](https://github.com/gitpython-developers/gitdb) and [smmap](https://github.com/gitpython-developers/smmap) dependencies at the same time, with changes in your local working copy of gitdb or smmap immediatley reflected in the behavior of your local working copy of GitPython. This can be done by making editable installations of those dependencies in the same virtual environment where you install GitPython.
104+
In rare cases, you may want to work on GitPython and one or both of its [gitdb](https://github.com/gitpython-developers/gitdb) and [smmap](https://github.com/gitpython-developers/smmap) dependencies at the same time, with changes in your local working copy of gitdb or smmap immediately reflected in the behavior of your local working copy of GitPython. This can be done by making editable installations of those dependencies in the same virtual environment where you install GitPython.
105105

106106
If you want to do that *and* you want the versions in GitPython's git submodules to be used, then pass `-e git/ext/gitdb` and/or `-e git/ext/gitdb/gitdb/ext/smmap` to `pip install`. This can be done in any order, and in separate `pip install` commands or the same one, so long as `-e` appears before *each* path. For example, you can install GitPython, gitdb, and smmap editably in the currently active virtual environment this way:
107107

Diff for: doc/source/changes.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ https://github.com/gitpython-developers/GitPython/releases/tag/3.1.42
2020
3.1.41
2121
======
2222

23-
This release is relevant for security as it fixes a possible arbitary
23+
This release is relevant for security as it fixes a possible arbitrary
2424
code execution on Windows.
2525

2626
See this PR for details: https://github.com/gitpython-developers/GitPython/pull/1792

Diff for: git/index/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ def reset(
14431443
key = entry_key(path, 0)
14441444
self.entries[key] = nie[key]
14451445
except KeyError:
1446-
# If key is not in theirs, it musn't be in ours.
1446+
# If key is not in theirs, it mustn't be in ours.
14471447
try:
14481448
del self.entries[key]
14491449
except KeyError:

Diff for: git/objects/util.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -568,11 +568,11 @@ def addToStack(
568568
yield rval
569569

570570
# Only continue to next level if this is appropriate!
571-
nd = d + 1
572-
if depth > -1 and nd > depth:
571+
next_d = d + 1
572+
if depth > -1 and next_d > depth:
573573
continue
574574

575-
addToStack(stack, item, branch_first, nd)
575+
addToStack(stack, item, branch_first, next_d)
576576
# END for each item on work stack
577577

578578

Diff for: git/remote.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def _from_line(cls, remote: "Remote", line: str) -> "PushInfo":
250250
flags |= cls.NEW_TAG
251251
elif "[new branch]" in summary:
252252
flags |= cls.NEW_HEAD
253-
# uptodate encoded in control character
253+
# `uptodate` encoded in control character
254254
else:
255255
# Fast-forward or forced update - was encoded in control character,
256256
# but we parse the old and new commit.

Diff for: pyproject.toml

+5
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,8 @@ lint.unfixable = [
7878
"test/**" = [
7979
"B018", # useless-expression
8080
]
81+
82+
[tool.codespell]
83+
ignore-words-list="gud,doesnt"
84+
#count = true
85+
quiet-level = 3

Diff for: test/test_exc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
_streams_n_substrings = (
5454
None,
55-
"steram",
55+
"stream",
5656
"ομορφο stream",
5757
)
5858

Diff for: test/test_index.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ class Mocked:
10181018
@pytest.mark.xfail(
10191019
type(_win_bash_status) is WinBashStatus.Absent,
10201020
reason="Can't run a hook on Windows without bash.exe.",
1021-
rasies=HookExecutionError,
1021+
raises=HookExecutionError,
10221022
)
10231023
@pytest.mark.xfail(
10241024
type(_win_bash_status) is WinBashStatus.WslNoDistro,
@@ -1077,7 +1077,7 @@ def test_hook_uses_shell_not_from_cwd(self, rw_dir, case):
10771077
@pytest.mark.xfail(
10781078
type(_win_bash_status) is WinBashStatus.Absent,
10791079
reason="Can't run a hook on Windows without bash.exe.",
1080-
rasies=HookExecutionError,
1080+
raises=HookExecutionError,
10811081
)
10821082
@pytest.mark.xfail(
10831083
type(_win_bash_status) is WinBashStatus.WslNoDistro,
@@ -1120,7 +1120,7 @@ def test_pre_commit_hook_fail(self, rw_repo):
11201120
@pytest.mark.xfail(
11211121
type(_win_bash_status) is WinBashStatus.Absent,
11221122
reason="Can't run a hook on Windows without bash.exe.",
1123-
rasies=HookExecutionError,
1123+
raises=HookExecutionError,
11241124
)
11251125
@pytest.mark.xfail(
11261126
type(_win_bash_status) is WinBashStatus.Wsl,

0 commit comments

Comments
 (0)