FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Rust: Add Basic query for Rust code doc by geoffw0 · Pull Request #20561 · github/codeql · GitHub

/ codeql Public

Rust: Add Basic query for Rust code doc - #20561

Merged
geoffw0 merged 10 commits into
github:mainfrom
geoffw0:basicquery
Oct 1, 2025
Merged

Rust: Add Basic query for Rust code doc#20561
geoffw0 merged 10 commits into
github:mainfrom
geoffw0:basicquery

Conversation

geoffw0 commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

Add "Basic query for Rust code" doc page, similar to the one we have for most other languages.

geoffw0 added the no-change-note-required This PR does not need a change note label Sep 30, 2025
Copilot AI review requested due to automatic review settings September 30, 2025 14:36
geoffw0 added ready-for-doc-review This PR requires and is ready for review from the GitHub docs team. Rust Pull requests that update Rust code labels Sep 30, 2025
github-actions Bot added documentation and removed Rust Pull requests that update Rust code labels Sep 30, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull Request Overview

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.

  • Adds comprehensive tutorial documentation for writing basic Rust CodeQL queries
  • Updates the language guide index to include the new documentation page
  • Uses consistent formatting and structure with existing language guide documentation

Reviewed Changes

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

| | | ``.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. |

Copilot AI Sep 30, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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...

subatoi previously approved these changes Oct 1, 2025

subatoi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

geoffw0 commented Oct 1, 2025

Copy link
Copy Markdown
Contributor Author

I think I've fixed it now.

I'll update the graphics next...

geoffw0 commented Oct 1, 2025

Copy link
Copy Markdown
Contributor Author

Done. Ready for another look.

subatoi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for fixing that! I took a look in a browser and all looks good

geoffw0 merged commit f96a42c into github:main Oct 1, 2025
8 checks passed
geoffw0 deleted the basicquery branch June 25, 2026 11:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation no-change-note-required This PR does not need a change note ready-for-doc-review This PR requires and is ready for review from the GitHub docs team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL