Skip to content

Commit

Permalink
ci: update check style action
Browse files Browse the repository at this point in the history
  • Loading branch information
eunwoo1104 committed Dec 20, 2023
1 parent d5b5282 commit f310046
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/python-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.7'

- name: Install Requirements
run: pip install -r requirements.txt -r requirements-dev.txt

- name: Check Style
run: black --check dico
run: |
black --check dico
isort -c --profile=black dico
14 changes: 9 additions & 5 deletions dico/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
Attachment,
AuditLog,
AuditLogEvents,
AutoModerationEventTypes,
AutoModerationRule,
Ban,
Channel,
ChannelTypes,
Expand Down Expand Up @@ -60,6 +62,7 @@
Sticker,
SystemChannelFlags,
ThreadMember,
TriggerTypes,
User,
VerificationLevel,
VideoQualityModes,
Expand All @@ -68,9 +71,6 @@
WelcomeScreen,
WelcomeScreenChannel,
WidgetStyle,
AutoModerationRule,
AutoModerationEventTypes,
TriggerTypes,
)
from .utils import from_emoji, to_image_data, wrap_to_async

Expand Down Expand Up @@ -269,15 +269,19 @@ def modify_auto_moderation_rule(
body["exempt_roles"] = [int(x) for x in exempt_roles]
if exempt_channels is not None:
body["exempt_channels"] = [int(x) for x in exempt_channels]
resp = self.http.modify_auto_moderation_rule(int(guild), int(auto_moderation_rule_id), **body, reason=reason)
resp = self.http.modify_auto_moderation_rule(
int(guild), int(auto_moderation_rule_id), **body, reason=reason
)
if isinstance(resp, dict):
return AutoModerationRule(resp)
return wrap_to_async(AutoModerationRule, None, resp, as_create=False)

def delete_auto_moderation_rule(
self, guild: Guild.TYPING, auto_moderation_rule_id: Snowflake.TYPING
):
return self.http.delete_auto_moderation_rule(int(guild), int(auto_moderation_rule_id))
return self.http.delete_auto_moderation_rule(
int(guild), int(auto_moderation_rule_id)
)

# Channel

Expand Down
2 changes: 1 addition & 1 deletion dico/model/auto_moderation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Optional, Union, Awaitable
from typing import Awaitable, List, Optional, Union

from ..base.model import TypeBase
from .snowflake import Snowflake
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#
import os
import sys

import sphinx_rtd_theme

sys.path.insert(0, os.path.abspath(".."))
Expand Down
2 changes: 1 addition & 1 deletion examples/voice.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
import dico

import dico

client = dico.Client("YOUR_BOT_TOKEN")
client.on_ready = lambda ready: print(f"Bot ready, with {len(ready.guilds)} guilds.")
Expand Down
3 changes: 2 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sphinx
sphinx-press-theme
black
black==23.10.1
isort==5.13.2

0 comments on commit f310046

Please sign in to comment.