66
77[ poetry] is a required package to develop.
88
9+ ``` console
10+ $ git clone https://github.com/vcs-python/libvcs.git
911```
10- git clone https://github.com/vcs-python/libvcs.git
11- cd libvcs
12- poetry install -E "docs test coverage lint format"
12+
13+ ``` console
14+ $ cd libvcs
15+ ```
16+
17+ ``` console
18+ $ poetry install -E " docs test coverage lint format"
1319```
1420
1521Makefile commands prefixed with ` watch_ ` will watch files and rerun.
1622
1723## Tests
1824
19- ```
20- poetry run py.test
25+ ``` console
26+ $ poetry run py.test
2127```
2228
2329Helpers: ` make test ` Rerun tests on file change: ` make watch_test ` (requires [ entr(1)] )
@@ -43,13 +49,105 @@ Rebuild docs on file change: `make watch_docs` (requires [entr(1)])
4349Rebuild docs and run server via one terminal: ` make dev_docs ` (requires above, and a ` make(1) ` with
4450` -J ` support, e.g. GNU Make)
4551
46- ## Formatting / Linting
52+ ## Formatting
53+
54+ The project uses [ black] and [ isort] (one after the other). Configurations are in ` pyproject.toml `
55+ and ` setup.cfg ` :
56+
57+ - ` make black isort ` : Run ` black ` first, then ` isort ` to handle import nuances
58+
59+ ## Linting
60+
61+ [ flake8] and [ mypy] run via CI in our GitHub Actions. See the configuration in ` pyproject.toml ` and
62+ ` setup.cfg ` .
63+
64+ ### flake8
65+
66+ [ flake8] provides fast, reliable, barebones styling and linting.
67+
68+ ```` {tab} Command
69+
70+ poetry:
71+
72+ ```console
73+ $ poetry run flake8
74+ ```
75+
76+ If you setup manually:
77+
78+ ```console
79+ $ flake8
80+ ```
81+
82+ ````
83+
84+ ```` {tab} make
85+
86+ ```console
87+ $ make flake8
88+ ```
89+
90+ ````
91+
92+ ```` {tab} Watch
93+
94+ ```console
95+ $ make watch_flake8
96+ ```
4797
48- The project uses [ black] and [ isort] (one after the other) and runs [ flake8] via CI. See the
49- configuration in ` pyproject.toml ` and ` setup.cfg ` :
98+ requires [`entr(1)`].
99+
100+ ````
101+
102+ ```` {tab} Configuration
103+
104+ See `[flake8]` in setup.cfg.
105+
106+ ```{literalinclude} ../../setup.cfg
107+ :language: ini
108+ :start-at: "[flake8]"
109+ :end-before: "[isort]"
110+
111+ ```
112+
113+ ````
114+
115+ ### mypy
116+
117+ [ mypy] is used for static type checking.
118+
119+ ```` {tab} Command
120+
121+ poetry:
122+
123+ ```console
124+ $ poetry run mypy .
125+ ```
126+
127+ If you setup manually:
128+
129+ ```console
130+ $ mypy .
131+ ```
132+
133+ ````
134+
135+ ```` {tab} make
136+
137+ ```console
138+ $ make mypy
139+ ```
140+
141+ ````
142+
143+ ```` {tab} Watch
144+
145+ ```console
146+ $ make watch_mypy
147+ ```
50148
51- ` make black isort ` : Run ` black ` first, then ` isort ` to handle import nuances ` make flake8 ` , to watch
52- (requires ` entr(1) ` ): ` make watch_flake8 `
149+ requires [`entr(1)`].
150+ ``` `
53151
54152## Releasing
55153
@@ -67,6 +165,8 @@ Update `__version__` in `__about__.py` and `pyproject.toml`::
67165
68166[ poetry ] : https://python-poetry.org/
69167[ entr(1) ] : http://eradman.com/entrproject/
168+ [ `entr(1)` ] : http://eradman.com/entrproject/
70169[ black ] : https://github.com/psf/black
71170[ isort ] : https://pypi.org/project/isort/
72171[ flake8 ] : https://flake8.pycqa.org/
172+ [ mypy ] : http://mypy-lang.org/
0 commit comments