File tree 6 files changed +61
-351
lines changed
6 files changed +61
-351
lines changed Original file line number Diff line number Diff line change 50
50
run : |
51
51
poetry install -E "test coverage lint"
52
52
53
- - name : Lint with flake8
53
+ - name : Lint with ruff
54
54
run : |
55
- poetry run flake8
55
+ poetry run ruff .
56
56
57
57
- name : Lint with mypy
58
58
run : poetry run mypy .
Original file line number Diff line number Diff line change @@ -11,12 +11,6 @@ entr_warn:
11
11
@echo " See https://eradman.com/entrproject/ "
12
12
@echo " ----------------------------------------------------------"
13
13
14
- isort :
15
- poetry run isort ` ${PY_FILES} `
16
-
17
- black :
18
- poetry run black ` ${PY_FILES} `
19
-
20
14
test :
21
15
poetry run py.test $(test )
22
16
@@ -44,11 +38,11 @@ serve_docs:
44
38
dev_docs :
45
39
$(MAKE ) -j watch_docs serve_docs
46
40
47
- flake8 :
48
- poetry run flake8
41
+ ruff :
42
+ poetry run ruff .
49
43
50
- watch_flake8 :
51
- if command -v entr > /dev/null; then ${PY_FILES} | entr -c $( MAKE) flake8 ; else $( MAKE) flake8 entr_warn; fi
44
+ watch_ruff :
45
+ if command -v entr > /dev/null; then ${PY_FILES} | entr -c $( MAKE) ruff ; else $( MAKE) ruff entr_warn; fi
52
46
53
47
mypy :
54
48
poetry run mypy ` ${PY_FILES} `
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ $ cd libtmux
11
11
```
12
12
13
13
``` console
14
- $ poetry install -E " docs test coverage lint format "
14
+ $ poetry install -E " docs test coverage lint ruff "
15
15
```
16
16
17
17
Makefile commands prefixed with ` watch_ ` will watch files and rerun.
@@ -61,60 +61,62 @@ and `setup.cfg`:
61
61
62
62
## Linting
63
63
64
- [ flake8] and [ mypy] run via CI in our GitHub Actions. See the configuration in ` pyproject.toml ` and
65
- ` setup.cfg ` .
64
+ ### ruff
66
65
67
- ### flake8
68
-
69
- [ flake8] provides fast, reliable, barebones styling and linting.
66
+ The project uses [ ruff] to handles formatting, sorting imports and linting.
70
67
71
68
```` {tab} Command
72
69
73
70
poetry:
74
71
75
72
```console
76
- $ poetry run flake8
73
+ $ poetry run ruff
77
74
```
78
75
79
76
If you setup manually:
80
77
81
78
```console
82
- $ flake8
79
+ $ ruff .
83
80
```
84
81
85
82
````
86
83
87
84
```` {tab} make
88
85
89
86
```console
90
- $ make flake8
87
+ $ make ruff
91
88
```
92
89
93
90
````
94
91
95
92
```` {tab} Watch
96
93
97
94
```console
98
- $ make watch_flake8
95
+ $ make watch_ruff
99
96
```
100
97
101
98
requires [`entr(1)`].
102
99
103
100
````
104
101
105
- ```` {tab} Configuration
102
+ ```` {tab} Fix files
106
103
107
- See `[flake8]` in setup.cfg.
104
+ poetry:
108
105
109
- ```{literalinclude} ../setup.cfg
110
- :language: ini
111
- :start-at: "[flake8]"
112
- :end-before: "[isort]"
106
+ ```console
107
+ $ poetry run ruff . --fix
108
+ ```
113
109
110
+ If you setup manually:
111
+
112
+ ```console
113
+ $ ruff . --fix
114
114
```
115
115
116
116
````
117
117
118
+
119
+
118
120
### mypy
119
121
120
122
[ mypy] is used for static type checking.
@@ -213,7 +215,5 @@ Update `__version__` in `__about__.py` and `pyproject.toml`::
213
215
[ poetry ] : https://python-poetry.org/
214
216
[ entr(1) ] : http://eradman.com/entrproject/
215
217
[ `entr(1)` ] : http://eradman.com/entrproject/
216
- [ black ] : https://github.com/psf/black
217
- [ isort ] : https://pypi.org/project/isort/
218
- [ flake8 ] : https://flake8.pycqa.org/
218
+ [ ruff ] : https://ruff.rs
219
219
[ mypy ] : http://mypy-lang.org/
You can’t perform that action at this time.
0 commit comments