Skip to content

Commit

Permalink
Reformat and use black profile for isort
Browse files Browse the repository at this point in the history
  • Loading branch information
rorre committed Jan 6, 2021
1 parent e960955 commit 21e58fb
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Linting with isort and flake8
run: |
flake8 phillip tests --select F
isort --check-only --diff phillip tests
isort --check-only --diff phillip tests --profile black
- name: Test and enerate coverage report
run: |
pytest --cov=phillip --cov-report=xml
Expand Down
11 changes: 9 additions & 2 deletions phillip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@
A basic wrapper for osu! beatmapset events
"""
# flake8: noqa
from .__version__ import (__author__, __author_email__, __description__,
__license__, __title__, __url__, __version__)
from .__version__ import (
__author__,
__author_email__,
__description__,
__license__,
__title__,
__url__,
__version__,
)
45 changes: 15 additions & 30 deletions phillip/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@


class Handler:
"""Handler base for ``Phillip``
"""
"""Handler base for ``Phillip``"""

def __init__(self):
self.app: Phillip
Expand Down Expand Up @@ -42,70 +41,56 @@ def _register_events(self):
self.emitter.on(func.split("_")[-1], getattr(self, func))

async def on_map_event(self, event: "EventBase"):
"""Function to be called when any beatmap event happens.
"""
"""Function to be called when any beatmap event happens."""
pass

async def on_map_bubbled(self, event: "EventBase"):
"""Function to be called when a beatmap is bubbled.
"""
"""Function to be called when a beatmap is bubbled."""
pass

async def on_map_qualified(self, event: "EventBase"):
"""Function to be called when a beatmap is qualified.
"""
"""Function to be called when a beatmap is qualified."""
pass

async def on_map_disqualified(self, event: "EventBase"):
"""Function to be called when a beatmap is disqualified.
"""
"""Function to be called when a beatmap is disqualified."""
pass

async def on_map_popped(self, event: "EventBase"):
"""Function to be called when a beatmap is popped.
"""
"""Function to be called when a beatmap is popped."""
pass

async def on_map_ranked(self, event: "EventBase"):
"""Function to be called when a beatmap is ranked.
"""
"""Function to be called when a beatmap is ranked."""
pass

async def on_map_loved(self, event: "EventBase"):
"""Function to be called when a beatmap is loved.
"""
"""Function to be called when a beatmap is loved."""
pass

async def on_group_added(self, user: GroupUser):
"""Function to be called when someone gets added to a group.
"""
"""Function to be called when someone gets added to a group."""
pass

async def on_group_removed(self, user: GroupUser):
"""Function to be called when someone gets removed from a group.
"""
"""Function to be called when someone gets removed from a group."""
pass

async def on_group_probation(self, user: GroupUser):
"""Function to be called when someone gets added/removed to/from the probation.
"""
"""Function to be called when someone gets added/removed to/from the probation."""

async def on_group_gmt(self, user: GroupUser):
"""Function to be called when someone gets added/removed to/from GMT.
"""
"""Function to be called when someone gets added/removed to/from GMT."""
pass

async def on_group_bng(self, user: GroupUser):
"""Function to be called when someone gets added/removed to/from BNG.
"""
"""Function to be called when someone gets added/removed to/from BNG."""
pass

async def on_group_nat(self, user: GroupUser):
"""Function to be called when someone gets added/removed to/from NAT.
"""
"""Function to be called when someone gets added/removed to/from NAT."""
pass

async def on_group_alumni(self, user: GroupUser):
"""Function to be called when someone gets added/removed to/from Alumni.
"""
"""Function to be called when someone gets added/removed to/from Alumni."""
pass
2 changes: 1 addition & 1 deletion phillip/osu/new/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, session, throttler=None, app=None):
self._throttler = throttler or Throttler(rate_limit=2, period=60)

async def get_html(self, uri: str) -> BeautifulSoup:
"""Receive html from uri with rate limit.
"""Receive html from uri with rate limit.
*This function is a [coroutine](https://docs.python.org/3/library/asyncio-task.html#coroutine).*
**Parameters:**
Expand Down
3 changes: 1 addition & 2 deletions tests/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
from phillip.application import Phillip
from phillip.handlers import Handler
from phillip.osu.classes.web import GroupUser
from tests.mocks.application import (api_mock, bancho_event_mock, events_mock,
users_mock)
from tests.mocks.application import api_mock, bancho_event_mock, events_mock, users_mock


@pytest.fixture
Expand Down
9 changes: 7 additions & 2 deletions tests/test_discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
from phillip.application import Phillip
from phillip.discord import DiscordHandler, format_message, gen_embed
from phillip.osu.classes.api import Beatmap
from tests.mocks.discord.mocks import (get_api, html_mock, map_json, pop_mock,
popped_map_json)
from tests.mocks.discord.mocks import (
get_api,
html_mock,
map_json,
pop_mock,
popped_map_json,
)


@pytest.fixture
Expand Down

0 comments on commit 21e58fb

Please sign in to comment.