Skip to content

Commit

Permalink
use ruff formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Fogapod committed Jan 15, 2024
1 parent 7b41dd0 commit 9bafd77
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
10 changes: 3 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@ repos:
^.*.md$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
rev: v0.1.13
hooks:
- id: ruff-format
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]

- repo: https://github.com/ambv/black
rev: 23.11.0
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.0
rev: v1.8.0
hooks:
- id: mypy
args: []
Expand Down
3 changes: 0 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
-r requirements.txt

# formatting
black

# linting
pre-commit
mypy
Expand Down
4 changes: 1 addition & 3 deletions src/cogs/images/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ async def _from_text(
def pick_format(target_animated: bool) -> Optional[Literal["webp", "jpeg", "jpg", "png", "gif"]]:
if allow_static and allow_animated:
return (
cls.DEFAULT_ANIMATED_FORMAT
if target_animated
else cls.DEFAULT_STATIC_FORMAT # type: ignore[return-value]
cls.DEFAULT_ANIMATED_FORMAT if target_animated else cls.DEFAULT_STATIC_FORMAT # type: ignore[return-value]
)

if allow_animated and target_animated:
Expand Down

0 comments on commit 9bafd77

Please sign in to comment.