| description | Reference for the codeql query compile command |
|---|
The codeql query compile command is used to compile CodeQL queries to check for syntax and semantic errors.
The following is an example use of the command for compiling a query:
# Just check that the QL is valid and print any errors
# Do not actually optimize and store a query plan.
# This can be much faster than a full compilation.
# Use default options for `--format` and `--warnings` arguments.
codeql query compile \
--check-only \
--format=text \
--warnings=show \
-- languages/<language>/<pack-basename>/src/<QueryBasename>/<QueryBasename>.qlThe codeql query compile command can also supports many options:
# Just check that the QL is valid and print any errors.
# Use the `json` output format and hide/suppress warning-level compilation messages.
# Don't check embedded query metadata in QLDoc comments for validity.
codeql query compile \
--check-only \
--format=json \
--no-metadata-verification \
--warnings=hide \
-- languages/<language>/<pack-basename>/src/<QueryBasename>/<QueryBasename>.ql# Perform full compilation of the query, even though using `--check-only` would be much faster.
# Use the `json` output format and treat warning-level compilation messages as errors.
codeql query compile \
--format=json \
--warnings=error \
-- languages/<language>/<pack-basename>/src/<QueryBasename>/<QueryBasename>.qlRun codeql query compile -h for more information.
Run codeql query compile -h -vv for much more information.
codeql pack install- Install library dependencies declared in a CodeQL packcodeql resolve library-path- Resolve the local paths of CodeQL library dependencies
codeql query run- Run the compiled query against a databasecodeql query format- Format the compiled query source code