Skip to content

Commit 43e8a0f

Browse files
Apply suggestions from code review
Co-authored-by: Shati Patel <[email protected]>
1 parent 69ba22a commit 43e8a0f

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

docs/language/ql-handbook/language.rst

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ For a QL program to be *valid*, it must conform to a variety of conditions that
4545
Library path
4646
------------
4747

48-
The library path an ordered list of directory locations that is used
49-
in for resolving module imports, described below. It is not strictly
48+
The library path is an ordered list of directory locations. It is used
49+
for resolving module imports (see `Module resolution <#module-resolution>`__)). The library path is not strictly
5050
speaking a core part of the QL language, since different
5151
implementations of QL construct it in slightly different ways. Most QL
52-
tooling also allows specifying it explicitly on the command line for a
52+
tools also allow you to explicitly specify the library path on the command line for a
5353
particular invocation, though that is that is rarely done, and only
54-
useful in very special situation. This section describes the default
54+
useful in very special situations. This section describes the default
5555
construction of the library path.
5656

5757
First, determine the *query directory* of the ``.ql`` file being
@@ -63,56 +63,56 @@ directory, the directory of the ``.ql`` file itself is the query
6363
directory.
6464

6565
A ``queries.xml`` file that defines a query directory must always
66-
contain, containing a single top-level tag named
66+
contain a single top-level tag named
6767
``queries``, which has a ``language`` attribute set to the identifier
68-
of the active database scheme (for example, ``<queries
68+
of the active database schema (for example, ``<queries
6969
language="java"/>``).
7070

7171
A ``qlpack.yml`` file defines a `QL pack
72-
<https://help.semmle.com/codeql/codeql-cli/reference/qlpack-overview.html>`;
73-
its content is described in the CodeQL CLI documentation. This file
74-
will not be recognized when using older QL tooling that is not based
75-
on the CodeQL CLI (that is, LGTM.com, LGTM Enterprise, Odasa, QL for
76-
Eclipse, and QL for Visual Studio).
72+
<https://help.semmle.com/codeql/codeql-cli/reference/qlpack-overview.html>`__.
73+
The content of a ``qlpack.yml`` file is described in the CodeQL CLI documentation. This file
74+
will not be recognized when using legacy tools that are not based
75+
on the CodeQL CLI (that is, LGTM.com, LGTM Enterprise, ODASA, CodeQL for
76+
Eclipse, and CodeQL for Visual Studio).
7777

7878
If both a ``queries.xml`` and a ``qlpack.yml`` exist in the same
79-
directory the latter takes precedence (and the former is assumed to
79+
directory, the latter takes precedence (and the former is assumed to
8080
exist for compatibility with older tooling).
8181

8282
The query directory itself becomes the first element of the library
8383
path.
8484

85-
In old tooling that doesn't recognize ``qlpack.yml``, the default
86-
value of the rest of the library path is hard-coded in the tooling for
87-
each supporting language. It contains directories within the Odasa
85+
In legacy QL tools that don't recognize ``qlpack.yml`` files, the default
86+
value of the rest of the library path for
87+
each supported language is hard-coded. The tools contain directories within the ODASA
8888
distribution that define the default CodeQL libraries for the selected
89-
language. Which language to use depends on the ``language`` attibute
89+
language. Which language to use depends on the ``language`` attribute
9090
of the ``queries.xml`` file if not overridden with a ``--language``
91-
option to Odasa.
91+
option to the ODASA CLI.
9292

93-
On the other hand, the CodeQL CLI and newer tooling based on it (e.g.,
94-
GitHub Code Scanning and the Visual Stidio Code extension for CodeQL)
95-
constructs a default library path using QL packs. For each QL pack
96-
added to the language path, the QL packs named in its
93+
On the other hand, the CodeQL CLI and newer tools based on it (such as
94+
GitHub Code Scanning and the CodeQL extension for Visual Studio Code)
95+
construct a default library path using QL packs. For each QL pack
96+
added to the library path, the QL packs named in its
9797
``libraryPathDependencies`` will be subsequently added to the library
9898
path, and the process continues until all packs have been
9999
resolved. The actual library path consists of the root directories of
100100
the selected QL packs. This process depends on a mechanism for finding
101-
QL packs by pack name, as described in the CodeQL CLI documentation.
101+
QL packs by pack name, as described in the `CodeQL CLI documentation <https://help.semmle.com/codeql/codeql-cli.html>`__.
102102

103103
When the query directory contains a ``queries.xml`` file but no
104104
``qlpack.yml``, the QL pack resolution behaves as if it defines a QL
105-
pack with no name and a single library-path dependency named
105+
pack with no name and a single library path dependency named
106106
``legacy-libraries-LANGUAGE`` where ``LANGUAGE`` is taken from
107107
``queries.xml``. The ``github/codeql`` repository provides packs with
108108
names following this pattern, which themselves depend on the actual
109109
CodeQL libraries for each language.
110110

111-
When the query directory contains neither ``queries.xml`` nor
112-
``qlpack.yml`` it will be considered to be a QL pack with no name and
111+
When the query directory contains neither a ``queries.xml`` nor
112+
``qlpack.yml`` file, it is considered to be a QL pack with no name and
113113
no library dependencies. This causes the library path to consist of
114-
*only* the query directory itself, which is not generally useful --
115-
but will suffice to run toy examples of QL code that don't actually
114+
*only* the query directory itself. This is not generally useful,
115+
but it suffices for running toy examples of QL code that don't
116116
use information from the database.
117117

118118
Name resolution
@@ -237,7 +237,7 @@ For qualified identifiers (``a.b``):
237237

238238
- Build up a list of *candidate search paths*, consisting of the
239239
current file's directory, and each of the directories on the
240-
*library path* (in order).
240+
`library path <#library-path>`__ (in order).
241241

242242
- Determine the first candidate search path that has a *matching* QLL file for the import directive's qualified name. A QLL file in a candidate search path is said to match a qualified name if, starting from the candidate search path, there is a subdirectory for each successive qualifier in the qualified name, and the directory named by the final qualifier contains a file whose base name matches the qualified name's base name, with the addition of the file extension ``.qll``. The file and directory names are matched case-sensitively, regardless of whether the filesystem is case-sensitive or not.
243243

0 commit comments

Comments
 (0)