Skip to content

Commit d1a4f57

Browse files
authored
Added chapter about generating qhelp files locally
1 parent 2d24387 commit d1a4f57

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/query-help-style-guide.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,18 @@ 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 you should ensure the `.qhelp` file is well-formed and can be generated without problems. For example, this can be done locally with `codeql-cli` tool. In order to do so just start the `codeql-cli` with the appropriate parameters, as seen 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+
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/)
124+
113125
## Query help example
114126

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

0 commit comments

Comments
 (0)