File tree 1 file changed +104
-0
lines changed
1 file changed +104
-0
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,106 @@ this will load the `.tmuxp.yaml` in the root of the project.
334
334
335
335
```
336
336
337
+ ## Formatting
338
+
339
+ The project uses [ black] and [ isort] (one after the other). Configurations are in ` pyproject.toml `
340
+ and ` setup.cfg ` :
341
+
342
+ - ` make black isort ` : Run ` black ` first, then ` isort ` to handle import nuances
343
+
344
+ ## Linting
345
+
346
+ [ flake8] and [ mypy] run via CI in our GitHub Actions. See the configuration in ` pyproject.toml ` and
347
+ ` setup.cfg ` .
348
+
349
+ ### flake8
350
+
351
+ [ flake8] provides fast, reliable, barebones styling and linting.
352
+
353
+ ```` {tab} Command
354
+
355
+ poetry:
356
+
357
+ ```console
358
+ $ poetry run flake8
359
+ ```
360
+
361
+ If you setup manually:
362
+
363
+ ```console
364
+ $ flake8
365
+ ```
366
+
367
+ ````
368
+
369
+ ```` {tab} make
370
+
371
+ ```console
372
+ $ make flake8
373
+ ```
374
+
375
+ ````
376
+
377
+ ```` {tab} Watch
378
+
379
+ ```console
380
+ $ make watch_flake8
381
+ ```
382
+
383
+ requires [`entr(1)`].
384
+
385
+ ````
386
+
387
+ ```` {tab} Configuration
388
+
389
+ See `[flake8]` in setup.cfg.
390
+
391
+ ```{literalinclude} ../setup.cfg
392
+ :language: ini
393
+ :start-at: "[flake8]"
394
+ :end-before: "[isort]"
395
+
396
+ ```
397
+
398
+ ````
399
+
400
+ ### mypy
401
+
402
+ [ mypy] is used for static type checking.
403
+
404
+ ```` {tab} Command
405
+
406
+ poetry:
407
+
408
+ ```console
409
+ $ poetry run mypy .
410
+ ```
411
+
412
+ If you setup manually:
413
+
414
+ ```console
415
+ $ mypy .
416
+ ```
417
+
418
+ ````
419
+
420
+ ```` {tab} make
421
+
422
+ ```console
423
+ $ make mypy
424
+ ```
425
+
426
+ ````
427
+
428
+ ```` {tab} Watch
429
+
430
+ ```console
431
+ $ make watch_mypy
432
+ ```
433
+
434
+ requires [`entr(1)`].
435
+ ````
436
+
337
437
(gh-actions)=
338
438
339
439
## Continuous integration
@@ -350,6 +450,10 @@ the [gh build site].
350
450
[ py.test usage argument ] : https://pytest.org/latest/usage.html
351
451
[ entr ] : http://entrproject.org/
352
452
[ `entr(1)` ] : http://entrproject.org/
453
+ [ black ] : https://github.com/psf/black
454
+ [ isort ] : https://pypi.org/project/isort/
455
+ [ flake8 ] : https://flake8.pycqa.org/
456
+ [ mypy ] : http://mypy-lang.org/
353
457
[ github actions ] : https://github.com/features/actions
354
458
[ gh build site ] : https://github.com/tmux-python/tmuxp/actions?query=workflow%3Atests
355
459
[ .github/workflows/tests.yml ] : https://github.com/tmux-python/tmuxp/blob/master/.github/workflows/tests.yml
You can’t perform that action at this time.
0 commit comments