File tree Expand file tree Collapse file tree 6 files changed +31
-29
lines changed Expand file tree Collapse file tree 6 files changed +31
-29
lines changed Original file line number Diff line number Diff line change 44
44
- name : Check code formatting
45
45
run : tox -e black
46
46
- name : Check code style
47
- run : tox -e flake8
48
- - name : Check imports ordering
49
- run : tox -e isort
47
+ run : tox -e ruff
50
48
- name : Check types statically
51
49
run : tox -e mypy
52
50
Original file line number Diff line number Diff line change 1
- .PHONY : default style test coverage maxi_cov build clean
1
+ .PHONY : default style types tests coverage maxi_cov build clean
2
2
3
3
export PYTHONASYNCIODEBUG =1
4
4
export PYTHONPATH =src
5
5
export PYTHONWARNINGS =default
6
6
7
- default : coverage style
7
+ default : style types tests
8
8
9
9
style :
10
- isort --project websockets src tests
11
10
black src tests
12
- flake8 src tests
11
+ ruff --fix src tests
12
+
13
+ types :
13
14
mypy --strict src
14
15
15
- test :
16
+ tests :
16
17
python -m unittest
17
18
18
19
coverage :
Original file line number Diff line number Diff line change @@ -58,3 +58,19 @@ exclude_lines = [
58
58
" self.fail\\ (\" .*\"\\ )" ,
59
59
" @unittest.skip" ,
60
60
]
61
+
62
+ [tool .ruff ]
63
+ select = [
64
+ " E" , # pycodestyle
65
+ " F" , # Pyflakes
66
+ " W" , # pycodestyle
67
+ " I" , # isort
68
+ ]
69
+ ignore = [
70
+ " F403" ,
71
+ " F405" ,
72
+ ]
73
+
74
+ [tool .ruff .isort ]
75
+ combine-as-imports = true
76
+ lines-after-imports = 2
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -552,10 +552,10 @@ def select_subprotocol(
552
552
subprotocols = set (client_subprotocols ) & set (server_subprotocols )
553
553
if not subprotocols :
554
554
return None
555
- priority = lambda p : (
556
- client_subprotocols . index ( p ) + server_subprotocols . index ( p )
557
- )
558
- return sorted ( subprotocols , key = priority )[0 ]
555
+ return sorted (
556
+ subprotocols ,
557
+ key = lambda p : client_subprotocols . index ( p ) + server_subprotocols . index ( p ),
558
+ )[0 ]
559
559
560
560
async def handshake (
561
561
self ,
Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ envlist =
7
7
py311
8
8
coverage
9
9
black
10
- flake8
11
- isort
10
+ ruff
12
11
mypy
13
12
14
13
[testenv]
@@ -31,13 +30,9 @@ deps = coverage
31
30
commands = black --check src tests
32
31
deps = black
33
32
34
- [testenv:flake8]
35
- commands = flake8 src tests
36
- deps = flake8
37
-
38
- [testenv:isort]
39
- commands = isort --check-only src tests
40
- deps = isort
33
+ [testenv:ruff]
34
+ commands = ruff src tests
35
+ deps = ruff
41
36
42
37
[testenv:mypy]
43
38
commands = mypy --strict src
You can’t perform that action at this time.
0 commit comments