Skip to content

Commit 33af9f8

Browse files
committed
Fix whitespace and eof formatting with pre-commit
1 parent 72af0f0 commit 33af9f8

File tree

107 files changed

+648
-666
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+648
-666
lines changed

.github/ISSUE_TEMPLATE/blank_issue.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: 🗎 Blank Issue
33
about: A blank issue. For those who know what they are doing.
44
title: ''
5-
labels:
5+
labels:
66
assignees: ''
77

8-
---
8+
---

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ assignees: ''
1111

1212
**Environment:**
1313

14-
If possible, please include the output of `pygame.print_debug_info()` from your program in your bug report. It looks something
14+
If possible, please include the output of `pygame.print_debug_info()` from your program in your bug report. It looks something
1515
like this:
1616

1717
```
@@ -33,7 +33,7 @@ Freetype versions: Linked: 2.11.1 Compiled: 2.11.1
3333
Display Driver: windows
3434
Mixer Driver: wasapi
3535
```
36-
If you can't get the debug output, any of the environment details included in it that you do know would be useful
36+
If you can't get the debug output, any of the environment details included in it that you do know would be useful
3737
in diagnosing the issue & helping you.
3838

3939
Other environment details, not included in `print_debug_info()`, that might help:

.github/ISSUE_TEMPLATE/enhancement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ assignees: ''
99

1010
**Description**
1111

12-
Describe your enhancement, as clearly as possible.
12+
Describe your enhancement, as clearly as possible.

.github/workflows/build-debian-multiarch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
export SDL_VIDEODRIVER=dummy
108108
export SDL_AUDIODRIVER=disk
109109
python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300
110-
110+
111111
# Upload the generated files under github actions assets section
112112
- name: Upload dist
113113
uses: actions/upload-artifact@v4

.github/workflows/build-macos.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: macOS
22

3-
# Run CI only when a release is created, on changes to main branch, or any PR
4-
# to main. Do not run CI on any other branch. Also, skip any non-source changes
3+
# Run CI only when a release is created, on changes to main branch, or any PR
4+
# to main. Do not run CI on any other branch. Also, skip any non-source changes
55
# from running on CI
66
on:
77
push:
@@ -27,7 +27,7 @@ on:
2727
- '.github/workflows/*.yml'
2828
# re-include current file to not be excluded
2929
- '!.github/workflows/build-macos.yml'
30-
30+
3131
# the github release drafter can call this workflow
3232
workflow_call:
3333

@@ -54,7 +54,7 @@ jobs:
5454
uses: actions/cache@v4.0.2
5555
with:
5656
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
57-
# The hash of all files in buildconfig manylinux-build and macdependencies is
57+
# The hash of all files in buildconfig manylinux-build and macdependencies is
5858
# the key to the cache. If anything changes here, the deps are built again
5959
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}-${{ matrix.os }}
6060
lookup-only: true
@@ -145,4 +145,3 @@ jobs:
145145
name: pygame-wheels-macos-${{ matrix.macarch }}
146146
path: ./wheelhouse/*.whl
147147
compression-level: 0 # wheels are already zip files, no need for more compression
148-

.github/workflows/build-manylinux.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: ManyLinux
22

3-
# Run CI only when a release is created, on changes to main branch, or any PR
4-
# to main. Do not run CI on any other branch. Also, skip any non-source changes
3+
# Run CI only when a release is created, on changes to main branch, or any PR
4+
# to main. Do not run CI on any other branch. Also, skip any non-source changes
55
# from running on CI
66
on:
77
push:
@@ -27,7 +27,7 @@ on:
2727
- '.github/workflows/*.yml'
2828
# re-include current file to not be excluded
2929
- '!.github/workflows/build-manylinux.yml'
30-
30+
3131
# the github release drafter can call this workflow
3232
workflow_call:
3333

@@ -42,12 +42,12 @@ jobs:
4242
permissions:
4343
contents: read
4444
packages: write
45-
45+
4646
strategy:
4747
fail-fast: false # if a particular matrix build fails, don't skip the rest
4848
matrix:
4949
arch: [x86_64, i686]
50-
50+
5151
env:
5252
CIBW_ARCHS: ${{ matrix.arch }}
5353

@@ -60,7 +60,7 @@ jobs:
6060
registry: ghcr.io
6161
username: ${{ github.actor }}
6262
password: ${{ secrets.GITHUB_TOKEN }}
63-
63+
6464
- name: Inspect image, skip build if image exists
6565
id: inspect
6666
continue-on-error: true
@@ -100,4 +100,3 @@ jobs:
100100
name: pygame-wheels-manylinux-${{ matrix.arch }}
101101
path: ./wheelhouse/*.whl
102102
compression-level: 0 # wheels are already zip files, no need for more compression
103-

.github/workflows/build-ubuntu-sdist.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
name: Ubuntu sdist
99

10-
# Run CI only when a release is created, on changes to main branch, or any PR
11-
# to main. Do not run CI on any other branch. Also, skip any non-source changes
10+
# Run CI only when a release is created, on changes to main branch, or any PR
11+
# to main. Do not run CI on any other branch. Also, skip any non-source changes
1212
# from running on CI
1313
on:
1414
push:
@@ -34,7 +34,7 @@ on:
3434
- '.github/workflows/*.yml'
3535
# re-include current file to not be excluded
3636
- '!.github/workflows/build-ubuntu-sdist.yml'
37-
37+
3838
# the github release drafter can call this workflow
3939
workflow_call:
4040

@@ -44,7 +44,7 @@ concurrency:
4444

4545
jobs:
4646
build:
47-
runs-on: ${{ matrix.os }}
47+
runs-on: ${{ matrix.os }}
4848
strategy:
4949
fail-fast: false # if a particular matrix build fails, don't skip the rest
5050
matrix:
@@ -74,7 +74,7 @@ jobs:
7474
SDL_VIDEODRIVER: "dummy"
7575
SDL_AUDIODRIVER: "disk"
7676
run: python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300
77-
77+
7878
- name: Test typestubs
7979
if: matrix.os == 'ubuntu-22.04' # run stubtest only once
8080
run: |
@@ -89,4 +89,3 @@ jobs:
8989
name: pygame-wheels-sdist
9090
path: dist/*.tar.gz
9191
compression-level: 0 # already compressed, no need for more compression
92-

.github/workflows/build-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ on:
2727
- '.github/workflows/*.yml'
2828
# re-include current file to not be excluded
2929
- '!.github/workflows/build-windows.yml'
30-
30+
3131
# the github release drafter can call this workflow
3232
workflow_call:
3333

.pre-commit-config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@
55
# Then in the project root directory run `pre-commit install`
66

77
repos:
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: v4.6.0
10+
hooks:
11+
- id: end-of-file-fixer
12+
exclude: |
13+
(?x)^(
14+
^docs/licenses/.*$
15+
| ^.*\.svg$
16+
| ^.*\.sfd$
17+
| docs/LGPL.txt
18+
)$
19+
- id: trailing-whitespace
20+
exclude: |
21+
(?x)^(
22+
^docs/licenses/.*$
23+
| ^.*\.svg$
24+
| ^.*\.sfd$
25+
| docs/LGPL.txt
26+
)$
27+
828
- repo: https://github.com/astral-sh/ruff-pre-commit
929
rev: v0.4.2
1030
hooks: # See pyproject.toml for configuration options.

buildconfig/Setup.Emscripten.SDL2.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,3 @@ _sdl2.touch src_c/void.c
7575

7676
#transform src_c/simd_transform_sse2.c src_c/simd_transform_avx2.c src_c/transform.c src_c/rotozoom.c src_c/scale2x.c src_c/scale_mmx.c src_c/simd_surface_fill_avx2.c src_c/simd_surface_fill_sse2.c $(SDL) $(DEBUG) -D_NO_MMX_FOR_X86_64
7777
transform src_c/void.c
78-
79-

buildconfig/ci/circleci/pull_circleci_artifacts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
A script to automate downloading CircleCI artifacts.
33
44
Usage: python3 pull_circleci_artifacts.py <TOKEN> <PIPELINE_ID> <SAVE_DIR>
5-
TOKEN:
5+
TOKEN:
66
CircleCI "personal access token" of a github (preferably machine) user.
77
This is secret!
88

buildconfig/config_emsdk.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,3 @@ def main(auto_config=False):
267267
if __name__ == "__main__":
268268
print("This is the configuration subscript for Emscripten.")
269269
print('Please run "config.py" for full configuration.')
270-

buildconfig/config_unix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def main(auto_config=False):
141141
origincdirs = ['/include', '/include/SDL2']
142142
origlibdirs = ['/lib', '/lib64', '/X11R6/lib']
143143

144-
# If we are on a debian based system, we also need to handle
144+
# If we are on a debian based system, we also need to handle
145145
# /lib/<multiarch-tuple>
146146
# We have a few commands to get the correct <multiarch-tuple>, we try those
147147
# one by one till we get something that works

buildconfig/config_win.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def _add_sdl2_dll_deps(DEPS):
372372
DEPS.add_dll(r'(z|zlib1)\.dll$', 'z', ['zlib-[1-9].*'])
373373
DEPS.add_dll(r'(lib)?webp[-0-9]*\.dll$', 'webp', ['*webp-[0-9]*'])
374374
DEPS.add_dll(r'(lib)?webpdemux[-0-9]*\.dll$', 'webpdemux', ['*webpdemux-[0-9]*'])
375-
375+
376376

377377
def setup():
378378
DEPS = DependencyGroup()

buildconfig/macdependencies/README.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ fi
3232
It currently relies on GNU `readlink` to build, which is provided
3333
by the coreutils homebrew package. However, this could be fixed to be
3434
cross platform, since mac `readlink` does not support `-f`.
35-

buildconfig/manylinux-build/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ push-manylinux2014-x86:
7070

7171
push-manylinux2014-aarch64:
7272
docker push pygame/manylinux2014_base_aarch64
73-
73+
7474
# push: push-manylinux1-x64 push-manylinux1-x86 push-manylinux2010-x64 push-manylinux2010-x86 push-manylinux2014-x64 push-manylinux2014-x86
7575
push: push-manylinux2010-x64 push-manylinux2010-x86 push-manylinux2014-x64 push-manylinux2014-x86 push-manylinux2014-aarch64
7676

buildconfig/manylinux-build/docker_base/Dockerfile-aarch64

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,3 @@ RUN ["bash", "/portmidi_build/build-portmidi.sh"]
163163
# run strip on built libraries
164164
COPY strip-lib-so-files.sh /tmp/
165165
RUN source /tmp/strip-lib-so-files.sh
166-

buildconfig/manylinux-build/docker_base/alsa/build-alsa.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ tar xjf ${ALSA}.tar.bz2
1111
cd ${ALSA}
1212

1313
# alsa prefers /usr prefix as a default, so we explicitly override it
14-
./configure $PG_BASE_CONFIGURE_FLAGS --with-configdir=$PG_DEP_PREFIX/share/alsa
14+
./configure $PG_BASE_CONFIGURE_FLAGS --with-configdir=$PG_DEP_PREFIX/share/alsa
1515
make
1616
make install

buildconfig/manylinux-build/docker_base/buildtools/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e -x
44
cd $(dirname `readlink -f "$0"`)
55

66
# This file installs tools (cmake and meson+ninja) needed to build dependencies
7-
# Also installs setuptools to make sure distutils is available (on newer python
7+
# Also installs setuptools to make sure distutils is available (on newer python
88
# versions) because some builds may need it.
99
# cmake is also installed via pip because it is easier than maintaining a
1010
# separate build script for it

buildconfig/manylinux-build/docker_base/glib/build-glib.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ meson setup _build $PG_BASE_MESON_FLAGS --force-fallback-for libpcre2-8 -Dtests=
2020

2121
meson compile -C _build
2222
meson install -C _build
23-

buildconfig/manylinux-build/docker_base/libmodplug/build-libmodplug.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ cd ${MODPLUG_NAME}
1515
./configure $PG_BASE_CONFIGURE_FLAGS
1616
make
1717
make install
18-

buildconfig/manylinux-build/docker_base/libpng/build-png.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ cd $PNG
1414
./configure --with-zlib-prefix=$PG_DEP_PREFIX $PG_BASE_CONFIGURE_FLAGS
1515
make
1616
make install
17-

buildconfig/manylinux-build/docker_base/mesa/mesa/build-mesa.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e -x
33

44
cd $(dirname `readlink -f "$0"`)
55

6-
# We need mesa for opengl, gbm (SDL kmsdrm driver needs it), egl (SDL
6+
# We need mesa for opengl, gbm (SDL kmsdrm driver needs it), egl (SDL
77
# wayland driver needs this) and glx (SDL needs it)
88
# we don't support vulkan yet
99

@@ -21,7 +21,7 @@ cd $MESA
2121
if [ `uname -m` == "aarch64" ]; then
2222
# On aarch64 we allow mesa to use all drivers it wants to pick by default
2323
# (because radeonsi is not used on arm platforms)
24-
GALLIUM_DRIVERS="auto"
24+
GALLIUM_DRIVERS="auto"
2525
else
2626
# all default except radeonsi
2727
GALLIUM_DRIVERS="r300,r600,nouveau,virgl,svga,swrast,iris,crocus,i915"

buildconfig/manylinux-build/docker_base/ogg/build-ogg.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
3636
fi
3737
make
3838
make install
39-

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# This file exists because pkg-config is too old on manylinux docker centos
3+
# This file exists because pkg-config is too old on manylinux docker centos
44
# images (the older version segfaults if it gets a cyclic dependency, like
55
# freetype2+harfbuzz)
66

buildconfig/manylinux-build/docker_base/sdl_libs/build-sdl2-libs.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,3 @@ cd $MIX2
114114

115115
make
116116
make install
117-

buildconfig/manylinux-build/docker_base/sndfile/build-sndfile.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ cd $SNDNAME
1717
./configure $PG_BASE_CONFIGURE_FLAGS --disable-mpeg --disable-alsa
1818
make
1919
make install
20-

buildconfig/manylinux-build/docker_base/zlib-ng/build-zlib-ng.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ cd ${ZLIB_NG_NAME}
1414
cmake . $PG_BASE_CMAKE_FLAGS -DZLIB_COMPAT=1
1515
make
1616
make install
17-

buildconfig/manylinux-build/docker_base/zlib/build-zlib.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ cd ${ZLIB_NAME}
1414
./configure $PG_BASE_CONFIGURE_FLAGS
1515
make
1616
make install
17-

buildconfig/stubs/gen_stubs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"window": ["Window"],
7575
"base": ["__version__"], # need an explicit import
7676
# uncomment below line if Circle is added to the base namespace later
77-
# "geometry": ["Circle"],
77+
# "geometry": ["Circle"],
7878
}
7979

8080
# pygame modules from which __init__.py does the equivalent of
@@ -153,7 +153,7 @@ def get_all(mod: Any):
153153
for element in get_all(pygame.locals):
154154
constant_type = getattr(pygame.locals, element).__class__.__name__
155155
f.write(f"{element}: {constant_type}\n")
156-
156+
157157
# copy typing.py to typing.pyi for type checkers
158158
typing_py_file = pathlib.Path(__file__).parent.parent.parent / "src_py" / "typing.py"
159159
typing_stub_file = pathlib.Path(__file__).parent / "pygame" / "typing.pyi"

buildconfig/stubs/mypy_allow_list.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# cython files have this top level dunder
66
pygame\._sdl2\..*\.__test__
77

8-
# cython classes have some special dunders for internal use, ignore that in
8+
# cython classes have some special dunders for internal use, ignore that in
99
# stubtest
1010
pygame\._sdl2\..*\.__pyx_.*__
1111

buildconfig/stubs/pygame/rect.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class _GenericRect(Collection[_N]):
280280
# Sized, Iterable and Container ABCs
281281
class Rect(_GenericRect[int]):
282282
...
283-
283+
284284
class FRect(_GenericRect[float]):
285285
...
286286

buildconfig/stubs/pygame/sprite.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class Group(AbstractGroup[_TSprite]):
181181
def __init__(
182182
self, *sprites: Union[_TSprite, AbstractGroup[_TSprite], Iterable[_TSprite]]
183183
) -> None: ...
184-
184+
185185
# these are aliased in the code too
186186
@deprecated("Use `pygame.sprite.Group` instead")
187187
class RenderPlain(Group): ...

0 commit comments

Comments
 (0)