Skip to content

Latest commit

 

History

History
81 lines (54 loc) · 2.9 KB

CONTRIBUTING.md

File metadata and controls

81 lines (54 loc) · 2.9 KB

Contributing to Ezno

Consider checking out current standing issues before contributing. In general, leave an issue before putting in a PR.

If any problems come up in the following steps, please leave an issue :)

Setting up

Want to contribute, here is how to set up the environment?

First install Rust

then clone the repo with git:

git clone https://github.com/kaleidawave/ezno.git
# or using the GH CLI
gh repo clone kaleidawave/ezno

Now in the ezno directory, cargo run should show the CLI.

Development

You can run just the checker with

cargo run -p ezno-checker --example run path/to/file.ts

Tip

This can be faster as doesn't have recompile the CLI options and things. (although the errors don't contain the nice source annotations) Note you can skip the cache with the additional --no-cache option (re-reads base .d.ts file)

If you want to check all the checker tests

cargo test -p ezno-checker-specification
# To include the Staging file (which is really useful for keeping new fixes/additions separate)
cargo test -p ezno-checker-specification -F staging
# and for all the tests (which includes all of to_implement.md)
cargo test -p ezno-checker-specification -F all

Important

cache might need to be regenerated between specification runs if working on internal methods (e.g. Array.map etc). See below

If you want to regenerate the binary definition file

cargo run -p ezno-checker -F ezno-parser --example cache ./checker/definitions/overrides.d.ts ./checker/definitions/internal.ts.d.bin

If you want to test the lexing and parsing in Ezno's parser

# Parsing, prints parse errors or the debug view of the AST
cargo run -p ezno-parser --example parse path/to/file.ts
# Lexing, prints lex errors or the tokens
cargo run -p ezno-parser --example lex path/to/file.ts

Useful commands

  • Check source is valid with cargo check --workspace
  • Check that code is formatted in accordance with the configuration with cargo fmt --all --check
  • Run all tests cargo test --workspace --verbose
  • Use cargo clippy -- -A warnings to find blocking lints

The notify! macro

The checker crate has the crate::utilities::notify! macro, which can be used to trace information when the EZNO_DEBUG environment variable is set.

Rules for contributions

  • Code must be formatted with cargo format inline with the current format configuration
  • It must pass cargo clippy -- --allow warnings. In many cases adding allow to items is fine