Skip to content

Commit 810b1eb

Browse files
authored
Merge pull request #2824 from cclauss/ruff-format-instead-of-black
Format Python code with ruff format instead of black
2 parents 660c851 + 34b2066 commit 810b1eb

Some content is hidden

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

47 files changed

+251
-229
lines changed

.pre-commit-config.yaml

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

77
repos:
8-
- repo: https://github.com/psf/black-pre-commit-mirror
9-
rev: 24.3.0
10-
hooks:
11-
- id: black
12-
exclude: |
13-
(?x)^(
14-
^buildconfig/.*$
15-
| ^docs/reST/.*$
16-
| setup.py
17-
)$
18-
8+
- repo: https://github.com/astral-sh/ruff-pre-commit
9+
rev: v0.4.2
10+
hooks: # See pyproject.toml for configuration options.
11+
- id: ruff-format # Run the formatter
12+
types_or: [ python, pyi, jupyter ]
1913

2014
- repo: https://github.com/pre-commit/mirrors-clang-format
21-
rev: v18.1.2
15+
rev: v18.1.4
2216
hooks:
2317
- id: clang-format
2418
exclude: |

examples/aliens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
""" pygame.examples.aliens
2+
"""pygame.examples.aliens
33
44
Shows a mini game where you have to defend against aliens.
55

examples/arraydemo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
""" pygame.examples.arraydemo
2+
"""pygame.examples.arraydemo
33
44
Welcome to the arraydemo!
55

examples/audiocapture.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/usr/bin/env python
2-
""" pygame.examples.audiocapture
2+
"""pygame.examples.audiocapture
33
44
A pygame 2 experiment.
55
66
* record sound from a microphone
77
* play back the recorded sound
88
"""
9+
910
import pygame
1011
import time
1112

examples/blend_fill.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
""" pygame.examples.blend_fill
2+
"""pygame.examples.blend_fill
33
44
BLEND_ing colors in different ways with Surface.fill().
55
@@ -10,6 +10,7 @@
1010
* A - ADD, S- SUB, M- MULT, - MIN, + MAX to change the blend modes
1111
1212
"""
13+
1314
import os
1415
import pygame
1516
from pygame import K_1, K_2, K_3, K_4, K_5, K_6, K_7, K_8, K_9

examples/blit_blends.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
""" pygame.examples.blit_blends
2+
"""pygame.examples.blit_blends
33
44
Blending colors in different ways with different blend modes.
55
@@ -19,6 +19,7 @@
1919
* 1, 2, 3, 4 - use different images.
2020
2121
"""
22+
2223
import os
2324
import pygame
2425
import time

examples/camera.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
""" pygame.examples.camera
2+
"""pygame.examples.camera
33
44
Basic image capturing and display using pygame.camera
55
@@ -11,6 +11,7 @@
1111
- 9, start camera 9.
1212
- 10, start camera... wait a minute! There's not 10 key!
1313
"""
14+
1415
import pygame
1516
import pygame.camera
1617

examples/chimp.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
#!/usr/bin/env python
2-
""" pygame.examples.chimp
2+
"""pygame.examples.chimp
33
44
This simple example is used for the line-by-line tutorial
55
that comes with pygame. It is based on a 'popular' web banner.
66
Note there are comments here, but for the full explanation,
77
follow along in the tutorial.
88
"""
99

10-
1110
# Import Modules
1211
import os
1312
import pygame

examples/cursors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
""" pygame.examples.cursors
2+
"""pygame.examples.cursors
33
Click a button and the cursor will change.
44
This example will show you:
55
*The different types of cursors that exist

examples/dropevent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
""" pygame.examples.dropfile
2+
"""pygame.examples.dropfile
33
44
Drag and drop an image on here.
55
@@ -10,6 +10,7 @@
1010
* DROPTEXT
1111
* DROPFILE
1212
"""
13+
1314
import pygame
1415

1516
pygame.init()

0 commit comments

Comments
 (0)