Skip to content

Commit 48778ce

Browse files
authored
Merge pull request github#6160 from timoles/patch-1
Add information for generating qhelp files locally
2 parents 20fa8e4 + b24c096 commit 48778ce

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/query-help-style-guide.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,21 @@ For example:
110110

111111
If your query checks code for a CWE weakness, you should use the `@tags` element in the query file to reference the associated CWEs, as explained [here](query-metadata-style-guide.md). When you use these tags, a link to the appropriate entry from the [MITRE.org](https://cwe.mitre.org/scoring/index.html) site will automatically appear as a reference in the output HTML file.
112112

113+
## Validating qhelp files
114+
115+
Before making a pull request, please ensure the `.qhelp` files are well-formed and can be generated without errors. This can be done locally with the CodeQL CLI, as shown in the following example:
116+
117+
```bash
118+
# codeql generate query-help <path_to_your_qhelp_file> --format=<format>
119+
# For example:
120+
codeql generate query-help ./myCustomQuery.qhelp --format=markdown
121+
```
122+
123+
124+
Please include the `.qhelp` files (and any associated code snippets) in your pull request, but do not commit the generated Markdown.
125+
126+
More information on how to test your `.qhelp` files can be found [within the documentation](https://codeql.github.com/docs/codeql-cli/testing-query-help-files/)
127+
113128
## Query help example
114129

115130
The following example is a query help file for a query from the standard query suite for Java:

0 commit comments

Comments
 (0)