From 715dd38044324909b3e30f6af8db6514a024a1b1 Mon Sep 17 00:00:00 2001 From: Vyvy-vi Date: Sat, 3 Jul 2021 00:24:30 +0530 Subject: [PATCH] chore: add Flake8 config --- .flake8 | 25 +++++++++++++++++++++++++ requirements.dev.txt | 3 +++ src/bot.py | 2 -- src/cogs/hello_world.py | 2 +- src/cogs/standup.py | 5 +++-- 5 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 .flake8 create mode 100644 requirements.dev.txt diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..8e0ce4d --- /dev/null +++ b/.flake8 @@ -0,0 +1,25 @@ +[flake8] +max-line-length=110 +docstring-convention=all +import-order-style=pycharm +exclude=__pycache__,.cache, + .git, .github, + .md,.svg,.png, + venv,.venv, env, .env, + .yml, .json + + +ignore= + B311,W503,E226,S311,T000 + # Missing Docstrings + D100,D104,D105,D107, + # Docstring Whitespace + D203,D212,D214,D215, + # Docstring Quotes + D301,D302, + # Docstring Content + D400,D401,D402,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414,D416,D417 + # Type Annotations + ANN002,ANN003,ANN101,ANN102,ANN204,ANN206 + # Whitespace Before + E203 diff --git a/requirements.dev.txt b/requirements.dev.txt new file mode 100644 index 0000000..009394f --- /dev/null +++ b/requirements.dev.txt @@ -0,0 +1,3 @@ +black==21.6b0 +isort==5.9.1 +flake8==3.8.4 diff --git a/src/bot.py b/src/bot.py index 78ebdee..0c966f1 100644 --- a/src/bot.py +++ b/src/bot.py @@ -1,5 +1,3 @@ -import os - from discord import Intents from discord.ext import commands diff --git a/src/cogs/hello_world.py b/src/cogs/hello_world.py index ca036c9..be59de5 100644 --- a/src/cogs/hello_world.py +++ b/src/cogs/hello_world.py @@ -12,7 +12,7 @@ def __init__(self, bot): @Cog.listener() async def on_ready(self): - print(f"Bot is online! Currently running version - v%s" % META["version"]) + print("Bot is online! Currently running version - v%s" % META["version"]) @commands.command() async def ping(self, ctx: Context): diff --git a/src/cogs/standup.py b/src/cogs/standup.py index eeea1c7..211b77b 100644 --- a/src/cogs/standup.py +++ b/src/cogs/standup.py @@ -80,7 +80,8 @@ async def edit(self, ctx: Context, *, content: str = None): if not content: await ctx.send( embed=Embed( - description="Content not specified. Reuse the command with all the tasks that you'd like to replace the old tasks with\n", + description="Content not specified.\n\ +Reuse the command with all the tasks that you'd like to replace the old tasks with", color=Color.red(), ) ) @@ -104,7 +105,7 @@ async def edit(self, ctx: Context, *, content: str = None): await self.DB.update_one(record, {"$set": {"data": data}}) else: embed = Embed( - description="No previous instance or tasks were found for you. A new record has been created with the tasks mentioned.", + description="No previous records found. A new record with these tasks has been created.", color=Color.gold(), ) await ctx.create(ctx, content)