Skip to content

Commit 7853ea6

Browse files
authored
Merge pull request github#9243 from github/adityasharad/merge-codeql-go-docs
Docs: Update references to github/codeql-go
2 parents aa01cf1 + 42f2fc2 commit 7853ea6

File tree

14 files changed

+33
-47
lines changed

14 files changed

+33
-47
lines changed

.github/workflows/query-list.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ jobs:
2020
uses: actions/checkout@v3
2121
with:
2222
path: codeql
23-
- name: Clone github/codeql-go
24-
uses: actions/checkout@v3
25-
with:
26-
repository: 'github/codeql-go'
27-
path: codeql-go
2823
- name: Set up Python 3.8
2924
uses: actions/setup-python@v3
3025
with:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CodeQL
22

3-
This open source repository contains the standard CodeQL libraries and queries that power [GitHub Advanced Security](https://github.com/features/security/code) and the other application security products that [GitHub](https://github.com/features/security/) makes available to its customers worldwide. For the queries, libraries, and extractor that power Go analysis, visit the [CodeQL for Go repository](https://github.com/github/codeql-go).
3+
This open source repository contains the standard CodeQL libraries and queries that power [GitHub Advanced Security](https://github.com/features/security/code) and the other application security products that [GitHub](https://github.com/features/security/) makes available to its customers worldwide.
44

55
## How do I learn CodeQL and run queries?
66

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ About QL packs
66
QL packs are used to organize the files used in CodeQL analysis. They
77
contain queries, library files, query suites, and important metadata.
88

9-
The `CodeQL repository <https://github.com/github/codeql>`__ contains QL packs for
10-
C/C++, C#, Java, JavaScript, Python, and Ruby. The `CodeQL for Go
11-
<https://github.com/github/codeql-go/>`__ repository contains a QL pack for Go
12-
analysis. You can also make custom QL packs to contain your own queries and
13-
libraries.
9+
The `CodeQL repository <https://github.com/github/codeql>`__ contains standard QL packs for all supported languages.
10+
You can also make custom QL packs to contain your own queries and libraries.
1411

1512
QL pack structure
1613
-----------------

docs/codeql/codeql-cli/getting-started-with-the-codeql-cli.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,7 @@ further options on the command line.
193193
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
194194

195195
The `CodeQL repository <https://github.com/github/codeql>`__ contains
196-
the queries and libraries required for CodeQL analysis of C/C++, C#, Java,
197-
JavaScript/TypeScript, Python, and Ruby.
196+
the queries and libraries required for CodeQL analysis of all supported languages.
198197
Clone a copy of this repository into ``codeql-home``.
199198

200199
By default, the root of the cloned repository will be called ``codeql``.
@@ -203,17 +202,18 @@ CLI that you will extract in step 4. If you use git on the command line, you can
203202
clone and rename the repository in a single step by running
204203
``git clone [email protected]:github/codeql.git codeql-repo`` in the ``codeql-home`` folder.
205204

206-
The CodeQL libraries and queries for Go analysis live in the `CodeQL for Go
207-
repository <https://github.com/github/codeql-go/>`__. Clone a copy of this
208-
repository into ``codeql-home``, and run ``codeql-go/scripts/install-deps.sh``
209-
to install its dependencies.
205+
For Go analysis, run ``codeql-repo/go/scripts/install-deps.sh`` to install its dependencies.
210206

211-
The cloned repositories should have a sibling relationship.
212-
For example, if the root of the cloned CodeQL repository is
213-
``$HOME/codeql-home/codeql-repo``, then the root of the cloned CodeQL for Go
214-
repository should be ``$HOME/codeql-home/codeql-go``.
207+
.. pull-quote:: Note
208+
209+
The CodeQL libraries and queries for Go analysis used to live in a
210+
separate `CodeQL for Go repository <https://github.com/github/codeql-go/>`__.
211+
These have been moved to the ``github/codeql`` repository.
212+
It is no longer necessary to clone the ``github/codeql-go`` into a separate ``codeql-home/codeql-go`` folder.
213+
214+
For more information, see the `Relocation announcement <https://github.com/github/codeql-go/issues/741>`__.
215215

216-
Within these repositories, the queries and libraries are organized into QL
216+
Within this repository, the queries and libraries are organized into QL
217217
packs. Along with the queries themselves, QL packs contain important metadata
218218
that tells the CodeQL CLI how to process the query files. For more information,
219219
see ":doc:`About QL packs <about-ql-packs>`."

docs/codeql/codeql-for-visual-studio-code/exploring-the-structure-of-your-source-code.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Viewing the abstract syntax tree of a source file
2828

2929
.. pull-quote:: Note
3030

31-
If you don't have an appropriate ``printAST.ql`` query in your workspace, the **CodeQL: View AST** command won't work. To fix this, you can update your copy of the `CodeQL <https://github.com/github/codeql>`__ repository (or `CodeQL for Go <https://github.com/github/codeql-go>`__ repository) from ``main``. If you do this, you may need to upgrade your databases. Also, query caches may be discarded and your next query runs could be slower.
31+
If you don't have an appropriate ``printAST.ql`` query in your workspace, the **CodeQL: View AST** command won't work. To fix this, you can update your copy of the `CodeQL <https://github.com/github/codeql>`__ repository from ``main``. If you do this, you may need to upgrade your databases. Also, query caches may be discarded and your next query runs could be slower.
3232

3333
3. Once the query has run, the AST viewer displays the structure of the source file.
3434
4. To see the nested structure, click the arrows and expand the nodes.

docs/codeql/codeql-for-visual-studio-code/setting-up-codeql-in-visual-studio-code.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,15 @@ There are two ways to do this:
6969
This ensures that the queries and libraries you write in VS Code also work in the query console on LGTM Enterprise.
7070

7171
If you prefer to add the CodeQL queries and libraries to an :ref:`existing workspace <existing-workspace>` instead of the starter workspace, then you should
72-
clone the appropriate branch of the `general CodeQL repository <https://github.com/github/codeql>`__ and the
73-
`CodeQL repository for Go <https://github.com/github/codeql-go>`__ and add them to your workspace.
72+
clone the appropriate branch of the `CodeQL repository <https://github.com/github/codeql>`__ and add it to your workspace.
7473

7574
.. _starter-workspace:
7675

7776
Using the starter workspace
7877
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7978
The starter workspace is a Git repository. It contains:
8079

81-
* The `repository of CodeQL libraries and queries <https://github.com/github/codeql>`__ for C/C++, C#, Java, JavaScript, Python, and Ruby. This is included as a submodule, so it can be updated without affecting your custom queries.
82-
* The `repository of CodeQL libraries and queries <https://github.com/github/codeql-go>`__ for Go. This is also included as a submodule.
80+
* The `repository of CodeQL libraries and queries <https://github.com/github/codeql>`__ all supported languages. This is included as a submodule, so it can be updated without affecting your custom queries.
8381
* A series of folders named ``codeql-custom-queries-<language>``. These are ready for you to start developing your own custom queries for each language, using the standard libraries. There are some example queries to get you started.
8482

8583
To use the starter workspace:
@@ -114,10 +112,6 @@ For example, to make a custom CodeQL folder called ``my-custom-cpp-pack`` depend
114112
115113
For more information about why you need to add a ``qlpack.yml`` file, see ":ref:`About QL packs <about-ql-packs>`."
116114

117-
.. pull-quote:: Note
118-
119-
The CodeQL libraries for Go are not included in the ``github/codeql`` repository, but are stored separately. To analyze Go projects, clone the repository at https://github.com/github/codeql-go and add it to your workspace as above.
120-
121115
Further reading
122116
----------------
123117

docs/codeql/codeql-language-guides/modeling-data-flow-in-go-libraries.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ When analyzing a Go program, CodeQL does not examine the source code for
77
external packages. To track the flow of untrusted data through a library, you
88
can create a model of the library.
99

10-
You can find existing models in the ``ql/lib/semmle/go/frameworks/`` folder of the
11-
`CodeQL for Go repository <https://github.com/github/codeql-go/tree/main/ql/lib/semmle/go/frameworks>`__.
10+
You can find existing models in the ``go/ql/lib/semmle/go/frameworks/`` folder of the
11+
`CodeQL repository <https://github.com/github/codeql/tree/main/go/ql/lib/semmle/go/frameworks>`__.
1212
To add a new model, you should make a new file in that folder, named after the library.
1313

1414
Sources
@@ -102,8 +102,8 @@ Data-flow sinks are specified by queries rather than by library models.
102102
However, you can use library models to indicate when functions belong to
103103
special categories. Queries can then use these categories when specifying
104104
sinks. Classes representing these special categories are contained in
105-
``ql/lib/semmle/go/Concepts.qll`` in the `CodeQL for Go repository
106-
<https://github.com/github/codeql-go/blob/main/ql/lib/semmle/go/Concepts.qll>`__.
105+
``go/ql/lib/semmle/go/Concepts.qll`` in the `CodeQL repository
106+
<https://github.com/github/codeql/blob/main/go/ql/lib/semmle/go/Concepts.qll>`__.
107107
``Concepts.qll`` includes classes for logger mechanisms,
108108
HTTP response writers, HTTP redirects, and marshaling and unmarshaling
109109
functions.

docs/codeql/query-help/go.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ CodeQL query help for Go
33

44
.. include:: ../reusables/query-help-overview.rst
55

6-
For shorter queries that you can use as building blocks when writing your own queries, see the `example queries in the CodeQL for Go repository <https://github.com/github/codeql-go/tree/main/ql/examples>`__.
6+
For shorter queries that you can use as building blocks when writing your own queries, see the `example queries in the CodeQL repository <https://github.com/github/codeql/tree/main/go/ql/examples>`__.
77

88
.. include:: toc-go.rst
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
- `CodeQL queries for Go <https://github.com/github/codeql-go/tree/main/ql/src>`__
2-
- `Example queries for Go <https://github.com/github/codeql-go/tree/main/ql/examples>`__
1+
- `CodeQL queries for Go <https://github.com/github/codeql/tree/main/go/ql/src>`__
2+
- `Example queries for Go <https://github.com/github/codeql/tree/main/go/ql/examples>`__
33
- `CodeQL library reference for Go <https://codeql.github.com/codeql-standard-libraries/go/>`__

docs/codeql/writing-codeql-queries/about-codeql-queries.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Select clauses for diagnostic queries (``@kind diagnostic``) and summary metric
121121
Viewing the standard CodeQL queries
122122
***********************************
123123

124-
One of the easiest ways to get started writing your own queries is to modify an existing query. To view the standard CodeQL queries, or to try out other examples, visit the `CodeQL <https://github.com/github/codeql>`__ and `CodeQL for Go <https://github.com/github/codeql-go>`__ repositories on GitHub.
124+
One of the easiest ways to get started writing your own queries is to modify an existing query. To view the standard CodeQL queries, or to try out other examples, visit the `CodeQL <https://github.com/github/codeql>`__ repository on GitHub.
125125

126126
You can also find examples of queries developed to find security vulnerabilities and bugs in open source software projects on the `GitHub Security Lab website <https://securitylab.github.com/research>`__ and in the associated `repository <https://github.com/github/securitylab>`__.
127127

0 commit comments

Comments
 (0)