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/creating-codeql-databases.rst
+26-30Lines changed: 26 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,8 @@ Before you analyze your code using CodeQL, you need to create a CodeQL
7
7
database containing all the data required to run queries on your code.
8
8
9
9
CodeQL analysis relies on extracting relational data from your code, and
10
-
using it to build a :ref:`CodeQL database <codeql-database>`. CodeQL
11
-
databases contain all of the important information about a codebase, which can
10
+
using it to build a :ref:`CodeQL database <codeql-database>`. CodeQL
11
+
databases contain all of the important information about a codebase, which can
12
12
be analyzed by executing CodeQL queries against it.
13
13
Before you generate a CodeQL database, you need to:
14
14
@@ -18,9 +18,9 @@ Before you generate a CodeQL database, you need to:
18
18
should be ready to build, with all dependencies already installed.
19
19
20
20
For information about using the CodeQL CLI in a third-party CI system to create results
21
-
to display in GitHub as code scanning alerts, see `Configuring CodeQL CLI in your CI system <https://docs.github.com/en/code-security/secure-coding/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-cli-in-your-ci-system>`__
21
+
to display in GitHub as code scanning alerts, see `Configuring CodeQL CLI in your CI system <https://docs.github.com/en/code-security/secure-coding/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-cli-in-your-ci-system>`__
22
22
in the GitHub documentation. For information about enabling CodeQL code scanning using GitHub Actions,
23
-
see `Setting up code scanning for a repository <https://docs.github.com/en/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository>`__
23
+
see `Setting up code scanning for a repository <https://docs.github.com/en/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository>`__
24
24
in the GitHub documentation.
25
25
26
26
Running ``codeql database create``
@@ -37,38 +37,38 @@ You must specify:
37
37
38
38
- ``<database>``: a path to the new database to be created. This directory will
39
39
be created when you execute the command---you cannot specify an existing
40
-
directory.
40
+
directory.
41
41
- ``--language``: the identifier for the language to create a database for.
42
-
When used with ``--db-cluster``, the option accepts a comma-separated list,
42
+
When used with ``--db-cluster``, the option accepts a comma-separated list,
43
43
or can be specified more than once.
44
44
CodeQL supports creating databases for the following languages:
45
45
46
46
.. include:: ../reusables/extractors.rst
47
47
48
-
You can specify additional options depending on the location of your source file,
49
-
if the code needs to be compiled, and if you want to create CodeQL databases for
48
+
You can specify additional options depending on the location of your source file,
49
+
if the code needs to be compiled, and if you want to create CodeQL databases for
50
50
more than one language:
51
51
52
52
- ``--source-root``: the root folder for the primary source files used in
53
53
database creation. By default, the command assumes that the current
54
54
directory is the source root---use this option to specify a different location.
55
55
- ``--db-cluster``: use for multi-language codebases when you want to create
56
-
databases for more than one language.
56
+
databases for more than one language.
57
57
- ``--command``: used when you create a database for one or more compiled languages,
58
-
omit if the only languages requested are Python and JavaScript.
59
-
This specifies the build commands needed to invoke the compiler.
58
+
omit if the only languages requested are Python and JavaScript.
59
+
This specifies the build commands needed to invoke the compiler.
60
60
Commands are run from the current folder, or ``--source-root``
61
61
if specified. If you don't include a ``--command``, CodeQL will attempt to
62
-
detect the build system automatically, using a built-in autobuilder.
63
-
- ``--no-run-unnecessary-builds``: used with ``--db-cluster`` to suppress the build
64
-
command for languages where the CodeQL CLI does not need to monitor the build
62
+
detect the build system automatically, using a built-in autobuilder.
63
+
- ``--no-run-unnecessary-builds``: used with ``--db-cluster`` to suppress the build
64
+
command for languages where the CodeQL CLI does not need to monitor the build
65
65
(for example, Python and JavaScript/TypeScript).
66
66
67
67
You can specify extractor options to customize the behavior of extractors that create CodeQL databases. For more information, see
68
68
":doc:`Extractor options <extractor-options>`."
69
69
70
70
For full details of all the options you can use when creating databases,
71
-
see the `database create reference documentation <../manual/database-create>`__.
71
+
see the `database create reference documentation <../manual/database-create>`__.
72
72
73
73
Progress and results
74
74
--------------------
@@ -117,7 +117,7 @@ extract both JavaScript and TypeScript files::
117
117
118
118
Here, we have specified a ``--source-root`` path, which is the location where
119
119
database creation is executed, but is not necessarily the checkout root of the
120
-
codebase.
120
+
codebase.
121
121
122
122
By default, files in ``node_modules`` and ``bower_components`` directories are not extracted.
123
123
@@ -127,7 +127,7 @@ Python
127
127
When creating databases for Python you must ensure:
128
128
129
129
- You have the all of the required versions of Python installed.
130
-
- You have access to the `pip <https://pypi.org/project/pip/>`__
130
+
- You have access to the `pip <https://pypi.org/project/pip/>`__
131
131
packaging management system and can install any
132
132
packages that the codebase depends on.
133
133
- You have installed the `virtualenv <https://pypi.org/project/virtualenv/>`__ pip module.
@@ -143,14 +143,14 @@ generating a new Python database at ``<output-folder>/python-database``.
143
143
Ruby
144
144
~~~~
145
145
146
-
Creating databases for Ruby requires no additional dependencies.
146
+
Creating databases for Ruby requires no additional dependencies.
147
147
In the command line you must specify ``--language=ruby``. For example::
0 commit comments