Skip to content

Commit d058f58

Browse files
committed
Update hooks and add ruff hook and switch to isort
1 parent 366916f commit d058f58

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

.pre-commit-config.yaml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
@@ -9,18 +9,26 @@ repos:
99
- id: check-merge-conflict
1010
- id: name-tests-test
1111
exclude: tests/(common.py|util.py|(helpers|integration/factories)/(.+).py)
12-
- repo: https://github.com/asottile/reorder_python_imports
13-
rev: v3.13.0
12+
- repo: https://github.com/astral-sh/ruff-pre-commit
13+
# Ruff version.
14+
rev: v0.11.12
1415
hooks:
15-
- id: reorder-python-imports
16-
args:
17-
- --py3-plus
16+
# Run the linter.
17+
- id: ruff-check
18+
args: [ --fix ]
19+
# Run the formatter.
20+
- id: ruff-format
1821
- repo: https://github.com/psf/black
19-
rev: 24.4.2
22+
rev: 25.1.0
2023
hooks:
2124
- id: black
25+
- repo: https://github.com/pycqa/isort
26+
rev: 6.0.1
27+
hooks:
28+
- id: isort
29+
args: ["--profile", "black", "--force-single-line-imports", "--filter-files"]
2230
- repo: https://github.com/pre-commit/mirrors-mypy
23-
rev: v1.10.1
31+
rev: v1.16.0
2432
hooks:
2533
- id: mypy
2634
additional_dependencies:

acceptance/client_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from py_nextbus import NextBusClient
44

5-
65
TEST_AGENCY = "sfmta-cis"
76
TEST_ROUTE = "F"
87
TEST_STOP = "4513"

gen_mock.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from tests.mock_responses import TEST_ROUTE_ID
44
from tests.mock_responses import TEST_STOP_ID
55

6-
76
client = NextBusClient()
87
agencies = client.agencies()
98
print("Agencies:")

py_nextbus/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
import json
44
import logging
5-
import re
65
from datetime import datetime
7-
from time import time
86
from typing import Any
9-
from typing import cast
107
from typing import NamedTuple
8+
from typing import cast
119

1210
import requests
1311
from requests.exceptions import HTTPError

tests/client_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313

1414
class TestNextBusClient(unittest.TestCase):
15-
1615
def setUp(self):
1716
self.client = NextBusClient()
1817

0 commit comments

Comments
 (0)