Skip to content

Commit 1ad1c70

Browse files
committed
Remove invalid noinspections
1 parent 536720f commit 1ad1c70

7 files changed

Lines changed: 16 additions & 14 deletions

File tree

docs/add_widgets.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ def make_menu(
6363
)
6464

6565

66-
# noinspection PyMissingTypeHints,PyMissingOrEmptyDocstring
67-
def change_background_color(selected_value, color, **kwargs):
66+
def change_background_color(selected_value: tuple, color: tuple, **kwargs):
67+
"""Change background color."""
6868
from random import randrange
6969

7070
value_tuple, _ = selected_value
@@ -78,8 +78,8 @@ def change_background_color(selected_value, color, **kwargs):
7878
widget.get_selection_effect().color = color
7979

8080

81-
# noinspection PyMissingTypeHints,PyMissingOrEmptyDocstring
82-
def func(name):
81+
def func(name: str):
82+
"""Example function."""
8383
print("Hello world from", name) # name will be 'foo'
8484

8585

@@ -299,13 +299,15 @@ def func(name):
299299
menu2 = make_menu(pygame_menu.themes.THEME_GREEN, "Menu 2")
300300
menu3 = make_menu(pygame_menu.themes.THEME_SOLARIZED, "Menu 3")
301301

302+
302303
def open_link(*args) -> None:
303304
"""
304305
Opens link.
305306
"""
306307
link: pygame_menu.widgets.MenuLink = args[-1]
307308
link.open()
308309

310+
309311
# Create the links
310312
link1 = menu.add.menu_link(menu1)
311313
link2 = menu.add.menu_link(menu2)

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989

9090
# -- Options for LaTeX output -------------------------------------------------
9191

92-
# noinspection SpellCheckingInspection
9392
latex_elements = {
9493
"papersize": "a4paper",
9594
"pointsize": "10pt",

pygame_menu/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@
9191
menu,
9292
sound,
9393
themes,
94-
widgets, # type: ignore
9594
version, # type: ignore
95+
widgets, # type: ignore
9696
)
9797

9898
BaseImage = baseimage.BaseImage

pygame_menu/_decorator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
DECOR_TYPE_POST: str = "post"
6767

6868

69-
# noinspection PyProtectedMember
7069
class Decorator(Base):
7170
"""
7271
Decorator class.

pygame_menu/examples/other/maze.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
WHITE = (255, 255, 255)
4242

4343

44-
# noinspection PyMissingOrEmptyDocstring
4544
class AStarQueue:
4645
"""
4746
A* Queue.
@@ -51,17 +50,19 @@ def __init__(self) -> None:
5150
self.myheap = []
5251

5352
def show(self):
53+
"""Show the heap."""
5454
return self.myheap
5555

5656
def push(self, priority, distance, node) -> None:
57+
"""Put the node into heap."""
5758
heapq.heappush(self.myheap, (priority, distance, node))
5859

5960
def pop(self):
61+
"""Remove the heap item and return it."""
6062
priority, distance, node = heapq.heappop(self.myheap)
6163
return priority, distance, node
6264

6365

64-
# noinspection PyMissingOrEmptyDocstring
6566
class PriorityQueue:
6667
"""
6768
Priority Queue.
@@ -71,17 +72,19 @@ def __init__(self) -> None:
7172
self.myheap = []
7273

7374
def show(self):
75+
"""Show the heap."""
7476
return self.myheap
7577

7678
def push(self, priority, node) -> None:
79+
"""Put the node into heap."""
7780
heapq.heappush(self.myheap, (priority, node))
7881

7982
def pop(self):
83+
"""Remove the heap item and return it."""
8084
priority, node = heapq.heappop(self.myheap)
8185
return priority, node
8286

8387

84-
# noinspection PyMissingOrEmptyDocstring
8588
class PrioritySet:
8689
"""
8790
Create a priority queue that doesn't add duplicate nodes.
@@ -92,14 +95,17 @@ def __init__(self) -> None:
9295
self.myset = set()
9396

9497
def show(self):
98+
"""Show the heap."""
9599
return self.myheap
96100

97101
def push(self, priority, node) -> None:
102+
"""Put the node into heap."""
98103
if node not in self.myset:
99104
heapq.heappush(self.myheap, (priority, node))
100105
self.myset.add(node)
101106

102107
def pop(self):
108+
"""Remove the heap item and return it."""
103109
priority, node = heapq.heappop(self.myheap)
104110
self.myset.remove(node)
105111
return priority, node

pygame_menu/sound.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ def __init__(
195195
# Set sound as initialized globally
196196
SOUND_INITIALIZED.attempted = True
197197

198-
# noinspection PyBroadException
199198
try:
200199
# pygame < 1.9.5
201200
mixer_kwargs: dict[str, int | str] = {
@@ -213,7 +212,6 @@ def __init__(
213212

214213
# Call to mixer
215214
mixer.init(**mixer_kwargs)
216-
217215
except Exception as e:
218216
if self._verbose:
219217
warn("sound error: " + str(e))

pygame_menu/widgets/core/widget.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2291,7 +2291,6 @@ def _scale_warn(
22912291
:param maxwidth: Warn bout maxwidth
22922292
:param maxheight: Warn about maxheight
22932293
"""
2294-
# noinspection PyUnresolvedReferences
22952294
if not self._verbose:
22962295
return
22972296
# Iterate each type and warn accordingly
@@ -3306,7 +3305,6 @@ def _get_status(self) -> tuple[Any, ...]:
33063305
data.append(ww._get_status())
33073306

33083307
# Append inner widgets if drop select
3309-
# noinspection PyUnresolvedReferences
33103308
if (
33113309
isinstance(self, pygame_menu.widgets.DropSelect)
33123310
and hasattr(self, "_drop_frame")

0 commit comments

Comments
 (0)