Commit 28adeea
committed
Move config file resolver to library
When using stylua as a library, the only formatting interface it
provides are the `format_code` and `format_ast` functions, which both
already expect a config file. To replicate the config file discovery
that the stylua CLI implements, one would have to copy this.
My motivation: For one of my projects I'm creating bindings for other
languages to the stylua_lib. There it would be really useful, if I could
use the config file discovery.1 parent c2f8394 commit 28adeea
5 files changed
+347
-355
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 19 | | |
23 | 20 | | |
24 | 21 | | |
| |||
204 | 201 | | |
205 | 202 | | |
206 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
207 | 217 | | |
208 | 218 | | |
209 | 219 | | |
| |||
281 | 291 | | |
282 | 292 | | |
283 | 293 | | |
284 | | - | |
| 294 | + | |
285 | 295 | | |
286 | 296 | | |
287 | 297 | | |
| |||
0 commit comments