lua-patterns
groq-test-suite
Our great sponsors
lua-patterns | groq-test-suite | |
---|---|---|
1 | 1 | |
27 | 10 | |
- | - | |
0.0 | 5.0 | |
over 1 year ago | 24 days ago | |
Rust | JavaScript | |
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
lua-patterns
-
The Norway Problem
If you want automatic built-in string validation, one option that seems particularly interesting is to use a variant of Lua patterns, which are weaker and easier to understand than regular expressions, but still provide a significant degree of "sanity" for something like an email. The original version works on bytes and not runes, but you could simply write a parser that works on runes instead, and the pattern-matching code is just 400 old and battle-tested lines of C89.
Lua patterns have also shown up in other places, such as BSD's httpd, and an implementation for Rust:
https://www.gsp.com/cgi-bin/man.cgi?section=7&topic=PATTERNS
https://github.com/stevedonovan/lua-patterns
http://lua-users.org/wiki/PatternsTutorial
groq-test-suite
-
The Norway Problem
TOML also has a few restrictions, such as not supporting mixed-type arrays like [1, "hello", true], or arrays at the root of the data. JSON can represent any TOML value (as far as I know), but TOML cannot represent any JSON value.
At my company we use YAML a lot for table-driven tests (e.g. [1]), and this not only means lots of nested arrays, but also having to represent pure data (i.e. the expected output of a test), which requires a format that supports encoding arbitrary data structures.
[1] https://github.com/sanity-io/groq-test-suite/
What are some alternatives?
jsonnet - Jsonnet - The data templating language
yamllint - A linter for YAML files.
dhall-lang - Maintainable configuration files
tao-data-js - TAO data JavaScript module
edn - Extensible Data Notation
strictyaml - Type-safe YAML parser and validator.
cson - CoffeeScript-Object-Notation. Same as JSON but for CoffeeScript objects.
toml.io - Source Code for toml.io
tao-data-csharp - C# TAO data library
pyyaml - Canonical source repository for PyYAML
awesome-json-next - A Collection of What's Next for Awesome JSON (JavaScript Object Notation) for Structured (Meta) Data in Text - JSON5, HJSON, HanSON, TJSON, SON, CSON, USON, JSONX/JSON11 & Many More