Skip to content

Commit 5ea93d6

Browse files
committed
further imrpovements
1 parent 7236f3b commit 5ea93d6

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

docs/codeql/codeql-cli/analyzing-databases-with-the-codeql-cli.rst

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ You can also specify:
6666
- ``--sarif-add-query-help``: (supported in version 2.7.1 onwards) adds any custom query help written
6767
in markdown to SARIF files (v2.1.0 or later) generated by the analysis. Query help stored in ``.qhelp`` files must be
6868
converted to ``.md`` before running the analysis. For further information,
69-
see ":doc:`Including query help for custom CodeQL queries in SARIF files <testing-query-help-files>`."
69+
see ":ref:`Including query help for custom CodeQL queries in SARIF files <including-query-help-for-custom-codeql-queries-in-sarif-files>`."
7070

7171
- .. include:: ../reusables/threads-query-execution.rst
7272

@@ -211,15 +211,21 @@ supported by CodeQL.
211211
Including query help for custom CodeQL queries in SARIF files
212212
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
213213

214-
Code scanning does not process ``.qhelp`` files for custom CodeQL queries, so to show
215-
query help for custom queries in the code scanning UI you must include markdown-rendered query help
216-
in SARIF files generated during an analysis.
214+
If you use the CodeQL CLI to to run code scanning analyses on third party CI/CD systems,
215+
you can include the query help for your custom queries in SARIF files generated during an analysis.
216+
After uploading the SARIF file to GitHub, the query help is shown in the code scanning UI for any
217+
alerts generated by the custom queries.
217218

218-
For CodeQL CLI 2.7.1 onwards, you can include markdown-rendered query help in SARIF files
219+
From CodeQL CLI 2.7.1 onwards, you can include markdown-rendered query help in SARIF files
219220
by providing the ``--sarif-add-query-help`` option when running
220-
``codeql database analyze``. Query help written in ``.qhelp`` files cannot be include in SARIF files,
221-
so must be converted to markdown before running the analysis. For more information, see
222-
":ref:`Testing query help files <testing-query-help-files>`."
221+
``codeql database analyze``.
222+
223+
You can write query help for custom queries directly in markdown file and save it alongside the
224+
corresponding query. Alternatively, for consistency with the standard CodeQL queries,
225+
you can write query help in the ``.qhelp`` format and convert it to markdown before
226+
running the analysis. Query help written in ``.qhelp`` files can't be included in SARIF files,
227+
and they can't be processed by code scanning. For more information, see
228+
":doc:`Testing query help files <testing-query-help-files>`."
223229

224230
Results
225231
-------

docs/codeql/codeql-cli/testing-query-help-files.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ in the CodeQL repository.
1515
The CodeQL CLI includes a command to test query help and render the content as
1616
markdown, so that you can easily preview the content in your IDE. Use the command to validate
1717
query help files before uploading them to the CodeQL repository or sharing them with other users.
18-
For CodeQL CLI 2.7.1 onwards, you can also include the markdown-rendered query help in SARIF files
18+
From CodeQL CLI 2.7.1 onwards, you can also include the markdown-rendered query help in SARIF files
1919
generated during CodeQL analyses so that the query help can be displayed in the code scanning UI.
2020
For more information, see
2121
":ref:`Analyzing databases with the CodeQL CLI <including-query-help-for-custom-codeql-queries-in-sarif-files>`."

0 commit comments

Comments
 (0)