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
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ You can use the CodeQL package manger in the CodeQL CLI to create CodeQL packs,
21
21
CodeQL pack structure
22
22
---------------------
23
23
24
-
A CodeQL pack must contain a file called ``qlpack.yml`` in its root directory. In the ``qlpack.yml`` file, the ``name:`` field must have a value that follows the format of ``<scope>/<pack>``, where ``<scope>`` is the GitHub organization that the pack is published to and ``<pack>`` is the name of the pack. The other
24
+
A CodeQL pack must contain a file called ``qlpack.yml`` in its root directory. In the ``qlpack.yml`` file, the ``name:`` field must have a value that follows the format of ``<scope>/<pack>``, where ``<scope>`` is the GitHub organization or user account that the pack will be published to and ``<pack>`` is the name of the pack. The other
25
25
files and directories within the pack should be logically organized. For example, typically:
26
26
27
27
- Queries are organized into directories for specific categories.
@@ -31,7 +31,11 @@ files and directories within the pack should be logically organized. For example
31
31
About ``qlpack.yml`` files
32
32
--------------------------
33
33
34
-
When executing query-related commands, CodeQL first looks in the package cache for CodeQL packs which have already been downloaded. If a suitable pack cannot be found, then CodeQL scans siblings of the installation directory (and their subdirectories) for ``qlpack.yml`` files. The metadata in each `qlpack.yml`` file tells
34
+
When executing query-related commands, CodeQL first looks in siblings of the installation directory (and their subdirectories) for ``qlpack.yml`` files.
35
+
Then it checks the package cache for CodeQL packs which have been downloaded. This means that when you are developing queries locally, the local packages
36
+
in the installation directory override packages of the same name in the package cache, so that you can test your local changes.
37
+
38
+
The metadata in each `qlpack.yml`` file tells
35
39
CodeQL how to compile any queries in the pack, what libraries the pack depends on, and where to
36
40
find query suite definitions.
37
41
@@ -65,11 +69,11 @@ The following properties are supported in ``qlpack.yml`` files.
65
69
* - ``version``
66
70
- ``0.0.0``
67
71
- All packs
68
-
- A version number for this CodeQL pack. This must be a valid semantic version that meets the `SemVer v2.0.0 specification <https://semver.org/spec/v2.0.0.html>`__.
72
+
- A version range for this CodeQL pack. This must be a valid semantic version that meets the `SemVer v2.0.0 specification <https://semver.org/spec/v2.0.0.html>`__.
69
73
* - ``dependencies``
70
74
- ``codeql/javascript-all: ^1.2.3``
71
75
- Optional
72
-
- The names of any CodeQL packs that this pack depends on, as a sequence. This gives the pack access to any libraries, database schema, and query suites defined in the dependency. Optionally a version for the dependency is specified.
76
+
- The names and version ranges of any CodeQL packs that this pack depends on, as a mapping. This gives the pack access to any libraries, database schema, and query suites defined in the dependency. For more information, see `SemVer ranges <https://docs.npmjs.com/cli/v6/using-npm/semver#ranges>`__ in the NPM documentation.
73
77
* - ``suites``
74
78
- ``octo-org-query-suites``
75
79
- Optional
@@ -93,12 +97,12 @@ The following properties are supported in ``qlpack.yml`` files.
- Metadata that will be displayed on the packaging search page in the packages section of the organization that a CodeQL pack is published to.
100
+
- Metadata that will be displayed on the packaging search page in the packages section of the account that the CodeQL pack is published to.
97
101
* - ``licenses``
98
102
- ``(LGPL-2.1 AND MIT)``
99
103
- All packs
100
-
- Metadata that will be displayed on the packaging search page in the packages section of the organization that a CodeQL pack is published to.
104
+
- 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.
101
105
* - ``description``
102
106
- ``Human-readable description of the software packaged in the image.``
103
107
- All packs
104
-
- Metadata that will be displayed on the packaging search page in the packages section of the organization that a CodeQL pack is published to.
108
+
- Metadata that will be displayed on the packaging search page in the packages section of the account that the CodeQL pack is published to.
Copy file name to clipboardExpand all lines: docs/codeql/codeql-cli/creating-and-working-with-codeql-packs.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ You can create a CodeQL pack by running the following command from the checkout
33
33
34
34
You must specify:
35
35
36
-
- ``<scope>``: the name of the GitHub organization that you will publish to.
36
+
- ``<scope>``: the name of the GitHub organization or user account that you will publish to.
37
37
- ``<pack>``: the name for the pack that you are creating.
38
38
39
39
The ``codeql pack init`` command creates the directory structure and configuration files for a CodeQL pack. By default, the command creates a query pack. If you want to create a library pack, you must edit the ``qlpack.yml`` file to explicitly declare the file as a library pack by including the ``library:true`` property.
@@ -49,7 +49,7 @@ For more information about the properties, see ":ref:`About CodeQL packs <about-
49
49
50
50
Adding and installing dependencies to a CodeQL pack
Copy file name to clipboardExpand all lines: docs/codeql/codeql-cli/publishing-and-using-codeql-packs.rst
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,14 @@ You can check and modify the configuration details of your CodeQL pack prior to
22
22
name: <scope>/<pack>
23
23
version: <x.x.x>
24
24
description: <Description to publish with the package>
25
-
default-suite: # a query-suite file that has been inlined
26
-
- query:
27
-
default-suite-file: default-queries.qls # a pointer to a query-suite in this pack
25
+
default-suite: # optional, one or more queries in the pack to run by default
26
+
- query: <relative-path>/query-file>.ql
27
+
default-suite-file: default-queries.qls # optional, a pointer to a query-suite in this pack
28
28
license: # optional, the license under which the pack is published
29
29
dependencies: # map from CodeQL pack name to version range
30
30
31
31
- ``name:`` must follow the <scope>/<pack> format, where <scope> is the GitHub organization that you will publish to and <pack> is the name for the pack.
32
-
- Only one of ``default-suite`` or ``default-suite-file`` is allowed. Both options define a default query suite to be run, the first by specifying queries directly in the `qlpack.yml` file and the second by specifying a query suite in the pack.
32
+
- A maximum of one of ``default-suite`` or ``default-suite-file`` is allowed. These are two different ways to define a default query suite to be run, the first by specifying queries directly in the `qlpack.yml` file and the second by specifying a query suite in the pack.
33
33
34
34
Running ``codeql pack publish``
35
35
-------------------------------
@@ -55,7 +55,7 @@ To run a pack that someone else has created, you must first download it by runni
55
55
- ``<pack>``: the name for the pack that you are creating.
56
56
- ``@x.x.x``: an optional version number. If omitted, the latest version will be downloaded.
57
57
58
-
This command accepts arguments for multiple packs, as well as query suites.
58
+
This command accepts arguments for multiple packs.
0 commit comments