Skip to content

Commit b58653e

Browse files
authored
Merge pull request github#10458 from github/aeisenberg/qlpack-properties
Update qlpack properties descriptions
2 parents 7272ca7 + bbf09c8 commit b58653e

File tree

1 file changed

+98
-55
lines changed

1 file changed

+98
-55
lines changed

docs/codeql/codeql-cli/about-codeql-packs.rst

Lines changed: 98 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -58,118 +58,161 @@ The following properties are supported in ``qlpack.yml`` files.
5858
:widths: auto
5959

6060
* - Property
61-
- Example
62-
- Required by
63-
- Purpose
61+
- When to use
62+
- Explanation
6463
* - ``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
6670
6771
name: octo-org/security-queries
6872
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).
7173
* - ``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
7380
7481
version: 0.0.0
7582
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>`__.
7883
* - ``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
8090
8191
dependencies:
8292
codeql/cpp-all: ^0.0.2
8393
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.
8694
* - ``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
88101
89102
defaultSuiteFile: cpp-code-scanning.qls
90103
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.
93104
* - ``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
95111
96112
defaultSuite:
97113
queries: .
98114
exclude:
99115
precision: medium
100116
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.
103117
* - ``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
105124
106125
library: true
107126
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``.
110127
* - ``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>`."
112130

113-
suites: octo-org-query-suites
131+
Example:
114132

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
119134
120-
extractor: javascript
135+
suites: octo-org-query-suites
121136
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>`."
124137
* - ``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
126144
127145
tests: .
128146
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>`."
133150

134-
dbscheme: semmlecode.python.dbscheme
151+
Example:
135152

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
140154
141-
upgrades: .
155+
extractor: javascript
142156
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.
145157
* - ``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.
160+
161+
Example:
162+
163+
.. code-block:: yaml
147164
148165
149166
150-
- All packs
151-
- Metadata that will be displayed on the packaging search page in the packages section of the account that the CodeQL pack is published to.
152167
* - ``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
154174
155175
license: MIT
156176
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.
159177
* - ``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
161184
162185
description: Human-readable description of the contents of the CodeQL pack.
163186
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.
166187
* - ``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
168194
169195
libraryPathDependencies: codeql/javascript-all
170196
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.
210+
211+
Example:
212+
213+
.. code-block:: yaml
214+
215+
upgrades: .
173216
174217
.. _about-codeql-pack-lock:
175218

0 commit comments

Comments
 (0)