New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LGTM deprecation: Update basic queries to use VS Code #11423
base: main
Are you sure you want to change the base?
Conversation
| Learn to write and run a simple CodeQL query using LGTM. | ||
| Learn to write and run a simple CodeQL query using Visual Studio Code with the CodeQL extension. | ||
|
|
||
| .. include:: ../reusables/setup-to-run-queries.rst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added this placeholder here so that it's easy to update this as we steadily make it easier to get started with running CodeQL queries.
|
|
||
| .. pull-quote:: | ||
| #. Copy the URL for the repository into the field and press the keyboard **Enter** key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that's quite helpful
| #. In Visual Studio Code, create a new folder to store your experimental queries for C and C++ CodeQL databases. For example, ``cpp-experiments``. | ||
|
|
||
| #. Click **Run**. | ||
| #. Create a ``qlpack.yml`` file in your experiments folder with the contents shown below. This tells the CodeQL extension that any queries you create in the folder are intended to run on C or C++ CodeQL databases. | ||
|
|
||
| The name of the project you are querying, and the ID of the most recently analyzed commit to the project, are listed below the query box. To the right of this is an icon that indicates the progress of the query operation: | ||
| .. code-block:: yaml | ||
| .. image:: ../images/query-progress.png | ||
| :align: center | ||
| name: github-owner/cpp-experiments | ||
| version: 0.0.1 | ||
| dependencies: | ||
| codeql/cpp-all: ^0.1.2 | ||
| .. pull-quote:: | ||
| #. Create a second new file in your experiements folder with the ``.ql`` file extension. You will write your first query in this file. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For simplicity, we could point users to the quick query command here: https://codeql.github.com/docs/codeql-for-visual-studio-code/analyzing-your-projects/#running-a-quick-query
It would save folks having to create a new qlpack.yml file. However, they would have to copy the contents of the synthetic CodeQL pack to somewhere permanent if they wanted to retain their test queries, but that could be an optional extra step at the end of this procedure (and we could simply link to the docs).
|
|
||
| .. pull-quote:: | ||
| #. Copy the URL for the repository into the field and press the keyboard **Enter** key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that's quite helpful
This pull request updates the basic query introduction article for Python to use VS Code. I've raised this for discussion. Once we've agreed the updates, I'll apply them to the other basic query introductions.