Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove old noinspection comments from PyCharm #697

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cloudbot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ async def async_main():
# define closure for signal handling
# The handler is called with two arguments: the signal number and the current stack frame
# These parameters should NOT be removed
# noinspection PyUnusedLocal
def exit_gracefully(signum, frame):
nonlocal stopped_while_restarting
if not _bot:
Expand Down
1 change: 0 additions & 1 deletion cloudbot/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ def ctcp(self, message, ctcp_type, target=None):
if not hasattr(self.conn, "ctcp"):
raise ValueError("CTCP can only be used on IRC connections")

# noinspection PyUnresolvedReferences
self.conn.ctcp(target, ctcp_type, message)

def notice(self, message, target=None):
Expand Down
1 change: 0 additions & 1 deletion cloudbot/util/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ def open_request(
return opener.open(request)


# noinspection PyShadowingBuiltins
def open(
url,
query_params=None,
Expand Down
4 changes: 0 additions & 4 deletions plugins/core/core_sieve.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def task_clear():
del buckets[uid]


# noinspection PyUnusedLocal
@hook.sieve()
def check_acls(bot: CloudBot, event: Event, _hook: Hook) -> Optional[Event]:
"""
Expand Down Expand Up @@ -50,7 +49,6 @@ def check_acls(bot: CloudBot, event: Event, _hook: Hook) -> Optional[Event]:
return event


# noinspection PyUnusedLocal
@hook.sieve()
async def perm_sieve(
bot: CloudBot, event: Event, _hook: Hook
Expand All @@ -71,7 +69,6 @@ async def perm_sieve(
return event


# noinspection PyUnusedLocal
@hook.sieve()
def check_disabled(
bot: CloudBot, event: CommandEvent, _hook: Hook
Expand All @@ -88,7 +85,6 @@ def check_disabled(
return event


# noinspection PyUnusedLocal
@hook.sieve()
def rate_limit(bot: CloudBot, event: Event, _hook: Hook) -> Optional[Event]:
"""
Expand Down
1 change: 0 additions & 1 deletion plugins/core/ignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def is_ignored(conn, chan, mask):
return False


# noinspection PyUnusedLocal
@hook.sieve(priority=50)
async def ignore_sieve(bot, event, _hook):
# don't block event hooks
Expand Down
1 change: 0 additions & 1 deletion plugins/core/optout.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ def load_cache(db):
optout_cache.update(new_cache)


# noinspection PyUnusedLocal
@hook.sieve(priority=Priority.HIGHEST)
def optout_sieve(bot, event, _hook):
if not event.chan or not event.conn:
Expand Down
5 changes: 0 additions & 5 deletions plugins/cryptocurrency.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def __new__(cls, name, bases, members):


class Schema(metaclass=SchemaMeta):
# noinspection PyUnusedName
_abstract = True
_fields = ()

Expand Down Expand Up @@ -149,7 +148,6 @@ def __init__(self, status: ResponseStatus, data: Any = None):


class Platform(Schema):
# noinspection PyShadowingBuiltins
def __init__(
self, id: int, name: str, symbol: str, slug: str, token_address: str
):
Expand Down Expand Up @@ -193,7 +191,6 @@ def __init__(


class CryptoCurrency(Schema):
# noinspection PyShadowingBuiltins
def __init__(
self,
id: int,
Expand Down Expand Up @@ -237,7 +234,6 @@ def __init__(self, data: Dict[str, CryptoCurrency], status: ResponseStatus):


class FiatCurrency(Schema):
# noinspection PyShadowingBuiltins
def __init__(self, id: int, name: str, sign: str, symbol: str):
super().__init__()
self.id = id
Expand All @@ -257,7 +253,6 @@ def __init__(self, data: List[FiatCurrency], status: ResponseStatus):


class CryptoCurrencyEntry(Schema):
# noinspection PyShadowingBuiltins
def __init__(
self,
id: int,
Expand Down
1 change: 0 additions & 1 deletion plugins/gnomeagainsthumanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def CAHblackcard(text):
"""<text> - Submit text with _ for the bot to fill in the rest. You can submit text with multiple _"""
CardText = text.strip()

# noinspection PyUnusedLocal
def blankfiller(matchobj):
return random.choice(gnomecards["white"])

Expand Down
1 change: 0 additions & 1 deletion plugins/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def pympler_diff():
if os.name == "posix":
# The handler is called with two arguments: the signal number and the current stack frame
# These parameters should NOT be removed
# noinspection PyUnusedLocal
def debug(sig, frame):
print(get_thread_dump())

Expand Down
2 changes: 0 additions & 2 deletions tests/core_tests/irc_client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ async def test_exc(self, caplog_bot, event_loop):
client = await self.make_client(event_loop)
runs = 0

# noinspection PyUnusedLocal
async def connect(timeout):
nonlocal runs
if runs == 5:
Expand Down Expand Up @@ -524,7 +523,6 @@ async def test_timeout_exc(self, caplog_bot, event_loop):
client = await self.make_client(event_loop)
runs = 0

# noinspection PyUnusedLocal
async def connect(timeout):
nonlocal runs
if runs == 5:
Expand Down
1 change: 0 additions & 1 deletion tests/core_tests/util_tests/test_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def test_truncate_str():
)


# noinspection PyPep8
def test_truncate_words():
assert (
truncate_words(
Expand Down
2 changes: 0 additions & 2 deletions tests/core_tests/util_tests/test_tokenbucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from cloudbot.util import tokenbucket


# noinspection PyProtectedMember
def test_bucket_consume():
bucket = tokenbucket.TokenBucket(10, 5)
# larger then capacity
Expand All @@ -19,7 +18,6 @@ def test_bucket_consume():
assert bucket.consume(10) is False


# noinspection PyProtectedMember
def test_bucket_advanced():
bucket = tokenbucket.TokenBucket(10, 1)
# tokens start at 10
Expand Down
1 change: 0 additions & 1 deletion tests/plugin_tests/core_sieve_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from plugins.core import core_sieve


# noinspection PyUnusedFunction
@pytest.fixture(autouse=True)
def reset_buckets() -> Iterator[None]:
"""
Expand Down