Skip to content

Commit

Permalink
run lint config
Browse files Browse the repository at this point in the history
  • Loading branch information
onerandomusername committed Sep 25, 2024
1 parent bc935cd commit eacb396
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 50 deletions.
33 changes: 15 additions & 18 deletions docs/.requirements.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
click==8.1.7 ; python_version >= "3.8" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.8" and python_version < "4.0" and platform_system == "Windows"
ghp-import==2.1.0 ; python_version >= "3.8" and python_version < "4.0"
importlib-metadata==8.5.0 ; python_version >= "3.8" and python_version < "3.10"
jinja2==3.1.4 ; python_version >= "3.8" and python_version < "4.0"
markdown==3.7 ; python_version >= "3.8" and python_version < "4.0"
markupsafe==2.1.5 ; python_version >= "3.8" and python_version < "4.0"
click==8.0.3 ; python_version >= "3.8" and python_version < "4.0"
colorama==0.4.4 ; python_version >= "3.8" and python_version < "4.0" and platform_system == "Windows"
ghp-import==2.0.1 ; python_version >= "3.8" and python_version < "4.0"
importlib-metadata==4.8.1 ; python_version >= "3.8" and python_version < "4.0"
jinja2==3.0.1 ; python_version >= "3.8" and python_version < "4.0"
markdown==3.3.4 ; python_version >= "3.8" and python_version < "4.0"
markupsafe==2.0.1 ; python_version >= "3.8" and python_version < "4.0"
mergedeep==1.3.4 ; python_version >= "3.8" and python_version < "4.0"
mkdocs-get-deps==0.2.0 ; python_version >= "3.8" and python_version < "4.0"
mkdocs-markdownextradata-plugin==0.1.9 ; python_version >= "3.8" and python_version < "4.0"
mkdocs-material-extensions==1.3.1 ; python_version >= "3.8" and python_version < "4.0"
mkdocs-material==7.3.6 ; python_version >= "3.8" and python_version < "4.0"
mkdocs==1.6.1 ; python_version >= "3.8" and python_version < "4.0"
mkdocs-material-extensions==1.0.3 ; python_version >= "3.8" and python_version < "4.0"
mkdocs-material==7.2.6 ; python_version >= "3.8" and python_version < "4.0"
mkdocs==1.2.3 ; python_version >= "3.8" and python_version < "4.0"
packaging==24.1 ; python_version >= "3.8" and python_version < "4.0"
pathspec==0.12.1 ; python_version >= "3.8" and python_version < "4.0"
platformdirs==4.3.6 ; python_version >= "3.8" and python_version < "4.0"
pygments==2.18.0 ; python_version >= "3.8" and python_version < "4.0"
pymdown-extensions==10.10.1 ; python_version >= "3.8" and python_version < "4.0"
python-dateutil==2.9.0.post0 ; python_version >= "3.8" and python_version < "4.0"
pygments==2.10.0 ; python_version >= "3.8" and python_version < "4.0"
pymdown-extensions==8.2 ; python_version >= "3.8" and python_version < "4.0"
python-dateutil==2.8.2 ; python_version >= "3.8" and python_version < "4.0"
pyyaml-env-tag==0.1 ; python_version >= "3.8" and python_version < "4.0"
pyyaml==5.4.1 ; python_version >= "3.8" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.8" and python_version < "4.0"
watchdog==4.0.2 ; python_version >= "3.8" and python_version < "4.0"
zipp==3.20.2 ; python_version >= "3.8" and python_version < "3.10"
watchdog==2.1.5 ; python_version >= "3.8" and python_version < "4.0"
zipp==3.5.0 ; python_version >= "3.8" and python_version < "4.0"
6 changes: 3 additions & 3 deletions modmail/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ class ConfigMetadata:
# as a solution, I'm implementing a field which can provide a rich converter object,
# in the style that discord.py uses. This will be called like discord py calls.
discord_converter: discord.ext.commands.converter.Converter = attr.ib(default=None)
discord_converter_attribute: typing.Optional[
types.FunctionType
] = None # if we want an attribute off of the converted value
discord_converter_attribute: typing.Optional[types.FunctionType] = (
None # if we want an attribute off of the converted value
)

# hidden values do not show up in the bot configuration menu
hidden: bool = False
Expand Down
2 changes: 1 addition & 1 deletion modmail/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def activate(self, instance: object) -> None:
if underlying_function not in self.pending_handlers:
continue

for (event_name, priority) in self.pending_handlers[underlying_function]:
for event_name, priority in self.pending_handlers[underlying_function]:
self._register_handler(event_name, priority, value)
self.pending_handlers[underlying_function].clear()

Expand Down
6 changes: 3 additions & 3 deletions modmail/extensions/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ def __init__(self, bot: "ModmailBot"):
super().__init__(bot)
# validation for this configuration variable is be defered to fully implementing
# a new configuration system
self.relay_channel: Union[
discord.TextChannel, discord.PartialMessageable
] = self.bot.get_partial_messageable(self.bot.config.user.threads.relay_channel_id)
self.relay_channel: Union[discord.TextChannel, discord.PartialMessageable] = (
self.bot.get_partial_messageable(self.bot.config.user.threads.relay_channel_id)
)

self.dms_to_users: Dict[int, int] = dict() # key: dm_channel.id, value: user.id

Expand Down
1 change: 1 addition & 0 deletions modmail/plugins/local/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Plugins should be like normal discord cogs, but should subclass `PluginCog` from
```py
from modmail.plugin_helpers import PluginCog


class MyPlugin(PluginCog):
pass
```
1 change: 1 addition & 0 deletions modmail/utils/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Originally adapated from: https://github.com/khk4912/EZPaginator/tree/84b5213741a78de266677b805c6f694ad94fedd6
"""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions modmail/utils/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Note: these are to used for general success or general errors. Typically, the error handler will make a
response if a command raises a discord.ext.commands.CommandError exception.
"""

import logging
import random
import typing
Expand Down
6 changes: 3 additions & 3 deletions modmail/utils/threads/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ def __init__(
"""
self.thread = thread
self.recipient = recipient
self.log_message: Union[
discord.Message, discord.PartialMessage
] = log_message or self.thread.parent.get_partial_message(self.thread.id)
self.log_message: Union[discord.Message, discord.PartialMessage] = (
log_message or self.thread.parent.get_partial_message(self.thread.id)
)
self.messages = MessageDict()
self.close_after = self.thread.auto_archive_duration
self.has_sent_initial_message = has_sent_initial_message
Expand Down
51 changes: 29 additions & 22 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
click==8.1.7 ; python_version >= "3.8" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.8" and python_version < "4.0" and platform_system == "Windows"
ghp-import==2.1.0 ; python_version >= "3.8" and python_version < "4.0"
importlib-metadata==8.5.0 ; python_version >= "3.8" and python_version < "3.10"
jinja2==3.1.4 ; python_version >= "3.8" and python_version < "4.0"
markdown==3.7 ; python_version >= "3.8" and python_version < "4.0"
markupsafe==2.1.5 ; python_version >= "3.8" and python_version < "4.0"
mergedeep==1.3.4 ; python_version >= "3.8" and python_version < "4.0"
mkdocs-get-deps==0.2.0 ; python_version >= "3.8" and python_version < "4.0"
mkdocs-markdownextradata-plugin==0.1.9 ; python_version >= "3.8" and python_version < "4.0"
mkdocs-material-extensions==1.3.1 ; python_version >= "3.8" and python_version < "4.0"
mkdocs-material==7.3.6 ; python_version >= "3.8" and python_version < "4.0"
mkdocs==1.6.1 ; python_version >= "3.8" and python_version < "4.0"
packaging==24.1 ; python_version >= "3.8" and python_version < "4.0"
pathspec==0.12.1 ; python_version >= "3.8" and python_version < "4.0"
platformdirs==4.3.6 ; python_version >= "3.8" and python_version < "4.0"
pygments==2.18.0 ; python_version >= "3.8" and python_version < "4.0"
pymdown-extensions==10.10.1 ; python_version >= "3.8" and python_version < "4.0"
python-dateutil==2.9.0.post0 ; python_version >= "3.8" and python_version < "4.0"
pyyaml-env-tag==0.1 ; python_version >= "3.8" and python_version < "4.0"
aiodns==3.0.0 ; python_version >= "3.8" and python_version < "4.0"
aiohttp==3.7.4.post0 ; python_version >= "3.8" and python_version < "4.0"
aiohttp[speedups]==3.7.4.post0 ; python_version >= "3.8" and python_version < "4.0"
arrow==1.1.1 ; python_version >= "3.8" and python_version < "4.0"
async-timeout==3.0.1 ; python_version >= "3.8" and python_version < "4.0"
atoml==1.0.3 ; python_version >= "3.8" and python_version < "4.0"
attrs==21.2.0 ; python_version >= "3.8" and python_version < "4.0"
brotlipy==0.7.0 ; python_version >= "3.8" and python_version < "4.0"
cchardet==2.1.7 ; python_version >= "3.8" and python_version < "4.0"
cffi==1.15.0 ; python_version >= "3.8" and python_version < "4.0"
chardet==4.0.0 ; python_version >= "3.8" and python_version < "4.0"
colorama==0.4.4 ; python_version >= "3.8" and python_version < "4.0"
coloredlogs==15.0.1 ; python_version >= "3.8" and python_version < "4.0"
desert==2020.11.18 ; python_version >= "3.8" and python_version < "4.0"
discord-py @ https://github.com/Rapptz/discord.py/archive/45d498c1b76deaf3b394d17ccf56112fa691d160.zip ; python_version >= "3.8" and python_version < "4.0"
humanfriendly==10.0 ; python_version >= "3.8" and python_version < "4.0"
idna==3.2 ; python_version >= "3.8" and python_version < "4.0"
marshmallow-enum==1.5.1 ; python_version >= "3.8" and python_version < "4.0"
marshmallow==3.13.0 ; python_version >= "3.8" and python_version < "4.0"
multidict==5.2.0 ; python_version >= "3.8" and python_version < "4.0"
mypy-extensions==0.4.3 ; python_version >= "3.8" and python_version < "4.0"
pycares==4.1.2 ; python_version >= "3.8" and python_version < "4.0"
pycparser==2.20 ; python_version >= "3.8" and python_version < "4.0"
pyreadline3==3.3 ; sys_platform == "win32" and python_version >= "3.8" and python_version < "4.0"
python-dateutil==2.8.2 ; python_version >= "3.8" and python_version < "4.0"
python-dotenv==0.19.2 ; python_version >= "3.8" and python_version < "4.0"
pyyaml==5.4.1 ; python_version >= "3.8" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.8" and python_version < "4.0"
watchdog==4.0.2 ; python_version >= "3.8" and python_version < "4.0"
zipp==3.20.2 ; python_version >= "3.8" and python_version < "3.10"
typing-extensions==4.12.2 ; python_version >= "3.8" and python_version < "4.0"
typing-inspect==0.7.1 ; python_version >= "3.8" and python_version < "4.0"
yarl==1.7.2 ; python_version >= "3.8" and python_version < "4.0"
1 change: 1 addition & 0 deletions scripts/export_new_config_to_default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This is intended to be used as a local pre-commit hook, which runs if the modmail/config.py file is changed.
"""

import difflib
import json
import os
Expand Down
1 change: 1 addition & 0 deletions tests/mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

from __future__ import annotations

import asyncio
Expand Down

0 comments on commit eacb396

Please sign in to comment.