diff --git a/docs/rcl_build.md b/docs/rcl_build.md index 688caca5..b5441dfa 100644 --- a/docs/rcl_build.md +++ b/docs/rcl_build.md @@ -28,7 +28,7 @@ The following `build.rcl` writes two files to the `users` directory: ```rcl let default_options = { - banner = "# This file is generated from build.rcl.\n", + banner = "# This file is generated from build.rcl.", format = "toml", }; { @@ -74,8 +74,8 @@ The value to write to the file in the desired format. ### format -The output format. This must be one of the formats supported by -[`--format`](rcl_evaluate.md#-f-format-format). +The output format (`json`, `toml`, etc.). This must be one of the formats +supported by [`--format`](rcl_evaluate.md#-f-format-format). ### width diff --git a/examples/build.rcl b/examples/build.rcl index e759960c..2e6bc251 100644 --- a/examples/build.rcl +++ b/examples/build.rcl @@ -4,11 +4,11 @@ "out/github_actions.yml": { contents = import "github_actions.rcl", format = "json", - banner = "# This file is generated from github_actions.rcl.\n", + banner = "# This file is generated from github_actions.rcl.", }, "out/buckets.toml": { contents = import "buckets.rcl", format = "toml", - banner = "# This file is generated from buckets.rcl.\n", + banner = "# This file is generated from buckets.rcl.", }, } diff --git a/fuzz/dictionary_cli.txt b/fuzz/dictionary_cli.txt index b08e3da7..6b687a64 100644 --- a/fuzz/dictionary_cli.txt +++ b/fuzz/dictionary_cli.txt @@ -1,4 +1,5 @@ # Commands +"build" "evaluate" "fmt" "format" diff --git a/src/loader.rs b/src/loader.rs index 5f4d1721..e5bac40e 100644 --- a/src/loader.rs +++ b/src/loader.rs @@ -362,7 +362,7 @@ impl Filesystem for SandboxFilesystem { // Walk all parent directories, from the workdir down deeper, and create // them if needed, and verify that they comply with the sandbox policy. - // `.ancestors()` returns the path itself aswell, so we `.skip(1)`. + // `.ancestors()` returns the path itself as well, so we `.skip(1)`. let ancestors: Vec<_> = path_buf.ancestors().collect(); for ancestor in ancestors.iter().skip(1).rev() { // Ancestors also includes the ancestors of the workdir, but we only @@ -392,7 +392,10 @@ impl Filesystem for SandboxFilesystem { // there is no portable way to sidestep that, and it's a quite // pathological problem, so I'm going to accept the risk. match self.mode { - SandboxMode::Unrestricted => {} + SandboxMode::Unrestricted => { + // The unrestricted policy places no requirements on the + // path, so we don't check anything here. + } SandboxMode::Workdir => { let abs_path = match std::fs::canonicalize(ancestor) { Ok(path) => path, @@ -413,7 +416,7 @@ impl Filesystem for SandboxFilesystem { "'." }) .with_body(concat! { - "Refusing to write to this path:" + "Refusing to write in this path:" pprint::Doc::HardBreak pprint::Doc::HardBreak indent! { pprint::Doc::path(ancestor) } pprint::Doc::HardBreak pprint::Doc::HardBreak diff --git a/src/pprint.rs b/src/pprint.rs index 27b703a1..5bb2ab79 100644 --- a/src/pprint.rs +++ b/src/pprint.rs @@ -221,7 +221,7 @@ impl<'a> Doc<'a> { /// Construct a highlighted document fragment for a file path. /// /// This is expected to be used only in error messages, therefore it's okay - /// that we an owned copy of the path. + /// that we make an owned copy of the path. pub fn path>(path: P) -> Doc<'static> { let path_str = path.as_ref().to_string_lossy(); Doc::highlight(&path_str).into_owned()