You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/codeql/codeql-cli/about-codeql-packs.rst
+98-55Lines changed: 98 additions & 55 deletions
Original file line number
Diff line number
Diff line change
@@ -58,118 +58,161 @@ The following properties are supported in ``qlpack.yml`` files.
58
58
:widths: auto
59
59
60
60
* - Property
61
-
- Example
62
-
- Required by
63
-
- Purpose
61
+
- When to use
62
+
- Explanation
64
63
* - ``name``
65
-
- .. code-block:: yaml
64
+
- Required by all packs
65
+
- The scope, where the CodeQL pack is published, and the name of the pack defined using alphanumeric characters and hyphens. It must be unique as CodeQL cannot differentiate between CodeQL packs with identical names. Use the pack name to specify queries to run using ``database analyze`` and to define dependencies between CodeQL packs (see examples below).
66
+
67
+
Example:
68
+
69
+
.. code-block:: yaml
66
70
67
71
name: octo-org/security-queries
68
72
69
-
- All packs
70
-
- The scope, where the CodeQL pack is published, and the name of the pack defined using alphanumeric characters and hyphens. It must be unique as CodeQL cannot differentiate between CodeQL packs with identical names. Use the pack name to specify queries to run using ``database analyze`` and to define dependencies between CodeQL packs (see examples below).
71
73
* - ``version``
72
-
- .. code-block:: yaml
74
+
- Required by all packs that are published
75
+
- A semantic version for this CodeQL pack that must adhere to the `SemVer v2.0.0 specification <https://semver.org/spec/v2.0.0.html>`__.
76
+
77
+
Example:
78
+
79
+
.. code-block:: yaml
73
80
74
81
version: 0.0.0
75
82
76
-
- All packs
77
-
- A semantic version for this CodeQL pack that must adhere to the `SemVer v2.0.0 specification <https://semver.org/spec/v2.0.0.html>`__.
78
83
* - ``dependencies``
79
-
- .. code-block:: yaml
84
+
- Required by packs that define CodeQL package dependencies on other packs.
85
+
- A map from pack references to the semantic version range that is compatible with this pack. Supported for CLI versions v2.6.0 and later.
86
+
87
+
Example:
88
+
89
+
.. code-block:: yaml
80
90
81
91
dependencies:
82
92
codeql/cpp-all: ^0.0.2
83
93
84
-
- Packs that define CodeQL package dependencies on other packs
85
-
- A map from pack references to the semantic version range that is compatible with this pack. Supported for CLI versions v2.6.0 and later.
86
94
* - ``defaultSuiteFile``
87
-
- .. code-block:: yaml
95
+
- Required by packs that export a set of default queries to run
96
+
- The path to a query suite file relative to the package root, containing all of the queries that are run by default when this pack is passed to the ``codeql database analyze`` command. Supported from CLI version v2.6.0 and onwards. Only one of ``defaultSuiteFile`` or ``defaultSuite`` can be defined.
97
+
98
+
Example:
99
+
100
+
.. code-block:: yaml
88
101
89
102
defaultSuiteFile: cpp-code-scanning.qls
90
103
91
-
- Packs that export a set of default queries to run
92
-
- The path to a query suite file relative to the package root, containing all of the queries that are run by default when this pack is passed to the ``codeql database analyze`` command. Supported from CLI version v2.6.0 and onwards. Only one of ``defaultSuiteFile`` or ``defaultSuite`` can be defined.
93
104
* - ``defaultSuite``
94
-
- .. code-block:: yaml
105
+
- Required by packs that export a set of default queries to run.
106
+
- An inlined query suite containing all of the queries that are run by default when this pack is passed to the ``codeql database analyze`` command. Supported from CLI version v2.6.0 and onwards. Only one of ``defaultSuiteFile`` or ``defaultSuite`` can be defined.
107
+
108
+
Example:
109
+
110
+
.. code-block:: yaml
95
111
96
112
defaultSuite:
97
113
queries: .
98
114
exclude:
99
115
precision: medium
100
116
101
-
- Packs that export a set of default queries to run
102
-
- An inlined query suite containing all of the queries that are run by default when this pack is passed to the ``codeql database analyze`` command. Supported from CLI version v2.6.0 and onwards. Only one of ``defaultSuiteFile`` or ``defaultSuite`` can be defined.
103
117
* - ``library``
104
-
- .. code-block:: yaml
118
+
- Required by library packs
119
+
- A boolean value that indicates whether this pack is a library pack. Library packs do not contain queries and are not compiled. Query packs can ignore this field or explicitly set it to ``false``.
120
+
121
+
Example:
122
+
123
+
.. code-block:: yaml
105
124
106
125
library: true
107
126
108
-
- Library packs
109
-
- A boolean value that indicates whether this pack is a library pack. Library packs do not contain queries and are not compiled. Query packs can ignore this field or explicitly set it to ``false``.
110
127
* - ``suites``
111
-
- .. code-block:: yaml
128
+
- Optional for packs that define query suites
129
+
- The path to a directory in the pack that contains the query suites you want to make known to the CLI, defined relative to the pack directory. CodeQL pack users can run "well-known" suites stored in this directory by specifying the pack name, without providing their full path. This is not supported for CodeQL packs downloaded from the Container registry. For more information about query suites, see ":doc:`Creating CodeQL query suites <creating-codeql-query-suites>`."
112
130
113
-
suites: octo-org-query-suites
131
+
Example:
114
132
115
-
- Optional
116
-
- The path to a directory in the pack that contains the query suites you want to make known to the CLI, defined relative to the pack directory. CodeQL pack users can run "well-known" suites stored in this directory by specifying the pack name, without providing their full path. This is not supported for CodeQL packs downloaded from the Container registry. For more information about query suites, see ":doc:`Creating CodeQL query suites <creating-codeql-query-suites>`."
117
-
* - ``extractor``
118
-
- .. code-block:: yaml
133
+
.. code-block:: yaml
119
134
120
-
extractor: javascript
135
+
suites: octo-org-query-suites
121
136
122
-
- All packs containing CodeQL tests
123
-
- The CodeQL language extractor to use when running the CodeQL tests in the pack. For more information about testing queries, see ":doc:`Testing custom queries <testing-custom-queries>`."
124
137
* - ``tests``
125
-
- .. code-block:: yaml
138
+
- Optional for packs containing CodeQL tests. Ignored for packs without tests.
139
+
- The path to a directory within the pack that contains tests, defined relative to the pack directory. Use ``.`` to specify the whole pack. Any queries in this directory are run as tests when ``test run`` is run with the ``--strict-test-discovery`` option. These queries are ignored by query suite definitions that use ``queries`` or ``qlpack`` instructions to ask for all queries in a particular pack. If this property is missing, then ``.`` is assumed.
140
+
141
+
Example:
142
+
143
+
.. code-block:: yaml
126
144
127
145
tests: .
128
146
129
-
- Optional for packs containing CodeQL tests. Ignored for packs without tests.
130
-
- The path to a directory within the pack that contains tests, defined relative to the pack directory. Use ``.`` to specify the whole pack. Any queries in this directory are run as tests when ``test run`` is run with the ``--strict-test-discovery`` option. These queries are ignored by query suite definitions that use ``queries`` or ``qlpack`` instructions to ask for all queries in a particular pack. If this property is missing, then ``.`` is assumed.
131
-
* - ``dbscheme``
132
-
- .. code-block:: yaml
147
+
* - ``extractor``
148
+
- All packs containing CodeQL tests
149
+
- The CodeQL language extractor to use when running the CodeQL tests in the pack. For more information about testing queries, see ":doc:`Testing custom queries <testing-custom-queries>`."
133
150
134
-
dbscheme: semmlecode.python.dbscheme
151
+
Example:
135
152
136
-
- Core language packs only
137
-
- The path to the :ref:`database schema <codeql-database-schema>` for all libraries and queries written for this CodeQL language (see example below).
138
-
* - ``upgrades``
139
-
- .. code-block:: yaml
153
+
.. code-block:: yaml
140
154
141
-
upgrades: .
155
+
extractor: javascript
142
156
143
-
- Core language packs only
144
-
- The path to a directory within the pack that contains database upgrade scripts, defined relative to the pack directory. Database upgrades are used internally to ensure that a database created with a different version of the CodeQL CLI is compatible with the current version of the CLI.
145
157
* - ``authors``
146
-
- .. code-block:: yaml
158
+
- Optional
159
+
- Metadata that will be displayed on the packaging search page in the packages section of the account that the CodeQL pack is published to.
- Metadata that will be displayed on the packaging search page in the packages section of the account that the CodeQL pack is published to.
152
167
* - ``license``
153
-
- .. code-block:: yaml
168
+
- Optional
169
+
- Metadata that will be displayed on the packaging search page in the packages section of the account that the CodeQL pack is published to. For a list of allowed licenses, see `SPDX License List <https://spdx.org/licenses/>`__ in the SPDX Specification.
170
+
171
+
Example:
172
+
173
+
.. code-block:: yaml
154
174
155
175
license: MIT
156
176
157
-
- All packs
158
-
- Metadata that will be displayed on the packaging search page in the packages section of the account that the CodeQL pack is published to. For a list of allowed licenses, see `SPDX License List <https://spdx.org/licenses/>`__ in the SPDX Specification.
159
177
* - ``description``
160
-
- .. code-block:: yaml
178
+
- Optional
179
+
- Metadata that will be displayed on the packaging search page in the packages section of the account that the CodeQL pack is published to.
180
+
181
+
Example:
182
+
183
+
.. code-block:: yaml
161
184
162
185
description: Human-readable description of the contents of the CodeQL pack.
163
186
164
-
- All packs
165
-
- Metadata that will be displayed on the packaging search page in the packages section of the account that the CodeQL pack is published to.
166
187
* - ``libraryPathDependencies``
167
-
- .. code-block:: yaml
188
+
- Optional, deprecated
189
+
- Use the ``dependencies`` property instead. The names of any CodeQL packs that this CodeQL pack depends on, as an array. This gives the pack access to any libraries, database schema, and query suites defined in the dependency.
190
+
191
+
Example:
192
+
193
+
.. code-block:: yaml
168
194
169
195
libraryPathDependencies: codeql/javascript-all
170
196
171
-
- Optional, deprecated
172
-
- Use the ``dependencies`` property instead. The names of any CodeQL packs that this CodeQL pack depends on, as an array. This gives the pack access to any libraries, database schema, and query suites defined in the dependency.
197
+
* - ``dbscheme``
198
+
- Required by core language packs only
199
+
- The path to the :ref:`database schema <codeql-database-schema>` for all libraries and queries written for this CodeQL language (see example below).
200
+
201
+
Example:
202
+
203
+
.. code-block:: yaml
204
+
205
+
dbscheme: semmlecode.python.dbscheme
206
+
207
+
* - ``upgrades``
208
+
- Required by core language packs only
209
+
- The path to a directory within the pack that contains database upgrade scripts, defined relative to the pack directory. Database upgrades are used internally to ensure that a database created with a different version of the CodeQL CLI is compatible with the current version of the CLI.
0 commit comments