Skip to content

Commit dc5b089

Browse files
authored
Switch to ruff for checks and formatting (#1133)
* Switch to ruff Use ruff instead of black and pylint. * Adjust to ruff formatting * Remove non needed disable
1 parent 3578985 commit dc5b089

4 files changed

Lines changed: 8 additions & 11 deletions

File tree

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
run: |
2424
pip install -r requirements.txt
2525
pip install -r requirements-test.txt
26-
- name: Check formatting with black
26+
- name: Check formatting with ruff
2727
run: |
28-
black examples pychromecast --check --diff
29-
- name: Lint with flake8
28+
ruff format examples pychromecast --check --diff
29+
- name: Lint with ruff
3030
run: |
31-
flake8 --exclude cast_channel_pb2.py,authority_keys_pb2.py,logging_pb2.py examples pychromecast
31+
ruff check examples pychromecast
3232
- name: Lint with mypy
3333
run: |
3434
mypy examples pychromecast

pychromecast/socket_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,7 @@ def mdns_backoff(
268268
retry["delay"] = min(retry["delay"] * 2, 300)
269269
retries[service] = retry
270270

271-
while not self.stop.is_set() and (
272-
tries is None or tries > 0
273-
): # pylint:disable=too-many-nested-blocks
271+
while not self.stop.is_set() and (tries is None or tries > 0):
274272
# Prune retries dict
275273
retries = {
276274
key: retries[key]

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ classifiers=[
3030
[project.urls]
3131
"Homepage" = "https://github.com/home-assistant-libs/pychromecast"
3232

33-
[tool.black]
34-
exclude = 'pb2'
33+
[tool.ruff]
34+
exclude = ['*_pb2.*']
3535

3636
[tool.rstcheck]
3737
# README.rst has embedded python examples which show the interactive interpreter output

requirements-test.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
beautifulsoup4==4.14.2
2-
black==25.11.0
3-
flake8==7.3.0
2+
ruff==0.14.6
43
mypy==1.15.0
54
PlexAPI==4.17.2
65
pylint==4.0.3

0 commit comments

Comments
 (0)