Vale Server v1.4

Vale Server’s new Studio page

I’m pleased to announce v1.4 of Vale Server today, the fourth major release of Vale’s desktop application. Development for v1.4 was almost entirely focused on improving the Dashboard, including the new Studio page.

Vale Studio [beta]

One of Vale’s most popular features is its support for YAML-based rules, which allow for a high degree of customization and extensibility without requiring any programming experience. The new Studio dashboard page leverages the machine-readable nature of these YAML files to offer a suite of validation and debugging tools.

Validation

At the most basic level, Vale Studio will warn about “malformed” rules — such as those with YAML formatting errors or missing keys.

Vale Studio warning about a rule missing an 'extends' keys.

For each of the supported extension points (currently, existence, substitution, occurrence, and repetition), Vale Studio will check that all required keys are defined and have valid values (where applicable).

Testing

Assuming a rule passes the validation suite, its results will be shown in the right-hand editor panel:

Vale Studio displaying a rule’s in-text alerts.

This allows for rule creation and testing without needing to first configure the required components (StylesPath, .vale.ini, etc). And while only Markdown is currently supported, future releases will introduce support for all of Vale’s supported markup formats.

regex101 Integration

Many of Vale’s extension points are designed to provide a layer of abstraction over raw regular expressions, allowing for less boilerplate and more maintainable patterns. For example, consider the following substitution rule:

extends: substitution
message: "Consider using '%s' instead of '%s'"
level: warning
ignorecase: false
# swap maps tokens in form of bad: good
swap:
abundance: plenty
accelerate: speed up
accompany: go with
address: discuss
allocate: divide

Under the hood, Vale converts this YAML file into the following regular expression:

\b(?:(accompany)|(address)|(allocate)|(abundance)|(accelerate))\b

Where the capture groups are used to associate a token (e.g., accompany) with its replacement (go with).

In general, this significantly improves the readability and maintainability of Vale’s rules. However, it can also make debugging a misbehaving rule more difficult since the actual pattern is a “hidden” implementation detail. Vale Studio attempts to address this issue by providing built-in integration with regex101, an online service for testing regular expression (which, importantly, supports Go’s flavor):

A demonstration of Vale Studio’s regex101 integration.

Clicking the “regex101” button while developing a rule will open a new session with the correct settings and values (from Vale Studio).

Going Forward

Vale Server’s new Studio page* *represents a significant improvement to Vale’s development workflow, but there’s still quite a bit of work to be done—future releases of Vale Server will include the following additions:

  • Support for spelling rules, including regex101 integration for filters and auto-generated ignore files.

  • Support for multi-pattern and exception-based rules (conditional, consistency, and capitalization).

  • Support for importing, exporting, and saving Studio sessions.

Check out the Vale Server website to start your free trial today!