Fix for blank lines around code fences (#38255)
This commit is contained in:
@@ -231,6 +231,7 @@ If your workflow does not contain a matrix called `language`, then {% data varia
|
||||
with:
|
||||
languages: cpp, csharp, python
|
||||
```
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
## Analyzing Python dependencies
|
||||
|
||||
@@ -274,6 +275,7 @@ jobs:
|
||||
# to auto-install Python dependencies
|
||||
setup-python-dependencies: false
|
||||
```
|
||||
|
||||
{% endif %}
|
||||
|
||||
## Defining the alert severities that give a check failure for a pull request
|
||||
@@ -461,6 +463,7 @@ The settings in the configuration file are written in YAML format.
|
||||
You specify {% data variables.product.prodname_codeql %} query packs in an array. Note that the format is different from the format used by the workflow file.
|
||||
|
||||
{% raw %}
|
||||
|
||||
``` yaml copy
|
||||
packs:
|
||||
# Use the latest version of 'pack1' published by 'scope'
|
||||
@@ -476,6 +479,7 @@ packs:
|
||||
# Use pack6 and restrict it to the query suite 'path/to/suite.qls'
|
||||
- scope/pack6:path/to/suite.qls
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
||||
The full format for specifying a query pack is `scope/name[@version][:path]`. Both `version` and `path` are optional. `version` is semver version range. If it is missing, the latest version is used. For more information about semver ranges, see the [semver docs on npm](https://docs.npmjs.com/cli/v6/using-npm/semver#ranges).
|
||||
@@ -483,6 +487,7 @@ The full format for specifying a query pack is `scope/name[@version][:path]`. Bo
|
||||
If you have a workflow that generates more than one {% data variables.product.prodname_codeql %} database, you can specify any {% data variables.product.prodname_codeql %} query packs to run in a custom configuration file using a nested map of packs.
|
||||
|
||||
{% raw %}
|
||||
|
||||
``` yaml copy
|
||||
packs:
|
||||
# Use these packs for JavaScript and TypeScript analysis
|
||||
@@ -494,6 +499,7 @@ packs:
|
||||
- scope/java-pack1
|
||||
- scope/java-pack2@v1.0.0
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
{% endif %}
|
||||
|
||||
@@ -533,6 +539,7 @@ query-filters:
|
||||
- exclude:
|
||||
id: js/useless-assignment-to-local
|
||||
```
|
||||
|
||||
To find the id of a query, you can click the alert in the list of alerts in the **Security** tab. This opens the alert details page. The `Rule ID` field contains the query id. For more information about the alert details page, see "[AUTOTITLE](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-alerts#about-alert-details)."
|
||||
|
||||
{% tip %}
|
||||
|
||||
@@ -132,6 +132,7 @@ $
|
||||
|
||||
1. Create a {% data variables.product.prodname_codeql %} database (see above).
|
||||
2. Run `codeql database analyze` on the database and specify which {% ifversion codeql-packs %}packs and/or {% endif %}queries to use.
|
||||
|
||||
```shell
|
||||
codeql database analyze <database> --format=<format> \
|
||||
--output=<output> {% ifversion codeql-packs %}--download <packs,queries>{% else %}<queries>{% endif %}
|
||||
@@ -146,6 +147,7 @@ codeql database analyze <database> --format=<format> \
|
||||
--sarif-category=<language-specifier> --output=<output> \
|
||||
{% ifversion codeql-packs %}<packs,queries>{% else %}<queries>{% endif %}
|
||||
```
|
||||
|
||||
{% endnote %}
|
||||
|
||||
| Option | Required | Usage |
|
||||
|
||||
@@ -85,6 +85,7 @@ After you extract the {% data variables.product.prodname_codeql_cli %} bundle, y
|
||||
- `/<extraction-root>/codeql/codeql resolve qlpacks` otherwise.
|
||||
|
||||
**Extract from successful output:**
|
||||
|
||||
```
|
||||
codeql/cpp-all (/<extraction-root>/qlpacks/codeql/cpp-all/<version>)
|
||||
codeql/cpp-examples (/<extraction-root>/qlpacks/codeql/cpp-examples/<version>)
|
||||
|
||||
@@ -62,6 +62,7 @@ The ref name and commit SHA being checked out and analyzed in these examples are
|
||||
### Single non-compiled language (JavaScript)
|
||||
|
||||
Runner:
|
||||
|
||||
```bash
|
||||
echo "$TOKEN" | codeql-runner-linux init --repository my-org/example-repo \
|
||||
--languages javascript \
|
||||
@@ -71,7 +72,9 @@ echo "$TOKEN" | codeql-runner-linux analyze --repository my-org/example-repo
|
||||
--github-url https://github.com --github-auth-stdin
|
||||
--commit deb275d2d5fe9a522a0b7bd8b6b6a1c939552718 --ref refs/heads/main
|
||||
```
|
||||
|
||||
CLI:
|
||||
|
||||
```bash
|
||||
codeql database create /codeql-dbs/example-repo --language=javascript \
|
||||
--source-root=.
|
||||
@@ -91,6 +94,7 @@ echo "$TOKEN" | codeql github upload-results --repository=my-org/example-repo \
|
||||
A similar approach can be taken for compiled languages, or multiple languages.
|
||||
|
||||
Runner:
|
||||
|
||||
```bash
|
||||
echo "$TOKEN" | codeql-runner-linux init --repository my-org/example-repo \
|
||||
--languages javascript \
|
||||
@@ -101,7 +105,9 @@ echo "$TOKEN" | codeql-runner-linux analyze --repository my-org/example-repo \
|
||||
--github-url https://github.com --github-auth-stdin \
|
||||
--commit deb275d2d5fe9a522a0b7bd8b6b6a1c939552718 --ref refs/heads/main
|
||||
```
|
||||
|
||||
CLI:
|
||||
|
||||
```bash
|
||||
codeql database create /codeql-dbs/example-repo --language=javascript \
|
||||
--source-root=.
|
||||
@@ -121,6 +127,7 @@ echo "$TOKEN" | codeql github upload-results --repository=my-org/example-repo \
|
||||
A similar approach can be taken for compiled languages, or multiple languages.
|
||||
|
||||
Runner:
|
||||
|
||||
```bash
|
||||
echo "$TOKEN" | codeql-runner-linux init --repository my-org/example-repo \
|
||||
--languages javascript \
|
||||
@@ -131,7 +138,9 @@ echo "$TOKEN" | codeql-runner-linux analyze --repository my-org/example-repo \
|
||||
--github-url https://github.com --github-auth-stdin \
|
||||
--commit deb275d2d5fe9a522a0b7bd8b6b6a1c939552718 --ref refs/heads/main
|
||||
```
|
||||
|
||||
CLI:
|
||||
|
||||
```bash
|
||||
# Use `--codescanning-config` with the path to the YAML configuration file.
|
||||
codeql database create /codeql-dbs/example-repo --language=javascript \
|
||||
@@ -150,6 +159,7 @@ echo "$TOKEN" | codeql github upload-results --repository=my-org/example-repo \
|
||||
### Single compiled language using autobuild (Java)
|
||||
|
||||
Runner:
|
||||
|
||||
```bash
|
||||
echo "$TOKEN" | codeql-runner-linux init --repository my-org/example-repo \
|
||||
--languages java \
|
||||
@@ -165,7 +175,9 @@ echo "$TOKEN" | codeql-runner-linux analyze --repository my-org/example-repo
|
||||
--github-url https://github.com --github-auth-stdin
|
||||
--commit deb275d2d5fe9a522a0b7bd8b6b6a1c939552718 --ref refs/heads/main
|
||||
```
|
||||
|
||||
CLI:
|
||||
|
||||
```bash
|
||||
# Run `codeql database create` without `--command`.
|
||||
# This will run the autobuilder for the given language.
|
||||
@@ -184,6 +196,7 @@ echo "$TOKEN" | codeql github upload-results --repository=my-org/example-repo \
|
||||
### Single compiled language using a custom build command (Java)
|
||||
|
||||
Runner:
|
||||
|
||||
```bash
|
||||
echo "$TOKEN" | codeql-runner-linux init --repository my-org/example-repo \
|
||||
--languages java \
|
||||
@@ -199,7 +212,9 @@ echo "$TOKEN" | codeql-runner-linux analyze --repository my-org/example-repo
|
||||
--github-url https://github.com --github-auth-stdin
|
||||
--commit deb275d2d5fe9a522a0b7bd8b6b6a1c939552718 --ref refs/heads/main
|
||||
```
|
||||
|
||||
CLI:
|
||||
|
||||
```bash
|
||||
# Provide an explicit build command using `--command`.
|
||||
codeql database create /codeql-dbs/example-repo --language=java \
|
||||
@@ -219,6 +234,7 @@ echo "$TOKEN" | codeql github upload-results --repository=my-org/example-repo \
|
||||
Indirect build tracing for a compiled language enables {% data variables.product.prodname_codeql %} to detect all build steps between the `init` and `analyze` steps, when the code cannot be built using the autobuilder or an explicit build command line. This is useful when using preconfigured build steps from your CI system, such as the `VSBuild` and `MSBuild` tasks in Azure DevOps.
|
||||
|
||||
Runner:
|
||||
|
||||
```yaml
|
||||
- task: CmdLine@1
|
||||
displayName: CodeQL Initialization
|
||||
@@ -257,6 +273,7 @@ Runner:
|
||||
```
|
||||
|
||||
CLI:
|
||||
|
||||
```yaml
|
||||
# Run any pre-build tasks, for example, restore NuGet dependencies...
|
||||
|
||||
@@ -342,6 +359,7 @@ This example is not strictly possible with the {% data variables.code-scanning.c
|
||||
Only one language (the compiled language with the most files) will be analyzed.
|
||||
|
||||
Runner:
|
||||
|
||||
```bash
|
||||
echo "$TOKEN" | codeql-runner-linux init --repository my-org/example-repo \
|
||||
--languages cpp,python \
|
||||
@@ -359,6 +377,7 @@ echo "$TOKEN" | codeql-runner-linux analyze --repository my-org/example-repo
|
||||
```
|
||||
|
||||
CLI:
|
||||
|
||||
```bash
|
||||
# Create multiple databases using `--db-cluster`.
|
||||
# Run autobuild by omitting `--command`.
|
||||
@@ -382,6 +401,7 @@ done
|
||||
### Multiple languages using a custom build command (C++, Python)
|
||||
|
||||
Runner:
|
||||
|
||||
```bash
|
||||
echo "$TOKEN" | codeql-runner-linux init --repository my-org/example-repo \
|
||||
--languages cpp,python \
|
||||
@@ -399,6 +419,7 @@ echo "$TOKEN" | codeql-runner-linux analyze --repository my-org/example-repo
|
||||
```
|
||||
|
||||
CLI:
|
||||
|
||||
```bash
|
||||
# Create multiple databases using `--db-cluster`.
|
||||
codeql database create /codeql-dbs/example-repo-multi \
|
||||
|
||||
Reference in New Issue
Block a user