Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ semver = { version = "1.0.24", features = ["serde"] }
serde = { version = "1.0.210", features = ["derive"] }
serde_json = { version = "1.0.132", features = ["preserve_order", "unbounded_depth"] }
serde_stacker = { version = "0.1.12" }
serde-saphyr = { version = "1.2.0", default-features = false, features = ["deserialize", "serialize"] }
serde-saphyr = { version = "1.1.0", default-features = false, features = ["deserialize", "serialize"] }
Comment thread
j178 marked this conversation as resolved.
Resolved
shlex = { version = "2.0.0" }
globset = { version = "0.4.18" }
granit-parser = { version = "1.2.0" }
granit-parser = { version = "1.1.0" }
similar = { version = "3.0.0" }
ssl-certs = { version = "0.1.1" }
strum = { version = "0.28.0", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/prek/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ mod tests {
),
(
r#"["ci\tslow"]"#,
"group name `ci\\tslow` cannot contain whitespace",
"group name `ci\tslow` cannot contain whitespace",
),
(
r#"["@custom"]"#,
Expand Down
18 changes: 0 additions & 18 deletions crates/prek/src/hooks/pre_commit_hooks/check_yaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ fn check_loaded(filename: &Path, content: &[u8], allow_multi_docs: bool) -> Hook
emit_comments: false,
// Do not require `!!binary` scalars to decode as UTF-8. See #1102.
ignore_binary_tag_for_string: true,
// A YAML tag identifies a node's type or application-specific semantics.
// `%TAG` directives map tag handles to prefixes. The predefined `!!`
// handle expands to `tag:yaml.org,2002:`, while `!` is the local tag handle.
// Match ruamel.yaml's safe loader by rejecting tags without constructors. See #2604.
reject_unsupported_tags: true,
// The scalar values are discarded, so only validate whether they are
// legal YAML, not whether an untyped data model can represent them. See #2544.
reject_non_finite_typeless_float: false,
Expand Down Expand Up @@ -316,19 +311,6 @@ key2: value2
Ok(())
}

#[test]
fn test_unknown_yaml_tag_requires_unsafe() {
let filename = Path::new("tagged.yaml");
let content = b"foo: !reference [.bar, script]\n";

let result = check_loaded(filename, content, false);
assert_eq!(result.exit_status, 1);
insta::assert_snapshot!(String::from_utf8_lossy(&result.output), @"tagged.yaml: Failed to yaml decode (unsupported tag `!reference` at line 1, column 17)");

let result = check_syntax(filename, content);
assert_eq!((result.exit_status, result.output), (0, Vec::new()));
}

#[tokio::test]
Comment thread
j178 marked this conversation as resolved.
Resolved
async fn test_yaml_with_binary_scalar() -> Result<()> {
let dir = tempdir()?;
Expand Down
Loading