File tree 6 files changed +58
-359
lines changed
6 files changed +58
-359
lines changed Original file line number Diff line number Diff line change 56
56
run : |
57
57
poetry install -E "test coverage lint"
58
58
59
- - name : Lint with flake8
60
- run : poetry run flake8
59
+ - name : Lint with ruff .
60
+ run : poetry run ruff .
61
61
62
62
- name : Lint with mypy
63
63
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 @@ start_docs:
44
38
design_docs :
45
39
$(MAKE ) -C docs design
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 @@ -329,63 +329,56 @@ this will load the `.tmuxp.yaml` in the root of the project.
329
329
330
330
## Formatting
331
331
332
- The project uses [ black] and [ isort] (one after the other). Configurations are in ` pyproject.toml `
333
- and ` setup.cfg ` :
332
+ ### ruff
334
333
335
- - ` make black isort ` : Run ` black ` first, then ` isort ` to handle import nuances
336
-
337
- ## Linting
338
-
339
- [ flake8] and [ mypy] run via CI in our GitHub Actions. See the configuration in ` pyproject.toml ` and
340
- ` setup.cfg ` .
341
-
342
- ### flake8
343
-
344
- [ flake8] provides fast, reliable, barebones styling and linting.
334
+ The project uses [ ruff] to handles formatting, sorting imports and linting.
345
335
346
336
```` {tab} Command
347
337
348
338
poetry:
349
339
350
340
```console
351
- $ poetry run flake8
341
+ $ poetry run ruff
352
342
```
353
343
354
344
If you setup manually:
355
345
356
346
```console
357
- $ flake8
347
+ $ ruff .
358
348
```
359
349
360
350
````
361
351
362
352
```` {tab} make
363
353
364
354
```console
365
- $ make flake8
355
+ $ make ruff
366
356
```
367
357
368
358
````
369
359
370
360
```` {tab} Watch
371
361
372
362
```console
373
- $ make watch_flake8
363
+ $ make watch_ruff
374
364
```
375
365
376
366
requires [`entr(1)`].
377
367
378
368
````
379
369
380
- ```` {tab} Configuration
370
+ ```` {tab} Fix files
371
+
372
+ poetry:
381
373
382
- See `[flake8]` in setup.cfg.
374
+ ```console
375
+ $ poetry run ruff . --fix
376
+ ```
383
377
384
- ```{literalinclude} ../setup.cfg
385
- :language: ini
386
- :start-at: "[flake8]"
387
- :end-before: "[isort]"
378
+ If you setup manually:
388
379
380
+ ```console
381
+ $ ruff . --fix
389
382
```
390
383
391
384
````
@@ -443,9 +436,7 @@ the [gh build site].
443
436
[ py.test usage argument ] : https://pytest.org/latest/usage.html
444
437
[ entr ] : http://entrproject.org/
445
438
[ `entr(1)` ] : http://entrproject.org/
446
- [ black ] : https://github.com/psf/black
447
- [ isort ] : https://pypi.org/project/isort/
448
- [ flake8 ] : https://flake8.pycqa.org/
439
+ [ ruff ] : https://ruff.rs
449
440
[ mypy ] : http://mypy-lang.org/
450
441
[ github actions ] : https://github.com/features/actions
451
442
[ gh build site ] : https://github.com/tmux-python/tmuxp/actions?query=workflow%3Atests
You can’t perform that action at this time.
0 commit comments