From 2f7dfdcdb5f36f4473cd9f69c2fdf8190e0386f5 Mon Sep 17 00:00:00 2001 From: stefnotch Date: Sat, 13 Dec 2025 18:43:25 +0100 Subject: [PATCH] Update WeslToml.md with more precise algorithm for include/exclude --- WeslToml.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/WeslToml.md b/WeslToml.md index 391cb1c..9c8bc5c 100644 --- a/WeslToml.md +++ b/WeslToml.md @@ -92,6 +92,11 @@ The patterns are glob patterns, which support If the last path segment does not contain a file extension or wildcard, then it is treated as a directory, and files with `.wesl` or `.wgsl` extensions inside that directory are included. +To implement this, one starts at the `root` folder, and recursively goes over the children. +1. If a `wesl.toml` file is present, that entire subtree is excluded, as it is under the purview of another `wesl.toml` file. +2. If the file/folder path matches any exclusion, that entire subtree is excluded. +3. If the file/folder path does *not* match the *prefix* of any of the inclusions, then that subtree is excluded. + ### Path semantics File paths in the `root`, `include` and `exclude` fields are relative to the directory containing the `wesl.toml` file. Absolute paths (starting with `/` or `C:/`) are not allowed. @@ -125,4 +130,4 @@ Semantics are: We are publishing a normal package that also contain wesl code[^2]. This lets us support wesl packages that come with host code! [^1]: npm, pnpm, yarn... package managers with a `node_modules/` directory and `package.json` file. -[^2]: In Rust land, this is necessary to comply with the [crates.io policy of being compatible with the cargo build tool](https://crates.io/policies). \ No newline at end of file +[^2]: In Rust land, this is necessary to comply with the [crates.io policy of being compatible with the cargo build tool](https://crates.io/policies).