diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..84616fb --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,36 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + lint-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.12" + + - name: Install Poetry + uses: snok/install-poetry@v1 + + - name: Install dependencies + run: poetry install + + - name: Run Black + run: poetry run black --check fun_game tests + + - name: Run MyPy + run: poetry run mypy fun_game tests + + - name: Run Pylint + run: poetry run pylint fun_game tests + + - name: Run Tests + run: poetry run pytest diff --git a/fun_game/frontends/discord/cogs/sudo_commands.py b/fun_game/frontends/discord/cogs/sudo_commands.py index d675b43..4d86eac 100644 --- a/fun_game/frontends/discord/cogs/sudo_commands.py +++ b/fun_game/frontends/discord/cogs/sudo_commands.py @@ -39,7 +39,9 @@ async def show_rules(self, interaction: discord.Interaction): prefix="", ) if not replies: - await interaction.response.send_message("There are no custom rules yet.", ephemeral=True) + await interaction.response.send_message( + "There are no custom rules yet.", ephemeral=True + ) return for reply in replies: diff --git a/tests/test_engine.py b/tests/test_engine.py index 65c738f..e4d06f4 100644 --- a/tests/test_engine.py +++ b/tests/test_engine.py @@ -1,6 +1,9 @@ -import pytest +# pylint: disable=redefined-outer-name,protected-access + from unittest.mock import AsyncMock, Mock, MagicMock +import pytest + from fun_game.config import ( GameConfig, FilterConfig,