Skip to content

Commit 313e36e

Browse files
authored
Update pre-commit config (#847)
* Update pre-commit * Fix (or ignore) new pre-commit warnings
1 parent dae2a93 commit 313e36e

File tree

4 files changed

+46
-47
lines changed

4 files changed

+46
-47
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
22
repos:
33
- repo: https://github.com/adrienverge/yamllint.git
4-
rev: v1.35.1
4+
rev: v1.37.0
55
hooks:
66
- id: yamllint
77
- repo: https://github.com/psf/black
8-
rev: 24.3.0
8+
rev: 25.1.0
99
hooks:
1010
- id: black
1111
files: ^Support/
1212
language_version: python3
1313
- repo: https://github.com/pycqa/flake8
14-
rev: 7.0.0
14+
rev: 7.2.0
1515
hooks:
1616
- id: flake8
1717
files: ^Support/
1818
- repo: https://github.com/PyCQA/pylint.git
19-
rev: v3.1.0
19+
rev: v3.3.6
2020
hooks:
2121
- id: pylint
2222
name: pylint
@@ -28,7 +28,7 @@ repos:
2828
- --load-plugins=pylint.extensions.redefined_variable_type,pylint.extensions.bad_builtin
2929
- --disable=import-error
3030
- repo: https://github.com/google/yamlfmt
31-
rev: v0.11.0
31+
rev: v0.16.0
3232
hooks:
3333
- id: yamlfmt
3434
args:

Support/Python/unitybuild/utils.py

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -76,44 +76,44 @@ def msys_control_c_workaround():
7676
# abruptly ~100ms after the process receives SIGINT. This prevents us
7777
# from running cleanup handlers, like the one that kills the Unity.exe
7878
# subprocess.
79-
if not os.getenv("MSYSTEM"):
80-
return
81-
82-
kernel32 = ctypes.windll.kernel32
83-
kernel32.GetStdHandle.restype = HANDLE
84-
kernel32.GetStdHandle.argtypes = (DWORD,)
85-
# kernel32.GetConsoleMode.restype = BOOL
86-
kernel32.GetConsoleMode.argtypes = (HANDLE, ctypes.POINTER(DWORD))
87-
# kernel32.SetConsoleMode.restype = BOOL
88-
kernel32.SetConsoleMode.argtypes = (HANDLE, DWORD)
89-
STD_INPUT_HANDLE = DWORD(-10)
90-
ENABLE_PROCESSED_INPUT = DWORD(1)
91-
92-
stdin = kernel32.GetStdHandle(STD_INPUT_HANDLE)
93-
mode = DWORD()
94-
kernel32.GetConsoleMode(stdin, ctypes.byref(mode))
95-
mode.value = mode.value & ~(ENABLE_PROCESSED_INPUT.value)
96-
kernel32.SetConsoleMode(stdin, mode)
97-
98-
# interrupt_main won't interrupt WaitForSingleObject, so monkey-patch
99-
def polling_wait(self):
100-
while (
101-
WaitForSingleObject(self._handle, 3000) # pylint: disable=protected-access
102-
!= WAIT_OBJECT_0
103-
):
104-
continue
105-
return self.poll()
106-
107-
subprocess.Popen.wait = polling_wait
108-
109-
def look_for_control_c():
110-
while msvcrt.getch() != "\x03":
111-
continue
112-
_thread.interrupt_main()
113-
114-
t = threading.Thread(target=look_for_control_c)
115-
t.daemon = True
116-
t.start()
79+
if os.getenv("MSYSTEM"):
80+
kernel32 = ctypes.windll.kernel32
81+
kernel32.GetStdHandle.restype = HANDLE
82+
kernel32.GetStdHandle.argtypes = (DWORD,)
83+
# kernel32.GetConsoleMode.restype = BOOL
84+
kernel32.GetConsoleMode.argtypes = (HANDLE, ctypes.POINTER(DWORD))
85+
# kernel32.SetConsoleMode.restype = BOOL
86+
kernel32.SetConsoleMode.argtypes = (HANDLE, DWORD)
87+
STD_INPUT_HANDLE = DWORD(-10)
88+
ENABLE_PROCESSED_INPUT = DWORD(1)
89+
90+
stdin = kernel32.GetStdHandle(STD_INPUT_HANDLE)
91+
mode = DWORD()
92+
kernel32.GetConsoleMode(stdin, ctypes.byref(mode))
93+
mode.value = mode.value & ~(ENABLE_PROCESSED_INPUT.value)
94+
kernel32.SetConsoleMode(stdin, mode)
95+
96+
# interrupt_main won't interrupt WaitForSingleObject, so monkey-patch
97+
def polling_wait(self):
98+
while (
99+
WaitForSingleObject(
100+
self._handle, 3000 # pylint: disable=protected-access
101+
)
102+
!= WAIT_OBJECT_0
103+
):
104+
continue
105+
return self.poll()
106+
107+
subprocess.Popen.wait = polling_wait
108+
109+
def look_for_control_c():
110+
while msvcrt.getch() != "\x03":
111+
continue
112+
_thread.interrupt_main()
113+
114+
t = threading.Thread(target=look_for_control_c)
115+
t.daemon = True
116+
t.start()
117117

118118

119119
def get_file_version(filename):

Support/bin/animateTriangles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def animate(
228228
class Substroke: # pylint: disable=too-many-instance-attributes
229229
def __init__(
230230
self, stroke, startVert, vertCount, startIndex, indexCount
231-
): # pylint: disable=too-many-arguments
231+
): # pylint: disable=too-many-arguments,too-many-positional-arguments
232232
self.stroke = stroke
233233
self.startVert = startVert
234234
self.vertCount = vertCount
@@ -343,7 +343,7 @@ def __init__(
343343
indexOffsets,
344344
indexCounts,
345345
displayOpacity,
346-
): # pylint: disable=too-many-arguments
346+
): # pylint: disable=too-many-arguments,too-many-positional-arguments
347347
self.dirty = True
348348
self.adj = 2 * random.random()
349349
self.prim = prim

Support/bin/tbdroid.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def upload_sketch(sketchname):
110110

111111
def profile_sketches(
112112
sketches, reps, csv, configtemplate, lod, skip
113-
): # pylint: disable=too-many-arguments
113+
): # pylint: disable=too-many-arguments,too-many-positional-arguments
114114
try:
115115
enable_powersaving(False)
116116
save_config()
@@ -263,7 +263,6 @@ def save_config():
263263

264264

265265
def restore_config():
266-
global configcopy # pylint: disable=global-statement,global-variable-not-assigned
267266
if configcopy:
268267
upload_config(configcopy)
269268
else:

0 commit comments

Comments
 (0)