Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch from black to ruff #393

Merged
merged 2 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: CI

on:
Expand All @@ -12,12 +10,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up python 3.x
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- run: pipx install poetry # https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages
- uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: poetry
- name: install python packages
run: pip3 install --quiet poetry && poetry install --with dev --no-interaction
- name: black
run: poetry run black --check futaba
run: poetry install --with dev --no-interaction
- run: poetry run ruff format --check futaba
4 changes: 3 additions & 1 deletion futaba/sql/models/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ def fetch_filter_immune_users(self, guild):
self.tb_filter_immune_users.c.guild_id == guild.id
)
result = self.sql.execute(sel)
self.immune_users_cache[guild].update(user_id for user_id, in result.fetchall())
self.immune_users_cache[guild].update(
user_id for (user_id,) in result.fetchall()
)
return self.immune_users_cache[guild]

def get_filter_immune_users(self, guild):
Expand Down
2 changes: 1 addition & 1 deletion futaba/sql/models/guilds.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def get_guild_ids(self):
sel = select([self.tb_guilds.c.guild_id])
result = self.sql.execute(sel)

return (guild_id for guild_id, in result.fetchall())
return (guild_id for (guild_id,) in result.fetchall())

@staticmethod
def _get_guild(bot, guild_id):
Expand Down
124 changes: 27 additions & 97 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tree-format = ">=0.1.2"
python-jose = ">=3.2.0"

[tool.poetry.group.dev.dependencies]
black = "^23.1.0"
ruff = "^0.1.9"
pylint = ">=2.5"

[build-system]
Expand Down