From 0048e81666d6477c32db383508a76ee92c15ac03 Mon Sep 17 00:00:00 2001 From: tmddn3070 Date: Sun, 17 Mar 2024 17:03:08 +0900 Subject: [PATCH] FEAT : ADD CI --- .github/workflows/qodana_code_quality.yml | 19 +++++++++++++++ RUNA/Cogs/Commands_Util.py | 6 +++-- qodana.yaml | 29 +++++++++++++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/qodana_code_quality.yml create mode 100644 qodana.yaml diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml new file mode 100644 index 0000000..bbe62aa --- /dev/null +++ b/.github/workflows/qodana_code_quality.yml @@ -0,0 +1,19 @@ +name: Qodana +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +jobs: + qodana: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: 'Qodana Scan' + uses: JetBrains/qodana-action@v2023.3 + env: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} \ No newline at end of file diff --git a/RUNA/Cogs/Commands_Util.py b/RUNA/Cogs/Commands_Util.py index 7cdc810..c9584b4 100644 --- a/RUNA/Cogs/Commands_Util.py +++ b/RUNA/Cogs/Commands_Util.py @@ -1,7 +1,7 @@ from discord import ApplicationContext, DiscordException, slash_command, Color from discord.ext.commands import Cog, cooldown, BucketType, has_permissions, guild_only, Context -from RUNA.UI.Embed import Default_Embed, ChristmasEmbed +from RUNA.UI.Embed import Default_Embed, RunaEmbed from RUNA.UI.Buttons import Recommanded from RUNA.Database import database from RUNA.Module import get_gpuserver_status, Get_Backend_latency @@ -39,7 +39,7 @@ class CogUtil(Cog): @slash_command(name="봇정보", description="봇의 정보를 확인합니다.") async def _info(self, ctx: Context): if not await database.get_guild(ctx.guild.id): return await ctx.respond( - embed=ChristmasEmbed(title="❌ 에러!", description="서버가 가입되어있지 않아요! 서버를 가입해주세요!", color=Color.red()), + embed=RunaEmbed(title="❌ 에러!", description="서버가 가입되어있지 않아요! 서버를 가입해주세요!", color=Color.red()), ephemeral=True) data = await get_gpuserver_status(url=None) await ctx.respond(embed=Default_Embed.BotInfo(data, bot=self.bot)) @@ -58,3 +58,5 @@ class CogUtil(Cog): def setup(bot): bot.add_cog(CogUtil(bot)) + + diff --git a/qodana.yaml b/qodana.yaml new file mode 100644 index 0000000..84e3e49 --- /dev/null +++ b/qodana.yaml @@ -0,0 +1,29 @@ +#-------------------------------------------------------------------------------# +# Qodana analysis is configured by qodana.yaml file # +# https://www.jetbrains.com/help/qodana/qodana-yaml.html # +#-------------------------------------------------------------------------------# +version: "1.0" + +#Specify inspection profile for code analysis +profile: + name: qodana.starter + +#Enable inspections +#include: +# - name: + +#Disable inspections +#exclude: +# - name: +# paths: +# - + +#Execute shell command before Qodana execution (Applied in CI/CD pipeline) +#bootstrap: sh ./prepare-qodana.sh + +#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) +#plugins: +# - id: #(plugin id can be found at https://plugins.jetbrains.com) + +#Specify Qodana linter for analysis (Applied in CI/CD pipeline) +linter: jetbrains/qodana-python:latest