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

Fix Linting #254

Merged
merged 1 commit into from
Dec 1, 2023
Merged
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: 1 addition & 0 deletions autoreact/autoreact.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

log = logging.getLogger("red.rhomelab.autoreact")


class AutoReactCog(commands.Cog):
"""AutoReact Cog"""

Expand All @@ -31,7 +32,7 @@
self.config.register_guild(**default_guild_config)

@commands.Cog.listener()
async def on_message(self, message: discord.Message):

Check warning on line 35 in autoreact/autoreact.py

View workflow job for this annotation

GitHub Actions / lint-pylint

Missing function or method docstring

Check warning on line 35 in autoreact/autoreact.py

View workflow job for this annotation

GitHub Actions / lint-flake8

'AutoReactCog.on_message' is too complex (12)
if message.author.bot or not message.guild:
return

Expand Down Expand Up @@ -289,7 +290,7 @@

# Helper functions

async def remove_reaction(self, guild: discord.Guild, phrase: str, reaction: str):

Check warning on line 293 in autoreact/autoreact.py

View workflow job for this annotation

GitHub Actions / lint-pylint

Missing function or method docstring
async with self.config.guild(guild).reactions() as reactions:
# Delete the whole kv pair if len 1
if len(reactions[phrase]) == 1:
Expand All @@ -298,7 +299,7 @@
elif len(reactions[phrase]) > 1:
reactions[phrase].remove(reactions[reaction])

async def ordered_list_from_config(self, guild, object_type="reactions"):

Check warning on line 302 in autoreact/autoreact.py

View workflow job for this annotation

GitHub Actions / lint-pylint

Missing function or method docstring
items = []
if object_type == "reactions":
async with self.config.guild(guild).reactions() as reactions:
Expand All @@ -318,9 +319,9 @@

return items

async def make_error_embed(self, ctx, error_type: str = ""):

Check warning on line 322 in autoreact/autoreact.py

View workflow job for this annotation

GitHub Actions / lint-pylint

Missing function or method docstring
error_msgs = {
"InvalidObjectType": "Invalid object. Please provide a valid object type from reactions, channels, whitelisted channels",

Check warning on line 324 in autoreact/autoreact.py

View workflow job for this annotation

GitHub Actions / lint-pylint

Line too long (133/127)

Check warning on line 324 in autoreact/autoreact.py

View workflow job for this annotation

GitHub Actions / lint-flake8

line too long (133 > 127 characters)
"ChannelInWhitelist": "This channel is already in the whitelist",
"ChannelNotFound": "Channel not found in config",
"NoConfiguration": "No configuration has been set for this object",
Expand All @@ -338,7 +339,7 @@
for i in range(0, len(full_list), chunk_size):
yield full_list[i : i + chunk_size]

async def make_embed_list(self, ctx, object_type: str, items: list):

Check warning on line 342 in autoreact/autoreact.py

View workflow job for this annotation

GitHub Actions / lint-pylint

Missing function or method docstring

Check warning on line 342 in autoreact/autoreact.py

View workflow job for this annotation

GitHub Actions / lint-flake8

'AutoReactCog.make_embed_list' is too complex (11)
if not items:
return []

Expand Down Expand Up @@ -367,7 +368,7 @@
value=" ".join(elem["reactions"]),
inline=True,
)
embed.add_field(name="​", value="​", inline=True) # ZWJ field

Check warning on line 371 in autoreact/autoreact.py

View workflow job for this annotation

GitHub Actions / lint-pylint

Invalid unescaped character zero-width-space, use "\u200B" instead.

Check warning on line 371 in autoreact/autoreact.py

View workflow job for this annotation

GitHub Actions / lint-pylint

Invalid unescaped character zero-width-space, use "\u200B" instead.
embed_list.append(embed)

elif object_type in ("whitelisted channels", "whitelisted_channels"):
Expand Down
Loading