| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This PR adds a "Basic query for Rust code" documentation page to help users learn how to write and run simple CodeQL queries for Rust. The documentation follows the established pattern used for other supported languages and provides a tutorial for creating a query that identifies redundant if expressions.
Copilot reviewed 2 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docs/codeql/codeql-language-guides/codeql-for-rust.rst | Updates the table of contents to include the new basic query tutorial |
| docs/codeql/codeql-language-guides/basic-query-for-rust-code.rst | Adds complete tutorial documentation for writing basic Rust CodeQL queries |
Sorry, something went wrong.
| | | | ``.getStmtList()``: gets the list of things in the block. | | ||
| | | | ``.getNumberOfStmtOrExpr() = 0``: requires that there are no statements or expressions in the block. | | ||
| +----------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+ | ||
| | ``select ifExpr, "This 'if' expression is redundant."`` | Defines what to report for each match. | Reports the resulting ``if`` expression with a string that explains the problem. | |
There was a problem hiding this comment.
The error message refers to 'if' expression, but line 36 uses 'if' statement. The terminology should be consistent - use 'if' expression in both places since Rust treats if as an expression.
Sorry, something went wrong.
There was a problem hiding this comment.
You're right, though it's line 36 that should be updated - they're if "expressions" in Rust.
Updated the doc.
I'll need to re-create the screenshots as well, but lets wait and see if any other changes are suggested first...
Sorry, something went wrong.
There was a problem hiding this comment.
This is fine words-wise, as far as I can tell looking at the rST
I'm not sure why the Sphinx build is failing... ideally we'd get it working, which would make reviewing more complete, but if that's not possible I think this is OK
Sorry, something went wrong.
|
I think I've fixed it now. I'll update the graphics next... |
Sorry, something went wrong.
|
Done. Ready for another look. |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for fixing that! I took a look in a browser and all looks good
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Add "Basic query for Rust code" doc page, similar to the one we have for most other languages.