Skip to content

Latest commit

 

History

History
81 lines (54 loc) · 1.5 KB

CLAUDE.md

File metadata and controls

81 lines (54 loc) · 1.5 KB

Claude

Tests

Prefer cargo insta tests.

When running tests, prefer:

# Run tests and automatically accept snapshot changes
cargo insta test --accept

# Run tests in a specific package
cargo insta test -p prqlc-parser --accept

# Run tests matching a specific pattern
cargo insta test -p prqlc --test integration -- date

Prefer inline snapshots for almost all tests:

insta::assert_snapshot!(result, @"expected output");

Initializing the test with:

insta::assert_snapshot!(result, @"");

...and then running the test commands above with --accept will then fill in the result.

To run all tests, accepting snapshots, run

task test-all

Running the CLI

For viewing prqlc output, for any stage of the compilation process:

# Compile PRQL to SQL
cargo run -p prqlc -- compile "from employees | filter country == 'USA'"

# Format PRQL code
cargo run -p prqlc -- fmt "from employees | filter country == 'USA'"

# See all available commands
cargo run -p prqlc -- --help

Linting

Run all lints with

task test-lint

Documentation

For Claude to view crate documentation:

# Build documentation for a specific crate
cargo doc -p prqlc

# View the generated HTML documentation with the View tool
# The docs are generated at target/doc/{crate_name}/index.html
View target/doc/prqlc/index.html

# For specific module documentation
View target/doc/prqlc/module_name/index.html

# For function documentation
View target/doc/prqlc/fn.compile.html