vexy-formi 1.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vexy_formi-1.0.4/.gitignore +354 -0
- vexy_formi-1.0.4/LICENSE +21 -0
- vexy_formi-1.0.4/PKG-INFO +184 -0
- vexy_formi-1.0.4/README.md +133 -0
- vexy_formi-1.0.4/pyproject.toml +480 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
!**/[Pp]ackages/build/
|
|
2
|
+
!.axoCover/settings.json
|
|
3
|
+
!.vscode/extensions.json
|
|
4
|
+
!.vscode/launch.json
|
|
5
|
+
!.vscode/settings.json
|
|
6
|
+
!.vscode/tasks.json
|
|
7
|
+
!?*.[Cc]ache/
|
|
8
|
+
!Directory.Build.rsp
|
|
9
|
+
!dist/.gitkeep
|
|
10
|
+
$tf/
|
|
11
|
+
*$py.class
|
|
12
|
+
**/*.DesktopClient/GeneratedArtifacts
|
|
13
|
+
**/*.DesktopClient/ModelManifest.xml
|
|
14
|
+
**/*.HTMLClient/GeneratedArtifacts
|
|
15
|
+
**/*.Server/GeneratedArtifacts
|
|
16
|
+
**/*.Server/ModelManifest.xml
|
|
17
|
+
**/[Pp]ackages/*
|
|
18
|
+
*- [Bb]ackup ([0-9]).rdl
|
|
19
|
+
*- [Bb]ackup ([0-9][0-9]).rdl
|
|
20
|
+
*- [Bb]ackup.rdl
|
|
21
|
+
*.[Cc]ache
|
|
22
|
+
*.[Pp]ublish.xml
|
|
23
|
+
*.[Rr]e[Ss]harper
|
|
24
|
+
*.a
|
|
25
|
+
*.aof
|
|
26
|
+
*.app
|
|
27
|
+
*.appx
|
|
28
|
+
*.appxbundle
|
|
29
|
+
*.appxupload
|
|
30
|
+
*.aps
|
|
31
|
+
*.azurePubxml
|
|
32
|
+
*.bim.layout
|
|
33
|
+
*.bim_*.settings
|
|
34
|
+
*.binlog
|
|
35
|
+
*.btm.cs
|
|
36
|
+
*.btp.cs
|
|
37
|
+
*.build.csdef
|
|
38
|
+
*.cab
|
|
39
|
+
*.cachefile
|
|
40
|
+
*.code-workspace
|
|
41
|
+
*.cover
|
|
42
|
+
*.coverage
|
|
43
|
+
*.coveragexml
|
|
44
|
+
*.d
|
|
45
|
+
*.dbmdl
|
|
46
|
+
*.dbproj.schemaview
|
|
47
|
+
*.dll
|
|
48
|
+
*.dotCover
|
|
49
|
+
*.DotSettings.user
|
|
50
|
+
*.dsp
|
|
51
|
+
*.dsw
|
|
52
|
+
*.dylib
|
|
53
|
+
*.e2e
|
|
54
|
+
*.egg
|
|
55
|
+
*.egg-info/
|
|
56
|
+
*.exe
|
|
57
|
+
*.gch
|
|
58
|
+
*.GhostDoc.xml
|
|
59
|
+
*.gpState
|
|
60
|
+
*.ilk
|
|
61
|
+
*.iobj
|
|
62
|
+
*.ipdb
|
|
63
|
+
*.jfm
|
|
64
|
+
*.jmconfig
|
|
65
|
+
*.la
|
|
66
|
+
*.lai
|
|
67
|
+
*.ldf
|
|
68
|
+
*.lib
|
|
69
|
+
*.lo
|
|
70
|
+
*.log
|
|
71
|
+
*.manifest
|
|
72
|
+
*.mdf
|
|
73
|
+
*.meta
|
|
74
|
+
*.mm.*
|
|
75
|
+
*.mo
|
|
76
|
+
*.mod
|
|
77
|
+
*.msi
|
|
78
|
+
*.msix
|
|
79
|
+
*.msm
|
|
80
|
+
*.msp
|
|
81
|
+
*.ncb
|
|
82
|
+
*.ndf
|
|
83
|
+
*.nuget.props
|
|
84
|
+
*.nuget.targets
|
|
85
|
+
*.nupkg
|
|
86
|
+
*.nvuser
|
|
87
|
+
*.o
|
|
88
|
+
*.obj
|
|
89
|
+
*.odx.cs
|
|
90
|
+
*.opendb
|
|
91
|
+
*.opensdf
|
|
92
|
+
*.opt
|
|
93
|
+
*.out
|
|
94
|
+
*.pch
|
|
95
|
+
*.pdb
|
|
96
|
+
*.pfx
|
|
97
|
+
*.pgc
|
|
98
|
+
*.pgd
|
|
99
|
+
*.pid
|
|
100
|
+
*.pidb
|
|
101
|
+
*.plg
|
|
102
|
+
*.pot
|
|
103
|
+
*.psess
|
|
104
|
+
*.publishproj
|
|
105
|
+
*.publishsettings
|
|
106
|
+
*.pubxml
|
|
107
|
+
*.py,cover
|
|
108
|
+
*.py.cover
|
|
109
|
+
*.py[cod]
|
|
110
|
+
*.py[codz]
|
|
111
|
+
*.pyc
|
|
112
|
+
*.rdb
|
|
113
|
+
*.rdl.data
|
|
114
|
+
*.rptproj.bak
|
|
115
|
+
*.rptproj.rsuser
|
|
116
|
+
*.rsp
|
|
117
|
+
*.rsuser
|
|
118
|
+
*.sage.py
|
|
119
|
+
*.sap
|
|
120
|
+
*.sbr
|
|
121
|
+
*.scc
|
|
122
|
+
*.sdf
|
|
123
|
+
*.sln.docstates
|
|
124
|
+
*.sln.iml
|
|
125
|
+
*.slo
|
|
126
|
+
*.smod
|
|
127
|
+
*.snupkg
|
|
128
|
+
*.so
|
|
129
|
+
*.spec
|
|
130
|
+
*.suo
|
|
131
|
+
*.svclog
|
|
132
|
+
*.swo
|
|
133
|
+
*.swp
|
|
134
|
+
*.tlb
|
|
135
|
+
*.tlh
|
|
136
|
+
*.tli
|
|
137
|
+
*.tlog
|
|
138
|
+
*.tmp
|
|
139
|
+
*.tmp_proj
|
|
140
|
+
*.tss
|
|
141
|
+
*.user
|
|
142
|
+
*.userosscache
|
|
143
|
+
*.userprefs
|
|
144
|
+
*.vbp
|
|
145
|
+
*.vbw
|
|
146
|
+
*.VC.db
|
|
147
|
+
*.VC.VC.opendb
|
|
148
|
+
*.VisualState.xml
|
|
149
|
+
*.vsp
|
|
150
|
+
*.vspscc
|
|
151
|
+
*.vspx
|
|
152
|
+
*.vssscc
|
|
153
|
+
*.xsd.cs
|
|
154
|
+
*_autogen/
|
|
155
|
+
*_h.h
|
|
156
|
+
*_i.c
|
|
157
|
+
*_p.c
|
|
158
|
+
*_wpftmp.csproj
|
|
159
|
+
*~
|
|
160
|
+
.*crunch*.local.xml
|
|
161
|
+
._*
|
|
162
|
+
.abstra/
|
|
163
|
+
.axoCover/*
|
|
164
|
+
.builds
|
|
165
|
+
.cache
|
|
166
|
+
.coverage
|
|
167
|
+
.coverage.*
|
|
168
|
+
.cr/personal
|
|
169
|
+
.dmypy.json
|
|
170
|
+
.DS_Store
|
|
171
|
+
.DS_Store?
|
|
172
|
+
.eggs/
|
|
173
|
+
.env
|
|
174
|
+
.envrc
|
|
175
|
+
.fake/
|
|
176
|
+
.history/
|
|
177
|
+
.hypothesis/
|
|
178
|
+
.idea/
|
|
179
|
+
.installed.cfg
|
|
180
|
+
.ionide/
|
|
181
|
+
.ipynb_checkpoints
|
|
182
|
+
.localhistory/
|
|
183
|
+
.mfractor/
|
|
184
|
+
.mypy_cache/
|
|
185
|
+
.nox/
|
|
186
|
+
.ntvs_analysis.dat
|
|
187
|
+
.paket/paket.exe
|
|
188
|
+
.pdm-build/
|
|
189
|
+
.pdm-python
|
|
190
|
+
.pixi
|
|
191
|
+
.pybuilder/
|
|
192
|
+
.pypirc
|
|
193
|
+
.pyre/
|
|
194
|
+
.pytest_cache/
|
|
195
|
+
.Python
|
|
196
|
+
.pytype/
|
|
197
|
+
.ropeproject
|
|
198
|
+
.ruff_cache/
|
|
199
|
+
.sass-cache/
|
|
200
|
+
.scrapy
|
|
201
|
+
.Spotlight-V100
|
|
202
|
+
.spyderproject
|
|
203
|
+
.spyproject
|
|
204
|
+
.streamlit/secrets.toml
|
|
205
|
+
.tox/
|
|
206
|
+
.Trashes
|
|
207
|
+
.venv
|
|
208
|
+
.vs/
|
|
209
|
+
.vscode
|
|
210
|
+
.vscode/
|
|
211
|
+
.vscode/*
|
|
212
|
+
.vshistory/
|
|
213
|
+
.webassets-cache
|
|
214
|
+
/site
|
|
215
|
+
[Aa][Rr][Mm]/
|
|
216
|
+
[Aa][Rr][Mm]64/
|
|
217
|
+
[Bb]in/
|
|
218
|
+
[Bb]uild[Ll]og.*
|
|
219
|
+
[Dd]ebug/
|
|
220
|
+
[Dd]ebugPS/
|
|
221
|
+
[Dd]ebugPublic/
|
|
222
|
+
[Ee]xpress/
|
|
223
|
+
[Ll]og/
|
|
224
|
+
[Ll]ogs/
|
|
225
|
+
[Oo]bj/
|
|
226
|
+
[Rr]elease/
|
|
227
|
+
[Rr]eleasePS/
|
|
228
|
+
[Rr]eleases/
|
|
229
|
+
[Tt]est[Rr]esult*/
|
|
230
|
+
[Ww][Ii][Nn]32/
|
|
231
|
+
__marimo__/
|
|
232
|
+
__pycache__/
|
|
233
|
+
__pypackages__/
|
|
234
|
+
__version__.py
|
|
235
|
+
_Chutzpah*
|
|
236
|
+
_deps
|
|
237
|
+
_NCrunch_*
|
|
238
|
+
_pkginfo.txt
|
|
239
|
+
_private
|
|
240
|
+
_Pvt_Extensions
|
|
241
|
+
_ReSharper*/
|
|
242
|
+
_TeamCity*
|
|
243
|
+
_UpgradeReport_Files/
|
|
244
|
+
_version.py
|
|
245
|
+
activemq-data/
|
|
246
|
+
AppPackages/
|
|
247
|
+
artifacts/
|
|
248
|
+
ASALocalRun/
|
|
249
|
+
AutoTest.Net/
|
|
250
|
+
Backup*/
|
|
251
|
+
BenchmarkDotNet.Artifacts/
|
|
252
|
+
bld/
|
|
253
|
+
build/
|
|
254
|
+
BundleArtifacts/
|
|
255
|
+
celerybeat-schedule
|
|
256
|
+
celerybeat.pid
|
|
257
|
+
ClientBin/
|
|
258
|
+
cmake_install.cmake
|
|
259
|
+
CMakeCache.txt
|
|
260
|
+
CMakeFiles
|
|
261
|
+
CMakeLists.txt.user
|
|
262
|
+
CMakeScripts
|
|
263
|
+
CMakeUserPresets.json
|
|
264
|
+
compile_commands.json
|
|
265
|
+
cover/
|
|
266
|
+
coverage*.info
|
|
267
|
+
coverage*.json
|
|
268
|
+
coverage*.xml
|
|
269
|
+
coverage.xml
|
|
270
|
+
csx/
|
|
271
|
+
CTestTestfile.cmake
|
|
272
|
+
cython_debug/
|
|
273
|
+
db.sqlite3
|
|
274
|
+
db.sqlite3-journal
|
|
275
|
+
develop-eggs/
|
|
276
|
+
dist/
|
|
277
|
+
dlldata.c
|
|
278
|
+
dmypy.json
|
|
279
|
+
DocProject/buildhelp/
|
|
280
|
+
DocProject/Help/*.hhc
|
|
281
|
+
DocProject/Help/*.hhk
|
|
282
|
+
DocProject/Help/*.hhp
|
|
283
|
+
DocProject/Help/*.HxC
|
|
284
|
+
DocProject/Help/*.HxT
|
|
285
|
+
DocProject/Help/html
|
|
286
|
+
DocProject/Help/Html2
|
|
287
|
+
docs/_build/
|
|
288
|
+
downloads/
|
|
289
|
+
ecf/
|
|
290
|
+
eggs/
|
|
291
|
+
ehthumbs.db
|
|
292
|
+
env.bak/
|
|
293
|
+
env/
|
|
294
|
+
ENV/
|
|
295
|
+
FakesAssemblies/
|
|
296
|
+
FodyWeavers.xsd
|
|
297
|
+
Generated\ Files/
|
|
298
|
+
Generated_Code/
|
|
299
|
+
healthchecksdb
|
|
300
|
+
htmlcov/
|
|
301
|
+
install_manifest.txt
|
|
302
|
+
instance/
|
|
303
|
+
ipch/
|
|
304
|
+
ipython_config.py
|
|
305
|
+
lib/
|
|
306
|
+
lib64/
|
|
307
|
+
local_settings.py
|
|
308
|
+
Makefile
|
|
309
|
+
MANIFEST
|
|
310
|
+
marimo/_lsp/
|
|
311
|
+
marimo/_static/
|
|
312
|
+
MigrationBackup/
|
|
313
|
+
mnesia/
|
|
314
|
+
mono_crash.*
|
|
315
|
+
nCrunchTemp_*
|
|
316
|
+
node_modules/
|
|
317
|
+
nosetests.xml
|
|
318
|
+
nunit-*.xml
|
|
319
|
+
OpenCover/
|
|
320
|
+
orleans.codegen.cs
|
|
321
|
+
Package.StoreAssociation.xml
|
|
322
|
+
paket-files/
|
|
323
|
+
parts/
|
|
324
|
+
pip-delete-this-directory.txt
|
|
325
|
+
pip-log.txt
|
|
326
|
+
profile_default/
|
|
327
|
+
project.fragment.lock.json
|
|
328
|
+
project.lock.json
|
|
329
|
+
publish/
|
|
330
|
+
PublishScripts/
|
|
331
|
+
rabbitmq-data/
|
|
332
|
+
rabbitmq/
|
|
333
|
+
rcf/
|
|
334
|
+
ScaffoldingReadMe.txt
|
|
335
|
+
sdist/
|
|
336
|
+
ServiceFabricBackup/
|
|
337
|
+
share/python-wheels/
|
|
338
|
+
StyleCopReport.xml
|
|
339
|
+
target/
|
|
340
|
+
Testing
|
|
341
|
+
TestResult.xml
|
|
342
|
+
Thumbs.db
|
|
343
|
+
UpgradeLog*.htm
|
|
344
|
+
UpgradeLog*.XML
|
|
345
|
+
var/
|
|
346
|
+
venv.bak/
|
|
347
|
+
venv/
|
|
348
|
+
VERSION.txt
|
|
349
|
+
wheels/
|
|
350
|
+
x64/
|
|
351
|
+
x86/
|
|
352
|
+
~$*
|
|
353
|
+
|
|
354
|
+
external
|
vexy_formi-1.0.4/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Fontlab Ltd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vexy-formi
|
|
3
|
+
Version: 1.0.4
|
|
4
|
+
Summary: Fast code formatting and minification tool using the best available tools
|
|
5
|
+
Project-URL: Documentation, https://github.com/vexyart/vexy-formi#readme
|
|
6
|
+
Project-URL: Issues, https://github.com/vexyart/vexy-formi/issues
|
|
7
|
+
Project-URL: Source, https://github.com/vexyart/vexy-formi
|
|
8
|
+
Author-email: Fontlab Ltd <opensource@vexy.art>
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: biome,code-formatter,esbuild,formatter,minifier,ruff,swc
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
21
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
22
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
23
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
24
|
+
Classifier: Topic :: Utilities
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: chardet>=5.0.0
|
|
27
|
+
Requires-Dist: fire>=0.7.0
|
|
28
|
+
Requires-Dist: pathspec>=0.12.0
|
|
29
|
+
Requires-Dist: rich>=13.0.0
|
|
30
|
+
Provides-Extra: all
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: absolufy-imports>=0.3.1; extra == 'dev'
|
|
33
|
+
Requires-Dist: isort>=6.0.1; extra == 'dev'
|
|
34
|
+
Requires-Dist: mypy>=1.15.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: pre-commit>=4.1.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: pyupgrade>=3.19.1; extra == 'dev'
|
|
37
|
+
Requires-Dist: ruff>=0.9.7; extra == 'dev'
|
|
38
|
+
Provides-Extra: docs
|
|
39
|
+
Requires-Dist: myst-parser>=3.0.0; extra == 'docs'
|
|
40
|
+
Requires-Dist: sphinx-autodoc-typehints>=2.0.0; extra == 'docs'
|
|
41
|
+
Requires-Dist: sphinx-rtd-theme>=2.0.0; extra == 'docs'
|
|
42
|
+
Requires-Dist: sphinx>=7.2.6; extra == 'docs'
|
|
43
|
+
Provides-Extra: test
|
|
44
|
+
Requires-Dist: coverage[toml]>=7.6.12; extra == 'test'
|
|
45
|
+
Requires-Dist: pytest-asyncio>=0.25.3; extra == 'test'
|
|
46
|
+
Requires-Dist: pytest-benchmark[histogram]>=5.1.0; extra == 'test'
|
|
47
|
+
Requires-Dist: pytest-cov>=6.0.0; extra == 'test'
|
|
48
|
+
Requires-Dist: pytest-xdist>=3.6.1; extra == 'test'
|
|
49
|
+
Requires-Dist: pytest>=8.3.4; extra == 'test'
|
|
50
|
+
Description-Content-Type: text/markdown
|
|
51
|
+
|
|
52
|
+
# VexyFormi
|
|
53
|
+
|
|
54
|
+
Fast code formatting and minification using the best available tools.
|
|
55
|
+
|
|
56
|
+
## Features
|
|
57
|
+
|
|
58
|
+
- 🔥 **Blazing Fast**: Uses fastest available tools (esbuild, swc, biome, ruff)
|
|
59
|
+
- 🛡️ **Safe**: Atomic operations with automatic backups
|
|
60
|
+
- 🎯 **Smart**: Automatic tool detection and fallbacks
|
|
61
|
+
- 📦 **Simple**: Zero-config operation with sensible defaults
|
|
62
|
+
- 🌐 **Universal**: Supports JS, TS, CSS, HTML, Python, JSON, YAML, TOML, Markdown
|
|
63
|
+
|
|
64
|
+
## Quick Start
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Install
|
|
68
|
+
pip install vexy-formi
|
|
69
|
+
|
|
70
|
+
# Install all required tools automatically
|
|
71
|
+
vfor install
|
|
72
|
+
|
|
73
|
+
# Minify current directory
|
|
74
|
+
vfor mini
|
|
75
|
+
|
|
76
|
+
# Format Python files
|
|
77
|
+
vfor fmt --verbose src/
|
|
78
|
+
|
|
79
|
+
# Show available tools
|
|
80
|
+
vfor tools
|
|
81
|
+
|
|
82
|
+
# Update all tools to latest versions
|
|
83
|
+
vfor update
|
|
84
|
+
|
|
85
|
+
# Use as Python package
|
|
86
|
+
python -c "import vexy_formi; vexy_formi.minify('src/')"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Supported Tools
|
|
90
|
+
|
|
91
|
+
- **JavaScript/TypeScript**: esbuild, swc, terser, biome, prettier
|
|
92
|
+
- **CSS/SCSS**: biome, lightningcss, prettier
|
|
93
|
+
- **Python**: ruff, black
|
|
94
|
+
- **HTML**: html-minifier-terser, prettier
|
|
95
|
+
- **JSON**: biome, jq, prettier
|
|
96
|
+
- **TOML**: taplo, dprint
|
|
97
|
+
- **YAML**: prettier, yq
|
|
98
|
+
- **Markdown**: dprint, prettier
|
|
99
|
+
|
|
100
|
+
## Configuration
|
|
101
|
+
|
|
102
|
+
Set preferences via environment variables:
|
|
103
|
+
- `VFOR_PREFERRED_JS_TOOL=esbuild`
|
|
104
|
+
- `VFOR_PREFERRED_CSS_TOOL=biome`
|
|
105
|
+
- `VFOR_PREFERRED_PYTHON_TOOL=ruff`
|
|
106
|
+
- `VFOR_MAX_WORKERS=8`
|
|
107
|
+
|
|
108
|
+
Or create `.vfor.json` in your project:
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"preferred_js_tool": "esbuild",
|
|
112
|
+
"preferred_css_tool": "biome",
|
|
113
|
+
"max_workers": 4
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## CLI Usage
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Minify files
|
|
121
|
+
vfor mini # Current directory
|
|
122
|
+
vfor mini src/ # Specific directory
|
|
123
|
+
vfor mini --verbose src/ # Show detailed output
|
|
124
|
+
vfor mini --no-backup src/ # Skip backups
|
|
125
|
+
|
|
126
|
+
# Format files
|
|
127
|
+
vfor fmt # Current directory
|
|
128
|
+
vfor fmt --recursive src/ # Process recursively
|
|
129
|
+
vfor fmt --exclude "*.min.*" # Exclude patterns
|
|
130
|
+
|
|
131
|
+
# Tool management
|
|
132
|
+
vfor install # Install all required tools
|
|
133
|
+
vfor update # Update tools to latest versions
|
|
134
|
+
vfor tools # Show available tools
|
|
135
|
+
vfor cleanup # Clean backup files
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Python API
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
import vexy_formi
|
|
142
|
+
|
|
143
|
+
# Simple API
|
|
144
|
+
result = vexy_formi.minify('src/')
|
|
145
|
+
result = vexy_formi.format('src/', recursive=True, exclude=['*.test.*'])
|
|
146
|
+
|
|
147
|
+
# Advanced usage
|
|
148
|
+
from vexy_formi import FileProcessor
|
|
149
|
+
|
|
150
|
+
processor = FileProcessor()
|
|
151
|
+
result = processor.minify_files(
|
|
152
|
+
Path('src/'),
|
|
153
|
+
recursive=True,
|
|
154
|
+
max_workers=8,
|
|
155
|
+
create_backup=True
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
print(f"Processed {result.total_files} files")
|
|
159
|
+
print(f"Size reduction: {result.total_size_reduction_percent:.1f}%")
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Development
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Clone repository
|
|
166
|
+
git clone https://github.com/vexyart/vexy-formi.git
|
|
167
|
+
cd vexy-formi
|
|
168
|
+
|
|
169
|
+
# Install dependencies
|
|
170
|
+
pip install -e .[dev,test]
|
|
171
|
+
|
|
172
|
+
# Run CLI directly
|
|
173
|
+
./vfor mini examples/
|
|
174
|
+
|
|
175
|
+
# Run tests
|
|
176
|
+
pytest
|
|
177
|
+
|
|
178
|
+
# Format code
|
|
179
|
+
ruff format src/
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## License
|
|
183
|
+
|
|
184
|
+
MIT License
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# VexyFormi
|
|
2
|
+
|
|
3
|
+
Fast code formatting and minification using the best available tools.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🔥 **Blazing Fast**: Uses fastest available tools (esbuild, swc, biome, ruff)
|
|
8
|
+
- 🛡️ **Safe**: Atomic operations with automatic backups
|
|
9
|
+
- 🎯 **Smart**: Automatic tool detection and fallbacks
|
|
10
|
+
- 📦 **Simple**: Zero-config operation with sensible defaults
|
|
11
|
+
- 🌐 **Universal**: Supports JS, TS, CSS, HTML, Python, JSON, YAML, TOML, Markdown
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Install
|
|
17
|
+
pip install vexy-formi
|
|
18
|
+
|
|
19
|
+
# Install all required tools automatically
|
|
20
|
+
vfor install
|
|
21
|
+
|
|
22
|
+
# Minify current directory
|
|
23
|
+
vfor mini
|
|
24
|
+
|
|
25
|
+
# Format Python files
|
|
26
|
+
vfor fmt --verbose src/
|
|
27
|
+
|
|
28
|
+
# Show available tools
|
|
29
|
+
vfor tools
|
|
30
|
+
|
|
31
|
+
# Update all tools to latest versions
|
|
32
|
+
vfor update
|
|
33
|
+
|
|
34
|
+
# Use as Python package
|
|
35
|
+
python -c "import vexy_formi; vexy_formi.minify('src/')"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Supported Tools
|
|
39
|
+
|
|
40
|
+
- **JavaScript/TypeScript**: esbuild, swc, terser, biome, prettier
|
|
41
|
+
- **CSS/SCSS**: biome, lightningcss, prettier
|
|
42
|
+
- **Python**: ruff, black
|
|
43
|
+
- **HTML**: html-minifier-terser, prettier
|
|
44
|
+
- **JSON**: biome, jq, prettier
|
|
45
|
+
- **TOML**: taplo, dprint
|
|
46
|
+
- **YAML**: prettier, yq
|
|
47
|
+
- **Markdown**: dprint, prettier
|
|
48
|
+
|
|
49
|
+
## Configuration
|
|
50
|
+
|
|
51
|
+
Set preferences via environment variables:
|
|
52
|
+
- `VFOR_PREFERRED_JS_TOOL=esbuild`
|
|
53
|
+
- `VFOR_PREFERRED_CSS_TOOL=biome`
|
|
54
|
+
- `VFOR_PREFERRED_PYTHON_TOOL=ruff`
|
|
55
|
+
- `VFOR_MAX_WORKERS=8`
|
|
56
|
+
|
|
57
|
+
Or create `.vfor.json` in your project:
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"preferred_js_tool": "esbuild",
|
|
61
|
+
"preferred_css_tool": "biome",
|
|
62
|
+
"max_workers": 4
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## CLI Usage
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Minify files
|
|
70
|
+
vfor mini # Current directory
|
|
71
|
+
vfor mini src/ # Specific directory
|
|
72
|
+
vfor mini --verbose src/ # Show detailed output
|
|
73
|
+
vfor mini --no-backup src/ # Skip backups
|
|
74
|
+
|
|
75
|
+
# Format files
|
|
76
|
+
vfor fmt # Current directory
|
|
77
|
+
vfor fmt --recursive src/ # Process recursively
|
|
78
|
+
vfor fmt --exclude "*.min.*" # Exclude patterns
|
|
79
|
+
|
|
80
|
+
# Tool management
|
|
81
|
+
vfor install # Install all required tools
|
|
82
|
+
vfor update # Update tools to latest versions
|
|
83
|
+
vfor tools # Show available tools
|
|
84
|
+
vfor cleanup # Clean backup files
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Python API
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
import vexy_formi
|
|
91
|
+
|
|
92
|
+
# Simple API
|
|
93
|
+
result = vexy_formi.minify('src/')
|
|
94
|
+
result = vexy_formi.format('src/', recursive=True, exclude=['*.test.*'])
|
|
95
|
+
|
|
96
|
+
# Advanced usage
|
|
97
|
+
from vexy_formi import FileProcessor
|
|
98
|
+
|
|
99
|
+
processor = FileProcessor()
|
|
100
|
+
result = processor.minify_files(
|
|
101
|
+
Path('src/'),
|
|
102
|
+
recursive=True,
|
|
103
|
+
max_workers=8,
|
|
104
|
+
create_backup=True
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
print(f"Processed {result.total_files} files")
|
|
108
|
+
print(f"Size reduction: {result.total_size_reduction_percent:.1f}%")
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Development
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Clone repository
|
|
115
|
+
git clone https://github.com/vexyart/vexy-formi.git
|
|
116
|
+
cd vexy-formi
|
|
117
|
+
|
|
118
|
+
# Install dependencies
|
|
119
|
+
pip install -e .[dev,test]
|
|
120
|
+
|
|
121
|
+
# Run CLI directly
|
|
122
|
+
./vfor mini examples/
|
|
123
|
+
|
|
124
|
+
# Run tests
|
|
125
|
+
pytest
|
|
126
|
+
|
|
127
|
+
# Format code
|
|
128
|
+
ruff format src/
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
MIT License
|
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
# this_file: pyproject.toml
|
|
2
|
+
#==============================================================================
|
|
3
|
+
# VEXY-FORMI PACKAGE CONFIGURATION
|
|
4
|
+
# This pyproject.toml defines the package metadata, dependencies, build system,
|
|
5
|
+
# and development environment for the vexy-formi package.
|
|
6
|
+
#==============================================================================
|
|
7
|
+
|
|
8
|
+
#------------------------------------------------------------------------------
|
|
9
|
+
# PROJECT METADATA
|
|
10
|
+
# Core package information used by PyPI and package managers.
|
|
11
|
+
#------------------------------------------------------------------------------
|
|
12
|
+
[project]
|
|
13
|
+
name = 'vexy-formi' # Package name on PyPI
|
|
14
|
+
description = 'Fast code formatting and minification tool using the best available tools' # Short description
|
|
15
|
+
readme = 'README.md' # Path to README file
|
|
16
|
+
requires-python = '>=3.10' # Minimum Python version
|
|
17
|
+
keywords = [
|
|
18
|
+
'formatter', 'minifier', 'code-formatter', 'esbuild', 'swc', 'biome', 'ruff'
|
|
19
|
+
] # Keywords for PyPI search
|
|
20
|
+
dynamic = ["version"] # Fields set dynamically at build time
|
|
21
|
+
|
|
22
|
+
# PyPI classifiers for package categorization
|
|
23
|
+
classifiers = [
|
|
24
|
+
'Development Status :: 4 - Beta', # Package maturity level
|
|
25
|
+
'Programming Language :: Python',
|
|
26
|
+
'Programming Language :: Python :: 3.10',
|
|
27
|
+
'Programming Language :: Python :: 3.11',
|
|
28
|
+
'Programming Language :: Python :: 3.12',
|
|
29
|
+
'Programming Language :: Python :: Implementation :: CPython',
|
|
30
|
+
'Programming Language :: Python :: Implementation :: PyPy',
|
|
31
|
+
'Operating System :: OS Independent',
|
|
32
|
+
'License :: OSI Approved :: MIT License',
|
|
33
|
+
'Intended Audience :: Developers',
|
|
34
|
+
'Topic :: Software Development :: Quality Assurance',
|
|
35
|
+
'Topic :: Software Development :: Code Generators',
|
|
36
|
+
'Topic :: Utilities',
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
dependencies = [
|
|
40
|
+
'fire>=0.7.0',
|
|
41
|
+
'rich>=13.0.0',
|
|
42
|
+
'pathspec>=0.12.0',
|
|
43
|
+
'chardet>=5.0.0'
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
# Author information
|
|
47
|
+
[[project.authors]]
|
|
48
|
+
name = 'Fontlab Ltd'
|
|
49
|
+
email = 'opensource@vexy.art'
|
|
50
|
+
|
|
51
|
+
# License information
|
|
52
|
+
[project.license]
|
|
53
|
+
text = 'MIT'
|
|
54
|
+
|
|
55
|
+
# Project URLs
|
|
56
|
+
[project.urls]
|
|
57
|
+
Documentation = 'https://github.com/vexyart/vexy-formi#readme'
|
|
58
|
+
Issues = 'https://github.com/vexyart/vexy-formi/issues'
|
|
59
|
+
Source = 'https://github.com/vexyart/vexy-formi'
|
|
60
|
+
|
|
61
|
+
#------------------------------------------------------------------------------
|
|
62
|
+
# OPTIONAL DEPENDENCIES
|
|
63
|
+
# Additional dependencies for optional features, development, and testing.
|
|
64
|
+
#------------------------------------------------------------------------------
|
|
65
|
+
[project.optional-dependencies]
|
|
66
|
+
|
|
67
|
+
# Development tools
|
|
68
|
+
dev = [
|
|
69
|
+
'pre-commit>=4.1.0', # Pre-commit hook manager - Keep pre-commit as is, update if newer pre-commit version is required
|
|
70
|
+
'ruff>=0.9.7', # Linting and formatting - Keep ruff as is, update if newer ruff version is required
|
|
71
|
+
'mypy>=1.15.0', # Type checking - Keep mypy as is, update if newer mypy version is required
|
|
72
|
+
'absolufy-imports>=0.3.1', # Convert relative imports to absolute - Keep absolufy-imports as is, update if newer absolufy-imports version is required
|
|
73
|
+
'pyupgrade>=3.19.1', # Upgrade Python syntax - Keep pyupgrade as is, update if newer pyupgrade version is required
|
|
74
|
+
'isort>=6.0.1', # Sort imports - Keep isort as is, update if newer isort version is required
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
# Testing tools and frameworks
|
|
78
|
+
test = [
|
|
79
|
+
'pytest>=8.3.4', # Testing framework - Keep pytest as is, update if newer pytest version is required
|
|
80
|
+
'pytest-cov>=6.0.0', # Coverage plugin for pytest - Keep pytest-cov as is, update if newer pytest-cov version is required
|
|
81
|
+
'pytest-xdist>=3.6.1', # Parallel test execution - Keep pytest-xdist as is, update if newer pytest-xdist version is required
|
|
82
|
+
'pytest-benchmark[histogram]>=5.1.0', # Benchmarking plugin - Keep pytest-benchmark as is, update if newer pytest-benchmark version is required
|
|
83
|
+
'pytest-asyncio>=0.25.3', # Async test support - Keep pytest-asyncio as is, update if newer pytest-asyncio version is required
|
|
84
|
+
'coverage[toml]>=7.6.12',
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
docs = [
|
|
88
|
+
"sphinx>=7.2.6",
|
|
89
|
+
"sphinx-rtd-theme>=2.0.0",
|
|
90
|
+
"sphinx-autodoc-typehints>=2.0.0",
|
|
91
|
+
"myst-parser>=3.0.0", # Markdown support in Sphinx
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
# All optional dependencies combined
|
|
95
|
+
all = [
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
#------------------------------------------------------------------------------
|
|
99
|
+
# COMMAND-LINE SCRIPTS
|
|
100
|
+
# Entry points for command-line executables installed with the package.
|
|
101
|
+
#------------------------------------------------------------------------------
|
|
102
|
+
[project.scripts]
|
|
103
|
+
vfor = "vexy_formi.cli:main"
|
|
104
|
+
|
|
105
|
+
#------------------------------------------------------------------------------
|
|
106
|
+
# BUILD SYSTEM CONFIGURATION
|
|
107
|
+
# Defines the tools required to build the package and the build backend.
|
|
108
|
+
#------------------------------------------------------------------------------
|
|
109
|
+
[build-system]
|
|
110
|
+
# Hatchling is a modern build backend for Python packaging
|
|
111
|
+
# hatch-vcs integrates with version control systems for versioning
|
|
112
|
+
requires = [
|
|
113
|
+
'hatchling>=1.27.0',
|
|
114
|
+
'hatch-vcs>=0.4.0',
|
|
115
|
+
]
|
|
116
|
+
build-backend = 'hatchling.build'
|
|
117
|
+
|
|
118
|
+
#------------------------------------------------------------------------------
|
|
119
|
+
# UV TOOL CONFIGURATION
|
|
120
|
+
# Modern Python package installer and resolver configuration
|
|
121
|
+
#------------------------------------------------------------------------------
|
|
122
|
+
[tool.uv]
|
|
123
|
+
dev-dependencies = [
|
|
124
|
+
"pre-commit>=4.1.0",
|
|
125
|
+
"ruff>=0.9.7",
|
|
126
|
+
"mypy>=1.15.0",
|
|
127
|
+
"pytest>=8.3.4",
|
|
128
|
+
"pytest-cov>=6.0.0",
|
|
129
|
+
"pytest-xdist>=3.6.1",
|
|
130
|
+
"pytest-benchmark[histogram]>=5.1.0",
|
|
131
|
+
"coverage[toml]>=7.6.12",
|
|
132
|
+
]
|
|
133
|
+
# Use hatch for project management, uv for fast installs
|
|
134
|
+
managed = false # Let hatch manage environments
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
#------------------------------------------------------------------------------
|
|
138
|
+
# HATCH BUILD CONFIGURATION
|
|
139
|
+
# Configures the build process, specifying which packages to include and
|
|
140
|
+
# how to handle versioning.
|
|
141
|
+
#------------------------------------------------------------------------------
|
|
142
|
+
[tool.hatch.build]
|
|
143
|
+
# Include package data files
|
|
144
|
+
include = [
|
|
145
|
+
"src/vexy_formi/py.typed", # For better type checking support
|
|
146
|
+
"src/vexy_formi/data/**/*", # Include data files if any
|
|
147
|
+
|
|
148
|
+
]
|
|
149
|
+
exclude = ["**/__pycache__", "**/.pytest_cache", "**/.mypy_cache"]
|
|
150
|
+
|
|
151
|
+
[tool.hatch.build.targets.wheel]
|
|
152
|
+
packages = ["src/vexy_formi"]
|
|
153
|
+
reproducible = true
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
# Version source configuration - hatch-vcs for git-tag-based semver
|
|
157
|
+
[tool.hatch.version]
|
|
158
|
+
source = "vcs"
|
|
159
|
+
|
|
160
|
+
# VCS version configuration
|
|
161
|
+
[tool.hatch.version.raw-options]
|
|
162
|
+
# Match tags like v1.0.0, v1.2.3
|
|
163
|
+
tag_regex = "^v(?P<version>[^+]+)(?:\\+.*)?$"
|
|
164
|
+
|
|
165
|
+
# Metadata handling configuration
|
|
166
|
+
[tool.hatch.metadata]
|
|
167
|
+
allow-direct-references = true # Allow direct references in metadata (useful for local dependencies)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
#------------------------------------------------------------------------------
|
|
171
|
+
# DEVELOPMENT ENVIRONMENTS
|
|
172
|
+
|
|
173
|
+
[tool.hatch.envs.default]
|
|
174
|
+
features = ['dev', 'test', 'all']
|
|
175
|
+
dependencies = []
|
|
176
|
+
# Note: uv integration with hatch is experimental, using pip for now
|
|
177
|
+
|
|
178
|
+
# Commands available in the default environment
|
|
179
|
+
[tool.hatch.envs.default.scripts]
|
|
180
|
+
# Run tests with optional arguments
|
|
181
|
+
test = 'pytest {args:tests}'
|
|
182
|
+
# Run tests with coverage reporting
|
|
183
|
+
test-cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src/vexy_formi --cov=tests {args:tests}"
|
|
184
|
+
# Run type checking
|
|
185
|
+
type-check = "mypy src/vexy_formi tests"
|
|
186
|
+
# Run linting and formatting
|
|
187
|
+
lint = ["ruff check src/vexy_formi tests", "ruff format --respect-gitignore src/vexy_formi tests"]
|
|
188
|
+
# Format and fix style issues
|
|
189
|
+
fmt = ["ruff format --respect-gitignore src/vexy_formi tests", "ruff check --fix src/vexy_formi tests"]
|
|
190
|
+
fix = ["ruff check --fix --unsafe-fixes src/vexy_formi tests", "ruff format --respect-gitignore src/vexy_formi tests"]
|
|
191
|
+
|
|
192
|
+
# Matrix configuration to test across multiple Python versions
|
|
193
|
+
|
|
194
|
+
[[tool.hatch.envs.all.matrix]]
|
|
195
|
+
python = ["3.10", "3.11", "3.12"]
|
|
196
|
+
|
|
197
|
+
#------------------------------------------------------------------------------
|
|
198
|
+
# SPECIALIZED ENVIRONMENTS
|
|
199
|
+
# Additional environments for specific development tasks.
|
|
200
|
+
#------------------------------------------------------------------------------
|
|
201
|
+
|
|
202
|
+
# Dedicated environment for linting and code quality checks
|
|
203
|
+
[tool.hatch.envs.lint]
|
|
204
|
+
detached = true # Create a separate, isolated environment
|
|
205
|
+
features = ['dev'] # Use dev extras dependencies
|
|
206
|
+
# installer = "uv" # Use uv for faster package installation (experimental)
|
|
207
|
+
|
|
208
|
+
# Linting environment commands
|
|
209
|
+
[tool.hatch.envs.lint.scripts]
|
|
210
|
+
# Type checking with automatic type installation
|
|
211
|
+
typing = "mypy --install-types --non-interactive {args:src/vexy_formi tests}"
|
|
212
|
+
# Check style and format code
|
|
213
|
+
style = ["ruff check {args:.}", "ruff format --respect-gitignore {args:.}"]
|
|
214
|
+
# Format and fix style issues
|
|
215
|
+
fmt = ["ruff format --respect-gitignore {args:.}", "ruff check --fix {args:.}"]
|
|
216
|
+
fix = ["ruff check --fix --unsafe-fixes {args:.}", "ruff format --respect-gitignore {args:.}"]
|
|
217
|
+
# Run all ops
|
|
218
|
+
all = ["style", "typing", "fix"]
|
|
219
|
+
|
|
220
|
+
# Dedicated environment for testing
|
|
221
|
+
[tool.hatch.envs.test]
|
|
222
|
+
features = ['test'] # Use test extras as dependencies
|
|
223
|
+
# installer = "uv" # Use uv for faster package installation (experimental)
|
|
224
|
+
|
|
225
|
+
# Testing environment commands
|
|
226
|
+
[tool.hatch.envs.test.scripts]
|
|
227
|
+
# Run tests in parallel
|
|
228
|
+
test = "python -m pytest -n auto {args:tests}"
|
|
229
|
+
# Run tests with coverage in parallel
|
|
230
|
+
test-cov = "python -m pytest -n auto --cov-report=term-missing --cov-config=pyproject.toml --cov=src/vexy_formi --cov=tests {args:tests}"
|
|
231
|
+
# Run benchmarks
|
|
232
|
+
bench = "python -m pytest -v -p no:briefcase tests/test_benchmark.py --benchmark-only"
|
|
233
|
+
# Run benchmarks and save results
|
|
234
|
+
bench-save = "python -m pytest -v -p no:briefcase tests/test_benchmark.py --benchmark-only --benchmark-json=benchmark/results.json"
|
|
235
|
+
|
|
236
|
+
# Documentation environment
|
|
237
|
+
[tool.hatch.envs.docs]
|
|
238
|
+
features = ['docs']
|
|
239
|
+
# installer = "uv" # Use uv for faster package installation (experimental)
|
|
240
|
+
|
|
241
|
+
# Documentation environment commands
|
|
242
|
+
[tool.hatch.envs.docs.scripts]
|
|
243
|
+
build = "sphinx-build -b html docs/source docs/build"
|
|
244
|
+
|
|
245
|
+
# GitHub Actions workflow configuration
|
|
246
|
+
[tool.hatch.envs.ci]
|
|
247
|
+
features = ['test']
|
|
248
|
+
# installer = "uv" # Use uv for faster package installation (experimental)
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
[tool.hatch.envs.ci.scripts]
|
|
252
|
+
test = "pytest --cov=src/vexy_formi --cov-report=xml"
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
#------------------------------------------------------------------------------
|
|
256
|
+
# CODE QUALITY TOOLS
|
|
257
|
+
# Configuration for linting, formatting, and code quality enforcement.
|
|
258
|
+
#------------------------------------------------------------------------------
|
|
259
|
+
|
|
260
|
+
#------------------------------------------------------------------------------
|
|
261
|
+
# COVERAGE CONFIGURATION
|
|
262
|
+
# Settings for test coverage measurement and reporting.
|
|
263
|
+
#------------------------------------------------------------------------------
|
|
264
|
+
|
|
265
|
+
# Path mapping for coverage in different environments
|
|
266
|
+
[tool.coverage.paths]
|
|
267
|
+
vexy_formi = ["src/vexy_formi", "*/vexy-formi/src/vexy_formi"]
|
|
268
|
+
tests = ["tests", "*/vexy-formi/tests"]
|
|
269
|
+
|
|
270
|
+
# Coverage report configuration
|
|
271
|
+
[tool.coverage.report]
|
|
272
|
+
# Lines to exclude from coverage reporting
|
|
273
|
+
exclude_lines = [
|
|
274
|
+
'no cov', # Custom marker to skip coverage
|
|
275
|
+
'if __name__ == .__main__.:', # Script execution guard
|
|
276
|
+
'if TYPE_CHECKING:', # Type checking imports and code
|
|
277
|
+
'pass', # Empty pass statements
|
|
278
|
+
'raise NotImplementedError', # Unimplemented method placeholders
|
|
279
|
+
'raise ImportError', # Import error handling
|
|
280
|
+
'except ImportError', # Import error handling
|
|
281
|
+
'except KeyError', # Common error handling
|
|
282
|
+
'except AttributeError', # Common error handling
|
|
283
|
+
'except NotImplementedError', # Common error handling
|
|
284
|
+
]
|
|
285
|
+
|
|
286
|
+
[tool.coverage.run]
|
|
287
|
+
source_pkgs = ["vexy_formi", "tests"]
|
|
288
|
+
branch = true # Measure branch coverage (if/else statements)
|
|
289
|
+
parallel = true # Support parallel test execution
|
|
290
|
+
omit = [
|
|
291
|
+
"src/vexy_formi/__about__.py",
|
|
292
|
+
]
|
|
293
|
+
|
|
294
|
+
#------------------------------------------------------------------------------
|
|
295
|
+
# MYPY CONFIGURATION
|
|
296
|
+
# Configuration for type checking with mypy.
|
|
297
|
+
#------------------------------------------------------------------------------
|
|
298
|
+
|
|
299
|
+
[tool.mypy]
|
|
300
|
+
python_version = "3.10"
|
|
301
|
+
warn_return_any = true
|
|
302
|
+
warn_unused_configs = true
|
|
303
|
+
disallow_untyped_defs = true
|
|
304
|
+
disallow_incomplete_defs = true
|
|
305
|
+
check_untyped_defs = true
|
|
306
|
+
disallow_untyped_decorators = true
|
|
307
|
+
no_implicit_optional = true
|
|
308
|
+
warn_redundant_casts = true
|
|
309
|
+
warn_unused_ignores = true
|
|
310
|
+
warn_no_return = true
|
|
311
|
+
warn_unreachable = true
|
|
312
|
+
|
|
313
|
+
[[tool.mypy.overrides]]
|
|
314
|
+
module = ["tests.*"]
|
|
315
|
+
disallow_untyped_defs = false
|
|
316
|
+
disallow_incomplete_defs = false
|
|
317
|
+
|
|
318
|
+
#------------------------------------------------------------------------------
|
|
319
|
+
# PYTEST CONFIGURATION
|
|
320
|
+
# Configuration for pytest, including markers, options, and benchmark settings.
|
|
321
|
+
#------------------------------------------------------------------------------
|
|
322
|
+
|
|
323
|
+
[tool.pytest.ini_options]
|
|
324
|
+
addopts = "-v --durations=10 -p no:briefcase"
|
|
325
|
+
asyncio_mode = "auto"
|
|
326
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
327
|
+
console_output_style = "progress"
|
|
328
|
+
filterwarnings = ["ignore::DeprecationWarning", "ignore::UserWarning"]
|
|
329
|
+
log_cli = true
|
|
330
|
+
log_cli_level = "INFO"
|
|
331
|
+
markers = [
|
|
332
|
+
"benchmark: marks tests as benchmarks (select with '-m benchmark')",
|
|
333
|
+
"unit: mark a test as a unit test",
|
|
334
|
+
"integration: mark a test as an integration test",
|
|
335
|
+
"permutation: tests for permutation functionality",
|
|
336
|
+
"parameter: tests for parameter parsing",
|
|
337
|
+
"prompt: tests for prompt parsing",
|
|
338
|
+
]
|
|
339
|
+
norecursedirs = [
|
|
340
|
+
".*",
|
|
341
|
+
"build",
|
|
342
|
+
"dist",
|
|
343
|
+
"venv",
|
|
344
|
+
"__pycache__",
|
|
345
|
+
"*.egg-info",
|
|
346
|
+
"_private",
|
|
347
|
+
]
|
|
348
|
+
python_classes = ["Test*"]
|
|
349
|
+
python_files = ["test_*.py"]
|
|
350
|
+
python_functions = ["test_*"]
|
|
351
|
+
testpaths = ["tests"]
|
|
352
|
+
|
|
353
|
+
[tool.pytest-benchmark]
|
|
354
|
+
min_rounds = 100
|
|
355
|
+
min_time = 0.1
|
|
356
|
+
histogram = true
|
|
357
|
+
storage = "file"
|
|
358
|
+
save-data = true
|
|
359
|
+
compare = [
|
|
360
|
+
"min", # Minimum time
|
|
361
|
+
"max", # Maximum time
|
|
362
|
+
"mean", # Mean time
|
|
363
|
+
"stddev", # Standard deviation
|
|
364
|
+
"median", # Median time
|
|
365
|
+
"iqr", # Inter-quartile range
|
|
366
|
+
"ops", # Operations per second
|
|
367
|
+
"rounds", # Number of rounds
|
|
368
|
+
]
|
|
369
|
+
|
|
370
|
+
#------------------------------------------------------------------------------
|
|
371
|
+
# RUFF CONFIGURATION
|
|
372
|
+
# Configuration for Ruff, including linter and formatter settings.
|
|
373
|
+
#------------------------------------------------------------------------------
|
|
374
|
+
|
|
375
|
+
# Ruff linter and formatter configuration
|
|
376
|
+
[tool.ruff]
|
|
377
|
+
target-version = "py310"
|
|
378
|
+
line-length = 100 # Modern standard, better for code readability
|
|
379
|
+
fix = true # Auto-fix issues where possible
|
|
380
|
+
show-fixes = true # Show what was fixed
|
|
381
|
+
cache-dir = ".ruff_cache" # Custom cache directory
|
|
382
|
+
# Configure exclude to ignore specific directories
|
|
383
|
+
exclude = [".git", ".venv", "venv", "dist", "build", ".ruff_cache"]
|
|
384
|
+
|
|
385
|
+
# Linting rules configuration
|
|
386
|
+
[tool.ruff.lint]
|
|
387
|
+
# Rule sets to enable, organized by category
|
|
388
|
+
select = [
|
|
389
|
+
# flake8 plugins and extensions
|
|
390
|
+
'A', # flake8-builtins: checks for shadowed builtins
|
|
391
|
+
'ARG', # flake8-unused-arguments: checks for unused function arguments
|
|
392
|
+
'ASYNC', # flake8-async: checks for async/await issues
|
|
393
|
+
'B', # flake8-bugbear: finds likely bugs and design problems
|
|
394
|
+
'C', # flake8-comprehensions: helps write better list/dict comprehensions
|
|
395
|
+
'DTZ', # flake8-datetimez: checks for datetime timezone issues
|
|
396
|
+
'E', # pycodestyle errors: PEP 8 style guide errors
|
|
397
|
+
'EM', # flake8-errmsg: checks for better error messages
|
|
398
|
+
'F', # pyflakes: detects various errors
|
|
399
|
+
'FBT', # flake8-boolean-trap: checks for boolean traps in function signatures
|
|
400
|
+
'I', # isort: sorts imports
|
|
401
|
+
'ICN', # flake8-import-conventions: checks for import conventions
|
|
402
|
+
'ISC', # flake8-implicit-str-concat: checks for implicit string concatenation
|
|
403
|
+
'LOG', # flake8-logging: checks for logging issues
|
|
404
|
+
'N', # pep8-naming: checks naming conventions
|
|
405
|
+
'PLC', # pylint convention: checks for convention issues
|
|
406
|
+
'PLE', # pylint error: checks for errors
|
|
407
|
+
'PLR', # pylint refactor: suggests refactors
|
|
408
|
+
'PLW', # pylint warning: checks for suspicious code
|
|
409
|
+
'PT', # flake8-pytest-style: checks pytest-specific style
|
|
410
|
+
'PTH', # flake8-use-pathlib: checks for stdlib path usage vs pathlib
|
|
411
|
+
'PYI', # flake8-pyi: checks stub files
|
|
412
|
+
'RET', # flake8-return: checks return statement consistency
|
|
413
|
+
'RSE', # flake8-raise: checks raise statements
|
|
414
|
+
'RUF', # Ruff-specific rules
|
|
415
|
+
'S', # flake8-bandit: checks for security issues
|
|
416
|
+
'SIM', # flake8-simplify: checks for code simplification opportunities
|
|
417
|
+
'T', # flake8-print: checks for print statements
|
|
418
|
+
'TCH', # flake8-type-checking: helps with type-checking
|
|
419
|
+
'TID', # flake8-tidy-imports: checks for tidy import statements
|
|
420
|
+
'UP', # pyupgrade: checks for opportunities to use newer Python features
|
|
421
|
+
'W', # pycodestyle warnings: PEP 8 style guide warnings
|
|
422
|
+
'YTT', # flake8-2020: checks for misuse of sys.version or sys.version_info
|
|
423
|
+
|
|
424
|
+
]
|
|
425
|
+
# Rules to ignore (with reasons)
|
|
426
|
+
ignore = [
|
|
427
|
+
'B027', # Empty method in abstract base class - sometimes needed for interfaces
|
|
428
|
+
'C901', # Function is too complex - sometimes complexity is necessary
|
|
429
|
+
'FBT003', # Boolean positional argument in function definition - sometimes unavoidable
|
|
430
|
+
'PLR0911', # Too many return statements - sometimes needed for readability
|
|
431
|
+
'PLR0912', # Too many branches - sometimes needed for complex logic
|
|
432
|
+
'PLR0913', # Too many arguments - sometimes needed in APIs
|
|
433
|
+
'PLR0915', # Too many statements - sometimes needed for comprehensive functions
|
|
434
|
+
'PLR1714', # Consider merging multiple comparisons - sometimes less readable
|
|
435
|
+
'PLW0603', # Using the global statement - sometimes necessary
|
|
436
|
+
'PT013', # Pytest explicit test parameter - sometimes clearer
|
|
437
|
+
'PTH123', # Path traversal - sometimes needed
|
|
438
|
+
'PYI056', # Calling open() in pyi file - sometimes needed in type stubs
|
|
439
|
+
'S105', # Possible hardcoded password - often false positives
|
|
440
|
+
'S106', # Possible hardcoded password - often false positives
|
|
441
|
+
'S107', # Possible hardcoded password - often false positives
|
|
442
|
+
'S110', # try-except-pass - sometimes valid for suppressing exceptions
|
|
443
|
+
'SIM102',
|
|
444
|
+
# Nested if statements - sometimes more readable than combined conditions
|
|
445
|
+
'D', # pydocstyle - too verbose for utility code
|
|
446
|
+
'ANN', # flake8-annotations - type hints handled by mypy
|
|
447
|
+
]
|
|
448
|
+
# Rules that should not be automatically fixed
|
|
449
|
+
unfixable = [
|
|
450
|
+
'F401', # Don't automatically remove unused imports - may be needed later
|
|
451
|
+
|
|
452
|
+
]
|
|
453
|
+
# extend-exclude moved to main [tool.ruff] section above
|
|
454
|
+
|
|
455
|
+
# Ruff formatter configuration
|
|
456
|
+
[tool.ruff.format]
|
|
457
|
+
quote-style = "double" # Use double quotes
|
|
458
|
+
indent-style = "space" # Use spaces for indentation
|
|
459
|
+
skip-magic-trailing-comma = false # Respect trailing commas
|
|
460
|
+
line-ending = "lf" # Use LF line endings (unix-style)
|
|
461
|
+
docstring-code-format = true # Format code in docstrings
|
|
462
|
+
docstring-code-line-length = 80 # Shorter line length for docstring code
|
|
463
|
+
|
|
464
|
+
# isort configuration within Ruff
|
|
465
|
+
[tool.ruff.lint.isort]
|
|
466
|
+
known-first-party = ['vexy_formi'] # Treat as first-party imports for sorting
|
|
467
|
+
|
|
468
|
+
# flake8-tidy-imports configuration within Ruff
|
|
469
|
+
[tool.ruff.lint.flake8-tidy-imports]
|
|
470
|
+
ban-relative-imports = 'all' # Ban all relative imports for consistency
|
|
471
|
+
|
|
472
|
+
# Per-file rule exceptions
|
|
473
|
+
[tool.ruff.lint.per-file-ignores]
|
|
474
|
+
# Tests can use magic values, assertions, and relative imports
|
|
475
|
+
'tests/**/*' = [
|
|
476
|
+
'PLR2004', # Allow magic values in tests for readability
|
|
477
|
+
'S101', # Allow assertions in tests
|
|
478
|
+
'TID252'
|
|
479
|
+
# Allow relative imports in tests for convenience
|
|
480
|
+
]
|