Skip to content

Commit 89fb140

Browse files
committed
pre-commit: Find and fix typos with codespell
1 parent c85b24c commit 89fb140

File tree

15 files changed

+41
-25
lines changed

15 files changed

+41
-25
lines changed

.github/workflows/build-manylinux.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
# The * here essentially tells cibuildwheel to follow its default behaviour
4747
# of building all possible build configurations the particular cibuildwheel
4848
# version supports. Unless cibuildwheel itself is bumped to the next version,
49-
# this will stay constant and do the same set of builds everytime.
49+
# this will stay constant and do the same set of builds every time.
5050
- { image: manylinux2014, arch: x86_64, pyversions: "*" }
5151
- { image: manylinux2014, arch: i686, pyversions: "*" }
5252

.pre-commit-config.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ repos:
3636
| src_c/sdlmain_osx.m
3737
)$
3838
39+
- repo: https://github.com/codespell-project/codespell
40+
rev: v2.2.4
41+
hooks:
42+
- id: codespell
43+
args: ["--skip=docs/es/*,src_c/*,setup.py,*.json"]
44+
additional_dependencies:
45+
- tomli
46+
3947
- repo: https://github.com/charliermarsh/ruff-pre-commit
4048
rev: v0.3.7
4149
hooks:

buildconfig/manylinux-build/docker_base/pkg-config/build-pkg-config.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set -e -x
99
cd $(dirname `readlink -f "$0"`)
1010

1111
# We save the compiled-in PKG_CONFIG_PATH of the pre-existing pkg-config, and
12-
# re-use it with the new pkg-config
12+
# reuse it with the new pkg-config
1313
COMPILED_PKGCONFIG_DIRS=$(pkg-config --variable pc_path pkg-config)
1414

1515
# append path(s) where other installs put .pc files

buildconfig/stubs/pygame/sprite.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ _TDirtySprite = TypeVar("_TDirtySprite", bound=_DirtySpriteSupportsGroup)
122122
# missing image and rect attributes
123123
# a = Group(Sprite())
124124

125-
# typechecker should error, other Sprite attibutes are also needed for Group
125+
# typechecker should error, other Sprite attributes are also needed for Group
126126
# class MySprite:
127127
# image: Surface
128128
# rect: Rect
@@ -255,7 +255,7 @@ class collide_circle_ratio:
255255
) -> bool: ...
256256

257257
# argument to collide_mask must either have mask or have image attribute, in
258-
# addtion to mandatorily having a rect attribute
258+
# addition to mandatorily having a rect attribute
259259
_SupportsCollideMask = Union[_HasImageAndRect, _HasMaskAndRect]
260260

261261
def collide_mask(

docs/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ is written in rst files, which stands for "ReStructured Text." We use Sphinx
3838
([Sphinx Documentation](https://www.sphinx-doc.org/en/master/)) to convert
3939
these rst files into html, which are then hosted on the pygame website.
4040

41-
Sphinx has a good ReStructed Text primer to learn the basics:
41+
Sphinx has a good ReStructured Text primer to learn the basics:
4242
https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
4343

4444
Contributing steps:
45-
- Have an idea to improve the docs, perhaps create an issue on Github
45+
- Have an idea to improve the docs, perhaps create an issue on GitHub
4646
- Find the file you want to edit: it will most likely be in `docs/reST/ref`.
4747
OR
48-
- Pygame docs pages have an "Edit on Github" button, which will show you the file
49-
- Download the pygame source from Github locally.
48+
- Pygame docs pages have an "Edit on GitHub" button, which will show you the file
49+
- Download the pygame source from GitHub locally.
5050
^ One way to do this is to fork and use a Git client to make that a local repository
5151
- Implement your idea.
5252
- Follow the steps in "Generating the Documentation"

docs/reST/ref/key.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ for ``KMOD_NONE``, which should be compared using equals ``==``). For example:
269269

270270
.. versionadded:: 2.2.0
271271
The collection of bools returned by ``get_pressed`` can not be iterated
272-
over because the indexes of the internal tuple does not correpsond to the
272+
over because the indexes of the internal tuple does not correspond to the
273273
keycodes.
274274

275275
.. versionadded:: 2.5.0
@@ -352,7 +352,7 @@ for ``KMOD_NONE``, which should be compared using equals ``==``). For example:
352352
corresponding key constant exists and is unique). If the return value is
353353
passed to the ``key_code`` function, the original constant will be returned.
354354

355-
**Experimental:** ``use_compat`` paramater still in development for testing and feedback. It may change.
355+
**Experimental:** ``use_compat`` parameter still in development for testing and feedback. It may change.
356356
`Please leave use_compat feedback with authors <https://github.com/pygame/pygame/pull/3312>`_
357357

358358
If this argument is ``False``, the returned name may be prettier to display

docs/reST/ref/sdl2_controller.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ events related to controllers.
225225

226226
.. versionchanged:: 2.0.2: Return type changed from ``str`` to ``dict``
227227

228-
.. ## Contorller.get_mapping ##
228+
.. ## Controller.get_mapping ##
229229
230230
.. method:: set_mapping
231231

@@ -255,7 +255,7 @@ events related to controllers.
255255
.. versionchanged:: 2.0.2: Renamed from ``add_mapping`` to ``set_mapping``
256256
.. versionchanged:: 2.0.2: Argument type changed from ``str`` to ``dict``
257257

258-
.. ## Contorller.set_mapping ##
258+
.. ## Controller.set_mapping ##
259259
260260
.. method:: rumble
261261

@@ -273,7 +273,7 @@ events related to controllers.
273273

274274
.. versionadded:: 2.0.2
275275

276-
.. ## Contorller.rumble ##
276+
.. ## Controller.rumble ##
277277
278278
.. method:: stop_rumble
279279

@@ -285,6 +285,6 @@ events related to controllers.
285285

286286
.. versionadded:: 2.0.2
287287

288-
.. ## Contorller.stop_rumble ##
288+
.. ## Controller.stop_rumble ##
289289
290290
.. ## pygame._sdl2.controller ##

docs/reST/tut/SurfarrayIntro-rest

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Transparency
2929

3030
.. comment out
3131
The surfarray module has several methods for accessing a Surface's alpha/colorkey
32-
values. None of the alpha functions are effected by overal transparency of a
32+
values. None of the alpha functions are effected by overall transparency of a
3333
Surface, just the pixel alpha values. Here's the list of those functions.
3434
<dl>
3535
<dt>``surfarray.pixels_alpha(surface)``</dt><dd>Creates a 2D array *(integer pixel values)* that references the original surface alpha data. This will only

setup.cfg

+8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ commands =
2020
pyinstaller40 =
2121
hook-dirs = pygame.__pyinstaller:get_hook_dirs
2222

23+
# ignore-words-list is a comma-separated list of lowercase words to be
24+
# ignored by codespell. Typos should be fixed but for instance Mechanim
25+
# is the name of a software product so we want codespell to ignore that.
26+
[codespell]
27+
skip = ./docs/es/*,./src_c/*,setup.py,*.json
28+
ignore-words-list = ags,ans,appen,datas,fo,likey,mechanim,nd,nin,nnumber,paeth,pevents,rocess,statics,testin
29+
quiet-level = 35
30+
2331
[isort]
2432
include_trailing_comma = True
2533
known_first_party = pygame

src_c/math.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ vector_slerp(pgVector *self, PyObject *args)
15331533
tmp = (tmp < -1 ? -1 : (tmp > 1 ? 1 : tmp));
15341534
angle = acos(tmp);
15351535

1536-
/* if t < 0 we take the long arch of the greate circle to the destiny */
1536+
/* if t < 0 we take the long arch of the great circle to the destiny */
15371537
if (t < 0) {
15381538
angle -= 2 * M_PI;
15391539
t = -t;

test/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ these module level tags.
101101
Class Level Tags
102102
----------------
103103

104-
If you want to override a specifig tag then you can use negation. ::
104+
If you want to override a specific tag then you can use negation. ::
105105

106106
class SomeTest(unittest.TestCase):
107107
__tags__ = ['-interactive']

test/display_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ class DisplayUpdateInteractiveTest(DisplayUpdateTest):
10561056
__tags__ = ["interactive"]
10571057

10581058
def question(self, qstr):
1059-
"""since this is the interactive sublcass we ask a question."""
1059+
"""since this is the interactive subclass we ask a question."""
10601060
question(qstr)
10611061

10621062

test/font_test.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def test_default_parameters(self):
281281
f = pygame_font.Font()
282282

283283
def test_get_ascent(self):
284-
# Ckecking ascent would need a custom test font to do properly.
284+
# Checking ascent would need a custom test font to do properly.
285285
f = pygame_font.Font(None, 20)
286286
ascent = f.get_ascent()
287287
self.assertTrue(isinstance(ascent, int))
@@ -290,14 +290,14 @@ def test_get_ascent(self):
290290
self.assertTrue(s.get_size()[1] > ascent)
291291

292292
def test_get_descent(self):
293-
# Ckecking descent would need a custom test font to do properly.
293+
# Checking descent would need a custom test font to do properly.
294294
f = pygame_font.Font(None, 20)
295295
descent = f.get_descent()
296296
self.assertTrue(isinstance(descent, int))
297297
self.assertTrue(descent < 0)
298298

299299
def test_get_height(self):
300-
# Ckecking height would need a custom test font to do properly.
300+
# Checking height would need a custom test font to do properly.
301301
f = pygame_font.Font(None, 20)
302302
height = f.get_height()
303303
self.assertTrue(isinstance(height, int))
@@ -306,7 +306,7 @@ def test_get_height(self):
306306
self.assertTrue(s.get_size()[1] == height)
307307

308308
def test_get_linesize(self):
309-
# Ckecking linesize would need a custom test font to do properly.
309+
# Checking linesize would need a custom test font to do properly.
310310
# Questions: How do linesize, height and descent relate?
311311
f = pygame_font.Font(None, 20)
312312
linesize = f.get_linesize()

test/test_utils/buftools.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Export the Exporter and Importer classes.
44
55
Class Exporter has configurable shape and strides. Exporter objects
6-
provide a convient target for unit tests on Pygame objects and functions that
7-
import a new buffer interface.
6+
provide a convenient target for unit tests on Pygame objects and functions
7+
that import a new buffer interface.
88
99
Class Importer imports a buffer interface with the given PyBUF_* flags.
1010
It returns NULL Py_buffer fields as None. The shape, strides, and suboffsets

test/test_utils/png.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ def wrapmapint(f):
799799
# print(len(data), len(compressed), file= >> sys.stderr)
800800
write_chunk(outfile, "IDAT", compressed)
801801
# Because of our very witty definition of ``extend``,
802-
# above, we must re-use the same ``data`` object. Hence
802+
# above, we must reuse the same ``data`` object. Hence
803803
# we use ``del`` to empty this one, rather than create a
804804
# fresh one (which would be my natural FP instinct).
805805
del data[:]

0 commit comments

Comments
 (0)