6
6
7
7
[ poetry] is a required package to develop.
8
8
9
+ ``` console
10
+ $ git clone https://github.com/vcs-python/libvcs.git
9
11
```
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"
13
19
```
14
20
15
21
Makefile commands prefixed with ` watch_ ` will watch files and rerun.
16
22
17
23
## Tests
18
24
19
- ```
20
- poetry run py.test
25
+ ``` console
26
+ $ poetry run py.test
21
27
```
22
28
23
29
Helpers: ` make test ` Rerun tests on file change: ` make watch_test ` (requires [ entr(1)] )
@@ -43,14 +49,105 @@ Rebuild docs on file change: `make watch_docs` (requires [entr(1)])
43
49
Rebuild docs and run server via one terminal: ` make dev_docs ` (requires above, and a ` make(1) ` with
44
50
` -J ` support, e.g. GNU Make)
45
51
46
- ## Formatting / Linting
52
+ ## Formatting
47
53
48
- The project uses [ black] and [ isort] (one after the other) and runs [ flake8 ] and [ mypy ] via CI. See
49
- the configuration in ` pyproject.toml ` and ` setup.cfg ` :
54
+ The project uses [ black] and [ isort] (one after the other). Configurations are in ` pyproject.toml `
55
+ and ` setup.cfg ` :
50
56
51
57
- ` make black isort ` : Run ` black ` first, then ` isort ` to handle import nuances
52
- - ` make flake8 ` , to watch (requires ` entr(1) ` ): ` make watch_flake8 `
53
- - ` make mypy ` , to watch (requires ` entr(1) ` ): ` make watch_mypy `
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
+ ```
97
+
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
+ ```
148
+
149
+ requires [`entr(1)`].
150
+ ````
54
151
55
152
## Releasing
56
153
@@ -68,6 +165,7 @@ Update `__version__` in `__about__.py` and `pyproject.toml`::
68
165
69
166
[ poetry ] : https://python-poetry.org/
70
167
[ entr(1) ] : http://eradman.com/entrproject/
168
+ [ `entr(1)` ] : http://eradman.com/entrproject/
71
169
[ black ] : https://github.com/psf/black
72
170
[ isort ] : https://pypi.org/project/isort/
73
171
[ flake8 ] : https://flake8.pycqa.org/
0 commit comments