File tree Expand file tree Collapse file tree 6 files changed +61
-351
lines changed Expand file tree Collapse file tree 6 files changed +61
-351
lines changed Original file line number Diff line number Diff line change 5050 run : |
5151 poetry install -E "test coverage lint"
5252
53- - name : Lint with flake8
53+ - name : Lint with ruff
5454 run : |
55- poetry run flake8
55+ poetry run ruff .
5656
5757 - name : Lint with mypy
5858 run : poetry run mypy .
Original file line number Diff line number Diff line change @@ -11,12 +11,6 @@ entr_warn:
1111 @echo " See https://eradman.com/entrproject/ "
1212 @echo " ----------------------------------------------------------"
1313
14- isort :
15- poetry run isort ` ${PY_FILES} `
16-
17- black :
18- poetry run black ` ${PY_FILES} `
19-
2014test :
2115 poetry run py.test $(test )
2216
@@ -44,11 +38,11 @@ serve_docs:
4438dev_docs :
4539 $(MAKE ) -j watch_docs serve_docs
4640
47- flake8 :
48- poetry run flake8
41+ ruff :
42+ poetry run ruff .
4943
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
5246
5347mypy :
5448 poetry run mypy ` ${PY_FILES} `
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ $ cd libtmux
1111```
1212
1313``` console
14- $ poetry install -E " docs test coverage lint format "
14+ $ poetry install -E " docs test coverage lint ruff "
1515```
1616
1717Makefile commands prefixed with ` watch_ ` will watch files and rerun.
@@ -61,60 +61,62 @@ and `setup.cfg`:
6161
6262## Linting
6363
64- [ flake8] and [ mypy] run via CI in our GitHub Actions. See the configuration in ` pyproject.toml ` and
65- ` setup.cfg ` .
64+ ### ruff
6665
67- ### flake8
68-
69- [ flake8] provides fast, reliable, barebones styling and linting.
66+ The project uses [ ruff] to handles formatting, sorting imports and linting.
7067
7168```` {tab} Command
7269
7370poetry:
7471
7572```console
76- $ poetry run flake8
73+ $ poetry run ruff
7774```
7875
7976If you setup manually:
8077
8178```console
82- $ flake8
79+ $ ruff .
8380```
8481
8582````
8683
8784```` {tab} make
8885
8986```console
90- $ make flake8
87+ $ make ruff
9188```
9289
9390````
9491
9592```` {tab} Watch
9693
9794```console
98- $ make watch_flake8
95+ $ make watch_ruff
9996```
10097
10198requires [`entr(1)`].
10299
103100````
104101
105- ```` {tab} Configuration
102+ ```` {tab} Fix files
106103
107- See `[flake8]` in setup.cfg.
104+ poetry:
108105
109- ```{literalinclude} ../setup.cfg
110- :language: ini
111- :start-at: "[flake8]"
112- :end-before: "[isort]"
106+ ```console
107+ $ poetry run ruff . --fix
108+ ```
113109
110+ If you setup manually:
111+
112+ ```console
113+ $ ruff . --fix
114114```
115115
116116````
117117
118+
119+
118120### mypy
119121
120122[ mypy] is used for static type checking.
@@ -213,7 +215,5 @@ Update `__version__` in `__about__.py` and `pyproject.toml`::
213215[ poetry ] : https://python-poetry.org/
214216[ entr(1) ] : http://eradman.com/entrproject/
215217[ `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
219219[ mypy ] : http://mypy-lang.org/
You can’t perform that action at this time.
0 commit comments