@quobix/vacuum 0.30.6 → 0.32.0
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.
- package/README.md +63 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
An **ultra-super-fast**, lightweight OpenAPI, AsyncAPI and JSON Schema linter and quality checking tool inspired by [Spectral](https://github.com/stoplightio/spectral).
|
|
17
17
|
|
|
18
|
-
It
|
|
18
|
+
It supports Spectral-style YAML and JSON rulesets. See [Spectral migration](#spectral-migration) for compatibility limits and built-in alternatives.
|
|
19
19
|
|
|
20
20
|
## Install using the official [homebrew](https://brew.sh) tap
|
|
21
21
|
|
|
@@ -226,6 +226,28 @@ target exactly what we want to change. vacuum now supports a new `apply-overlay`
|
|
|
226
226
|
|
|
227
227
|
- [Learn more about the apply-overlay command](https://quobix.com/vacuum/commands/apply-overlay)
|
|
228
228
|
|
|
229
|
+
`apply-overlay` can also build a fail-closed publication document after applying
|
|
230
|
+
the standard Overlay actions:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
vacuum apply-overlay internal.yaml public.overlay.yaml public.yaml \
|
|
234
|
+
--include-tag public \
|
|
235
|
+
--tag-match any \
|
|
236
|
+
--prune-unused
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Inclusive tags are exact and case-sensitive; `any` keeps operations with at
|
|
240
|
+
least one included tag and `all` requires every included tag. Untagged
|
|
241
|
+
operations are removed. Filtering runs after Overlay actions and before
|
|
242
|
+
reachability-based component pruning. These opt-in transforms require a
|
|
243
|
+
bundled, self-contained OpenAPI document. Top-level Tag Objects are retained.
|
|
244
|
+
YAML aliases and merge keys are expanded when filtering. Retained mapping
|
|
245
|
+
order, comments, and scalar styles are preserved. Pruning rejects schema
|
|
246
|
+
`$id` scopes that cannot be resolved safely. Link Objects targeting filtered
|
|
247
|
+
operations are retained and reported as warnings. Document output remains
|
|
248
|
+
pure on stdout; warnings are written to stderr. The warning summary uses the `apply-overlay produced` prefix to
|
|
249
|
+
cover both Overlay actions and publication transforms.
|
|
250
|
+
|
|
229
251
|
---
|
|
230
252
|
|
|
231
253
|
|
|
@@ -352,7 +374,7 @@ You can use either **YAML** or **JSON**, vacuum supports both formats.
|
|
|
352
374
|
|
|
353
375
|
## Using vacuum with pre-commit
|
|
354
376
|
|
|
355
|
-
|
|
377
|
+
vacuum can be used with [pre-commit](https://pre-commit.com).
|
|
356
378
|
|
|
357
379
|
To do that, add to your `.pre-commit-config.yaml`:
|
|
358
380
|
|
|
@@ -445,7 +467,7 @@ The report file name is _optional_. The default report output name is `vacuum-sp
|
|
|
445
467
|
|
|
446
468
|
## Generate a `vacuum report`
|
|
447
469
|
|
|
448
|
-
|
|
470
|
+
vacuum reports are complete snapshots in time of a linting report for a specification. These reports can be 'replayed'
|
|
449
471
|
back through vacuum. Use the `dashboard` or the `html-report` commands to 'replay' the report and explore the results
|
|
450
472
|
as they were when the report was generated.
|
|
451
473
|
|
|
@@ -501,6 +523,37 @@ if you're interested in seeing how things are progressing, it's available.
|
|
|
501
523
|
```
|
|
502
524
|
|
|
503
525
|
---
|
|
526
|
+
## Spectral migration
|
|
527
|
+
|
|
528
|
+
vacuum loads YAML and JSON rulesets. Resolve each relative `extends` path from the
|
|
529
|
+
file that contains it, including on Windows. Keep sibling rulesets relative:
|
|
530
|
+
|
|
531
|
+
```yaml
|
|
532
|
+
extends:
|
|
533
|
+
- ./ruleset.bank.yml
|
|
534
|
+
- ./ruleset.nlgov.yml
|
|
535
|
+
- [vacuum:owasp, all]
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
Use `[vacuum:owasp, all]` for vacuum's built-in OWASP checks instead of importing
|
|
539
|
+
`@stoplight/spectral-owasp-ruleset/dist/ruleset.mjs`. The native rules use vacuum's
|
|
540
|
+
rule names and behavior; they do not execute the Spectral package. JavaScript
|
|
541
|
+
ruleset modules (`.js`, `.mjs`, `.cjs`) are not supported.
|
|
542
|
+
|
|
543
|
+
Arazzo workflow linting and `spectral:arazzo` are not supported. Remove that entry
|
|
544
|
+
from rulesets used to lint OpenAPI documents. Use an Arazzo-capable linter for
|
|
545
|
+
Arazzo workflow documents.
|
|
546
|
+
|
|
547
|
+
`--functions` takes a directory containing custom function files:
|
|
548
|
+
|
|
549
|
+
```shell
|
|
550
|
+
vacuum lint api.yaml --ruleset rules/main.yaml --functions ./functions
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
It does not enable JavaScript ruleset modules. Omitting the directory reports an
|
|
554
|
+
input error and exits with code 2. In the editor, vacuum checks recognized ruleset
|
|
555
|
+
buffers against its ruleset schema instead of reporting an unsupported API type.
|
|
556
|
+
|
|
504
557
|
## Supply your own Spectral compatible ruleset
|
|
505
558
|
|
|
506
559
|
If you're already using Spectral and you have your own [custom ruleset](https://meta.stoplight.io/docs/spectral/e5b9616d6d50c-custom-rulesets#custom-rulesets),
|
|
@@ -592,9 +645,14 @@ lint:
|
|
|
592
645
|
|
|
593
646
|
### Environment variables
|
|
594
647
|
|
|
595
|
-
You can configure global
|
|
648
|
+
You can configure global and command-local flags with `VACUUM_<FLAG>`
|
|
649
|
+
environment variables. Use uppercase flag names and replace `-` with `_`.
|
|
650
|
+
Explicit command-line flags take precedence over environment variables;
|
|
651
|
+
environment variables take precedence over configuration files.
|
|
596
652
|
|
|
597
|
-
|
|
653
|
+
Collection flags accept comma-separated values. For example,
|
|
654
|
+
`VACUUM_INCLUDE_TAG='public,partner'` sets the included tags for
|
|
655
|
+
`apply-overlay`.
|
|
598
656
|
|
|
599
657
|
|
|
600
658
|
## Auto-fixing rule violations
|