Skip to content

Commit

Permalink
Replace isort with ruff (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet authored Nov 25, 2024
1 parent add730b commit 389ebda
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 26 deletions.
5 changes: 0 additions & 5 deletions .flake8

This file was deleted.

4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ repos:
rev: v3.1.0
hooks:
- id: prettier
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
Expand Down
4 changes: 3 additions & 1 deletion example/encrypted_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

import aiohttp

from samsungtvws.encrypted.authenticator import SamsungTVEncryptedWSAsyncAuthenticator
from samsungtvws.encrypted.authenticator import (
SamsungTVEncryptedWSAsyncAuthenticator,
)

logging.basicConfig(level=logging.DEBUG)

Expand Down
5 changes: 4 additions & 1 deletion example/encrypted_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

import aiohttp

from samsungtvws.encrypted.remote import SamsungTVEncryptedWSAsyncRemote, SendRemoteKey
from samsungtvws.encrypted.remote import (
SamsungTVEncryptedWSAsyncRemote,
SendRemoteKey,
)

logging.basicConfig(level=logging.DEBUG)

Expand Down
25 changes: 12 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
[tool.isort]
# https://github.com/PyCQA/isort/wiki/isort-Settings
profile = "black"
force_sort_within_sections = true
known_first_party = [
"samsungtvws",
"tests",
]
forced_separate = [
"tests",
]
combine_as_imports = true

[tool.ruff]
line-length = 79
target-version = "py38"
Expand All @@ -27,10 +14,22 @@ select = [
"C",
"E",
"F",
"I", # isort
"UP", # pyupgrade
"W",
]

[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = [
"samsungtvws",
"tests",
]
forced-separate = [
"tests",
]
combine-as-imports = true

[tool.ruff.lint.mccabe]
max-complexity = 18

Expand Down
11 changes: 10 additions & 1 deletion samsungtvws/async_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@
import logging
import ssl
from types import TracebackType
from typing import Any, Awaitable, Callable, Dict, List, Optional, Sequence, Union
from typing import (
Any,
Awaitable,
Callable,
Dict,
List,
Optional,
Sequence,
Union,
)

from websockets.client import WebSocketClientProtocol, connect
from websockets.exceptions import ConnectionClosed
Expand Down
4 changes: 3 additions & 1 deletion tests/test_encrypted_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import pytest
from yarl import URL

from samsungtvws.encrypted.authenticator import SamsungTVEncryptedWSAsyncAuthenticator
from samsungtvws.encrypted.authenticator import (
SamsungTVEncryptedWSAsyncAuthenticator,
)


@pytest.mark.asyncio
Expand Down

0 comments on commit 389ebda

Please sign in to comment.