From c14856a9dd772e50c0c789cc3d28a8c9e13afbbc Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 24 Aug 2026 15:58:09 +0200 Subject: docs: add CODE_OF_CONDUCT.md / update CONTRIBUTING.md Signed-off-by: Henry --- CONTRIBUTING.md | 74 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 38 insertions(+), 36 deletions(-) (limited to 'CONTRIBUTING.md') diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 73186e7..776b132 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,61 +1,63 @@ # Contributing -Thank you for considering a contribution. For small fixes, feel free to open a pull request directly. For larger changes, please open an issue first so we can discuss the approach. Please target the `next` branch and [allow maintainers to edit your PR branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork). +Thank you for contributing to TinyWasm. For small fixes, you can open a pull request directly. For larger changes, including new features and public API changes, open an issue first to discuss the approach. -## Code of Conduct +Pull requests should target the `next` branch. If you submit a pull request from a fork, [allow maintainers to edit the branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork). -This project follows the [Contributor Covenant 3.0 Code of Conduct](https://www.contributor-covenant.org/version/3/0/code_of_conduct/). +All contributors must follow the [Code of Conduct](./CODE_OF_CONDUCT.md). -## Development - -This project mostly uses a pretty standard Rust setup. Some common tasks: - -```bash -# Run a specific benchmark (run without arguments to see available benchmarks) -$ cargo bench --bench {bench_name} +## AI-assisted contributions -# Run all tests -$ cargo test +You may use AI tools to help develop a contribution, but: -# Run only the WebAssembly MVP (1.0) test suite -$ cargo test-wasm-1 +- Write issue and pull request descriptions yourself. Do not submit AI-generated issue or pull request text. +- Understand and review all code that you submit. You are responsible for its behavior and quality. +- Keep the change focused on the issue. Do not include unrelated generated changes or refactors. -# Run only the full WebAssembly 2.0 test suite -$ cargo test-wasm-2 +## Development -# Run only the full WebAssembly 3.0 test suite -$ cargo test-wasm-3 +Common commands: -# Run a single WAST test file -$ cargo test-wast ./wasm-testsuite/data/wasm-v1/{file}.wast +```bash +cargo fmt --all -- --check +cargo clippy --workspace +cargo test --workspace +cargo run --example basic +cargo bench --bench tinywasm +``` -# Run custom wasm tests from crates/tinywasm/tests/wasm-custom -$ cargo test-wasm-custom +WebAssembly test commands: -# Run a specific example (run without arguments to see available examples) -# The wasm test files required to run the `rust` example are not -# included in the main repository. -# To build these, you will need to install binaryen and wabt -# and run `./examples/rust/build.sh`. -$ cargo run --example {example_name} +```bash +cargo test-wasm-1 +cargo test-wasm-2 +cargo test-wasm-3 +cargo test-wasm-custom +cargo test-wast crates/tinywasm/tests/wasm-custom/table-basics.wast ``` -### Profiling +Set `RUST_LOG=debug` when running `cargo test-wast` to see executor debug logs. + +The `rust` example requires the `wasm32-unknown-unknown` target, the `rust-src` component, [Binaryen](https://github.com/WebAssembly/binaryen), and [WABT](https://github.com/WebAssembly/wabt): -Use [samply](https://github.com/mstange/samply/) for profiling. +```bash +./examples/rust/build.sh +cargo run --example rust -- hello +``` -Example usage: +You can use [samply](https://github.com/mstange/samply/) for profiling: ```bash cargo install --locked samply -samply record -- cargo run --release --example rust -- tinywasm +samply record -- cargo run --profile samply --example rust -- tinywasm ``` +Keep changes focused and external dependencies to a minimum. Update public documentation, the README, and the unreleased changelog when applicable. + ## Commits -This project uses [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for commit messages. For pull requests, the commit messages will be squashed so you don't need to worry about this too much. However, it is still recommended to follow this convention for consistency. +Use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) when practical. Pull requests are squash-merged, so the pull request title is more important than individual commit messages. -## Branches +## Licensing -- `main`: The main branch. This branch is used for the latest stable release. -- `next`: The next branch. Development happens here. +Unless you explicitly state otherwise, contributions are licensed under the repository's [MIT](./LICENSE-MIT) and [Apache-2.0](./LICENSE-APACHE) licenses. -- cgit v1.3.1