-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Rust: add QL doc annotations to schema #17527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a7835ef
to
eade815
Compare
rust/schema/annotations.py
Outdated
# @annotate(ConstExpr) | ||
# @rust.doc_test_signature("() -> bool") | ||
# class _: | ||
# """ | ||
# A `const` block expression. For example: | ||
# ```rust | ||
# if const { SRC::IS_ZST || DEST::IS_ZST || mem::align_of::<SRC>() != mem::align_of::<DEST>() } { | ||
# return false; | ||
# } | ||
# ``` | ||
# """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this commented out? Might be worth a TODO unless it's an oversight
rust/schema/annotations.py
Outdated
""" | ||
The base class for expressions. | ||
""" | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: pass
is not required, and currently the file is not very consistent on it :)
rust/schema/annotations.py
Outdated
# @annotate(ElementListExpr) | ||
# class _: | ||
# """ | ||
# An element list expression. For example: | ||
# ```rust | ||
# [1, 2, 3, 4, 5]; | ||
# [1, 2, 3, 4, 5][0] = 6; | ||
# ``` | ||
# """ | ||
|
||
|
||
# @annotate(RepeatExpr) | ||
# class _: | ||
# """ | ||
# A repeat expression. For example: | ||
# ```rust | ||
# [1; 10]; | ||
# ``` | ||
# """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is what because of what you mentioned on https://github.com/github/codeql-team/issues/3378, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I can remove this for now.
@redsun82 The QL test generator seems to ignore the function signatures somehow, did we break something in the schema generator? |
121d212
to
45d9d8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
This pull request puts the QL docs with code examples back into the schema and generate the corresponding QL tests.