Ruby, Rust: add `zstd` compression option · github/codeql@923a285 · GitHub
Skip to content

Commit 923a285

Browse files
author
Paolo Tranquilli
committed
Ruby, Rust: add zstd compression option
1 parent 4a9e31e commit 923a285

5 files changed

Lines changed: 24 additions & 8 deletions

File tree

‎ruby/codeql-extractor.yml‎

Lines changed: 3 additions & 3 deletions

‎rust/codeql-extractor.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ options:
2323
title: Controls compression for the TRAP files written by the extractor.
2424
description: >
2525
This option is only intended for use in debugging the extractor. Accepted
26-
values are 'gzip' (to write gzip-compressed TRAP) and 'none'
27-
(currently the default, to write uncompressed TRAP).
26+
values are 'gzip' (the default, to write gzip-compressed TRAP) 'zstd' (to
27+
write Zstandard-compressed TRAP) and 'none' (to write uncompressed TRAP).
2828
type: string
29-
pattern: "^(none|gzip)$"
29+
pattern: "^(none|gzip|zstd)$"
3030
cargo_target_dir:
3131
title: Directory to use for cargo output files.
3232
description: >

‎rust/extractor/src/config.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ pub enum Compression {
2929
#[default] // TODO make gzip default
3030
None,
3131
Gzip,
32+
Zstd,
3233
}
3334

3435
impl From<Compression> for trap::Compression {
3536
fn from(val: Compression) -> Self {
3637
match val {
3738
Compression::None => Self::None,
3839
Compression::Gzip => Self::Gzip,
40+
Compression::Zstd => Self::Zstd,
3941
}
4042
}
4143
}

‎rust/ql/integration-tests/hello-project/test_project.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def test_do_not_print_env(codeql, rust, rust_edition, cargo, check_env_not_dumpe
2020
@pytest.mark.ql_test("steps.ql", expected=".cargo.expected")
2121
@pytest.mark.parametrize(("rust_edition", "compression", "suffix"), [
2222
pytest.param(2024, "gzip", ".gz", id="gzip"),
23+
pytest.param(2024, "zstd", ".zst", id="zstd"),
2324
])
2425
def test_compression(codeql, rust, rust_edition, compression, suffix, cargo, rust_check_diagnostics, cwd):
2526
codeql.database.create(cleanup=False, _env={

‎shared/tree-sitter-extractor/src/trap.rs‎

Lines changed: 15 additions & 2 deletions

0 commit comments

Comments
 (0)