Skip to content

Commit b637335

Browse files
committed
Update pylint config
1 parent ff6def0 commit b637335

File tree

6 files changed

+18
-14
lines changed

6 files changed

+18
-14
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ main ]
16+
branches: [main]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ main ]
19+
branches: [main]
2020
schedule:
21-
- cron: '17 23 * * 6'
21+
- cron: '17 23 * * 6'
2222

2323
jobs:
2424
analyze:
@@ -32,7 +32,7 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'python' ]
35+
language: ['python']
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
3737
# Learn more:
3838
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

.pylintrc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ confidence=
6262
# --disable=W".
6363
disable=invalid-name,
6464
missing-docstring,
65+
consider-using-f-string,
66+
consider-using-dict-items,
67+
consider-using-with,
68+
consider-using-min-builtin,
69+
arguments-renamed,
70+
use-maxsplit-arg,
71+
consider-iterating-dictionary,
6572
redefined-outer-name,
6673
unused-argument,
6774
broad-except,
@@ -87,7 +94,7 @@ disable=invalid-name,
8794
# either give multiple identifier separated by comma (,) or put this option
8895
# multiple time (only on the command line, not in the configuration file where
8996
# it should appear only once). See also the "--disable" option for examples.
90-
enable=
97+
enable=c-extension-no-member
9198

9299

93100
[REPORTS]

plugins/profiling.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import signal
23
import sys
34
import threading
@@ -122,17 +123,12 @@ def pympler_diff():
122123
return "Printed to console"
123124

124125

125-
try:
126-
SIGUSR1 = getattr(signal, "SIGUSR1")
127-
except AttributeError:
128-
SIGUSR1 = None
129-
130126
# # Provide an easy way to get a threaddump, by using SIGUSR1 (only on POSIX systems)
131-
if SIGUSR1 is not None:
127+
if os.name == "posix":
132128
# The handler is called with two arguments: the signal number and the current stack frame
133129
# These parameters should NOT be removed
134130
# noinspection PyUnusedLocal
135131
def debug(sig, frame):
136132
print(get_thread_dump())
137133

138-
signal.signal(SIGUSR1, debug) # Register handler
134+
signal.signal(signal.SIGUSR1, debug) # Register handler

plugins/tvdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class Holder(Generic[T]):
209209
"""
210210

211211
def __init__(self) -> None:
212-
self._item: Optional[T] = None
212+
self._item = None # type: Optional[T]
213213
self._set = False
214214

215215
def set(self, item: T) -> None:

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def mock_api_keys():
9292
mock_bot = MagicMock()
9393
try:
9494
bot.set(mock_bot)
95+
# pylint: disable=no-member
9596
mock_bot.config.get_api_key.return_value = "APIKEY"
9697
yield mock_bot
9798
finally:

tests/core_tests/irc_client_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
import pytest
88

9-
import cloudbot.clients.irc as irc
109
from cloudbot.client import ClientConnectError
10+
from cloudbot.clients import irc
1111
from cloudbot.event import Event, EventType
1212
from cloudbot.util import async_util
1313
from tests.util.async_mock import AsyncMock

0 commit comments

Comments
 (0)