Packages
vastlint
0.16.6
0.16.6
0.16.5
0.16.4
0.16.3
0.16.2
0.16.1
0.16.0
0.15.3
0.15.2
0.15.1
0.15.0
0.14.5
0.14.3
0.14.2
0.14.1
0.14.0
0.13.13
0.13.12
0.13.11
0.13.10
0.13.9
0.13.8
0.13.7
0.13.6
0.13.5
0.13.4
0.13.3
0.13.2
0.13.0
0.12.0
0.11.8
0.11.7
0.11.6
0.11.5
0.11.4
0.11.3
0.11.2
0.11.1
0.11.0
0.10.2
0.10.1
0.10.0
0.9.1
0.9.0
0.8.4
0.8.1
0.8.0
0.7.2
0.7.1
0.7.0
0.6.3
0.6.2
0.6.1
0.6.0
0.5.0
0.4.24
0.4.23
0.4.22
0.4.21
0.4.20
0.4.14
0.4.13
0.4.12
0.4.11
0.4.10
0.4.9
0.4.8
0.4.7
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.3.7
0.3.6
High-performance VAST XML linter for Elixir and Erlang. Validates IAB VAST 2.0–4.4 tags for schema, security, deprecated feature, and CTV issues. Ships precompiled Rustler NIFs for major platforms with a source-build fallback when needed.
Current section
Files
Jump to
Current section
Files
README.md
# VASTlint for Elixir and Erlang
Created by [Aleksander Sekowski](https://github.com/aleksUIX).
In-process validation of VAST 2.0–4.4, VMAP and DAAST using the public [VASTlint engine](https://github.com/aleksUIX/vastlint). The Rustler NIF runs on dirty CPU schedulers. Elixir and Erlang callers use the same engine and rule catalog.
## Install a published Hex package.
Available versions are listed on [Hex](https://hex.pm/packages/vastlint), with API docs on [HexDocs](https://hexdocs.pm/vastlint). The published 0.16.1 and 0.16.2 packages have stale loader metadata and incompatible precompiled archive names and contents. Use the source-build instructions below until the coordinated patch release publishes corrected artifacts.
The corrected release path packages the library under the exact filename expected by RustlerPrecompiled, using the library's NIF ABI 2.15 rather than the build host's OTP version. The loader takes its engine version from `mix.exs`; `engine-release.json` pins the matching public source release. The checksum file verifies the binding release archives. A source build requires the corresponding public engine checkout and Rust.
## Validate from Elixir.
```elixir
{:ok, result} = Vastlint.validate(xml)
result.valid
result.summary.errors
Enum.map(result.issues, &{&1.id, &1.severity, &1.message})
{:ok, result} = Vastlint.validate(xml,
wrapper_depth: 1,
max_wrapper_depth: 5,
rule_overrides: %{"VAST-2.0-mediafile-https" => "error"}
)
Vastlint.validate!(xml)
Vastlint.validate_batch([xml])
Vastlint.version()
```
Validation failures are returned as issues in a successful result. Invalid arguments return an error tuple. The bang variant raises `Vastlint.ValidationError` for an error result.
## Validate from Erlang.
Mix projects compile the public `vastlint` Erlang wrapper alongside the Elixir modules:
```erlang
{ok, Result} = vastlint:validate(Xml),
Valid = maps:get(valid, Result),
Issues = maps:get(issues, Result),
Version = vastlint:version().
```
Pure Erlang hosts can use `src/vastlint.erl` and `src/vastlint_nif.erl` with a compatible NIF in `priv/native/`. The Erlang and Elixir loaders register the same `vastlint_nif` module, so use one loader per host.
A separate OTP port integration can call the public CLI daemon with `vastlint daemon`. It uses a four-byte big-endian length prefix around UTF-8 JSON requests and responses. The CLI and its daemon remain in the engine repository; this library does not require the retained tools repository or a hosted service.
## Build and test from source.
Check out the engine and binding next to each other, using matching engine and binding revisions:
```sh
git clone https://github.com/aleksUIX/vastlint.git
git clone https://github.com/aleksUIX/vastlint-erlang.git
cd vastlint-erlang
mkdir -p native
ln -s ../../vastlint/crates/vastlint-nif native/vastlint_nif
mix deps.get
VASTLINT_BUILD=true mix test
MIX_ENV=test VASTLINT_BUILD=true mix run scripts/check_erlang.exs
```
CI compiles the NIF from the public engine source. Tests cover validation, options, malformed input, concurrency and property-based input generation. Erlang EUnit and Common Test suites are included in `test/`. After building the NIF, `python3 scripts/check_precompiled.py` packages it with the real release helper and verifies download, checksum, loading and validation in a fresh consumer project without native source. CI requires this check.
## Package and release metadata stay together.
`mix.exs`, the loader artifact version and `checksum-vastlint_nif.exs` must describe the same release. The release workflow vendors the public core and NIF Rust sources for Hex source-build fallback. Engine publication and binding publication remain separate credential operations. No marketplace account or private application source is required to build the library.
Licensed under [Apache 2.0](LICENSE). Preserve [NOTICE](NOTICE) when redistributing. Report engine issues to [vastlint](https://github.com/aleksUIX/vastlint/issues), and binding issues to [vastlint-erlang](https://github.com/aleksUIX/vastlint-erlang/issues).
The v0.16.2 engine source tag contains NIF crate 0.16.2, which is what `Vastlint.version/0` reports. The v0.16.1 tag still carried crate 0.16.0, so `engine-release.json` records the source release, commit, archive hashes and NIF crate version separately. The installation check verifies that reported crate version as well as loading and validation.