Files
codeql/rust/.gitattributes
Paolo Tranquilli 8c5cc2efdc Rust: generate test code from schema docstrings
This generates test source files from code blocks in class docstrings.

By default the test code is generated as is, but it can optionally:
* be wrapped in a function providing an adequate context using
  `@rust.doc_test_function(name, *, lifetimes=(), return_type="()", **kwargs)`,
  with `kwargs` providing both generic and normal params depending on
  capitalization
* be skipped altogether using `@rust.skip_doc_test`

So for example an annotation like
```python
@rust.doc_test_function("foo",
                        lifetimes=("a",),
                        T="Eq",
                        x="&'a T",
                        y="&'a T",
                        return_type="&'a T")
```
will result in the following wrapper:
```rust
fn foo<'a, T: Eq>(x: &'a T, y: &'a T) -> &'a T {
    // example code here
}
```
2024-09-06 14:24:42 +02:00

34 lines
2.0 KiB
Plaintext
Generated

/.generated.list linguist-generated
/.gitattributes linguist-generated
/extractor/src/generated/mod.rs linguist-generated
/extractor/src/generated/top.rs linguist-generated
/ql/lib/codeql/rust/elements/DbFile.qll linguist-generated
/ql/lib/codeql/rust/elements/DbFileConstructor.qll linguist-generated
/ql/lib/codeql/rust/elements/DbLocation.qll linguist-generated
/ql/lib/codeql/rust/elements/DbLocationConstructor.qll linguist-generated
/ql/lib/codeql/rust/elements/Declaration.qll linguist-generated
/ql/lib/codeql/rust/elements/FunctionConstructor.qll linguist-generated
/ql/lib/codeql/rust/elements/Module.qll linguist-generated
/ql/lib/codeql/rust/elements/ModuleConstructor.qll linguist-generated
/ql/lib/codeql/rust/elements.qll linguist-generated
/ql/lib/codeql/rust/generated/DbFile.qll linguist-generated
/ql/lib/codeql/rust/generated/DbLocation.qll linguist-generated
/ql/lib/codeql/rust/generated/Declaration.qll linguist-generated
/ql/lib/codeql/rust/generated/Element.qll linguist-generated
/ql/lib/codeql/rust/generated/File.qll linguist-generated
/ql/lib/codeql/rust/generated/Function.qll linguist-generated
/ql/lib/codeql/rust/generated/Locatable.qll linguist-generated
/ql/lib/codeql/rust/generated/Location.qll linguist-generated
/ql/lib/codeql/rust/generated/Module.qll linguist-generated
/ql/lib/codeql/rust/generated/ParentChild.qll linguist-generated
/ql/lib/codeql/rust/generated/PureSynthConstructors.qll linguist-generated
/ql/lib/codeql/rust/generated/Raw.qll linguist-generated
/ql/lib/codeql/rust/generated/Synth.qll linguist-generated
/ql/lib/codeql/rust/generated/SynthConstructors.qll linguist-generated
/ql/lib/codeql/rust/generated/UnknownFile.qll linguist-generated
/ql/lib/codeql/rust/generated/UnknownLocation.qll linguist-generated
/ql/test/extractor-tests/generated/File/File.ql linguist-generated
/ql/test/extractor-tests/generated/Function/Function.ql linguist-generated
/ql/test/extractor-tests/generated/Function/gen_function.rs linguist-generated
/ql/test/extractor-tests/generated/Module/MISSING_SOURCE.txt linguist-generated