|
This version is still in development and is not considered stable yet. For the latest stable version, please use fluent-tooling 0.0.1! |
Development
The repository provides a reproducible Nix shell with Rust, Tree-sitter, Babashka, Clang, Emacs, and Flycheck.
Enter the development shell
nix develop
All commands below assume this shell unless shown with nix develop --command.
Repository layout
| Path | Contents |
|---|---|
|
Grammar definition, generated parser, scanner, and queries |
|
Rust grammar bindings and parser tests |
|
Linter library, CLI, and tests |
|
Major mode, Flymake adapter, Flycheck checker, and ERT tests |
|
Upstream and project regression fixtures |
Quality tasks
Babashka exposes the repository’s development tasks:
| Command | Action |
|---|---|
|
Format Rust and grammar metadata sources |
|
Check formatting without changing files |
|
Run Clippy with warnings denied |
|
Run all Rust tests |
|
Compile the grammar and run all ERT tests |
|
Run formatting, Clippy, Rust tests, and ERT tests |
Run the complete quality gate with:
bb ci
From outside the shell, use:
nix develop --command bb ci
Regenerate the parser
After editing grammar.js, regenerate the checked-in Tree-sitter output:
bb generate
Review changes to src/parser.c, src/grammar.json, and src/node-types.json with the grammar change. Run bb ci after generation.
Run the linter from Cargo
cargo run -p fluent-lint --bin ftl-lint -- \
test/fixtures/regressions/broken.ftl
Test fixtures
The test suite adopts Project Fluent, Fluent.js, and fluent-rs fixtures in addition to project regressions. Imported fixtures retain exact line endings, trailing whitespace, and missing final newlines because those properties test parser behavior.
Record the source, revision, license, and local normalization of imported fixtures in test/fixtures/UPSTREAM.md. Grammar and fixture license provenance belongs in NOTICE.md.