From 7fc78678feee57e3a0180e6f379e7cf4c6f57412 Mon Sep 17 00:00:00 2001 From: Nick Keers <94363953+nicholas-keers@users.noreply.github.com> Date: Fri, 30 Jun 2023 11:35:13 +0100 Subject: [PATCH 1/2] Update testing-custom-queries.md (#26278) Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com> --- .../testing-custom-queries.md | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/content/code-security/codeql-cli/using-the-codeql-cli/testing-custom-queries.md b/content/code-security/codeql-cli/using-the-codeql-cli/testing-custom-queries.md index a7999e4d9b..de230bb87c 100644 --- a/content/code-security/codeql-cli/using-the-codeql-cli/testing-custom-queries.md +++ b/content/code-security/codeql-cli/using-the-codeql-cli/testing-custom-queries.md @@ -157,25 +157,23 @@ which is declared as a dependency for `my-query-tests`. Therefore, `EmptyThen.ql 1. Create a code snippet to test. The following Java code contains an empty `if` statement on the third line. Save it in `custom-queries/java/tests/EmptyThen/Test.java`. - ```java - -class Test { - public void problem(String arg) { - if (arg.isEmpty()) - ; - { - System.out.println("Empty argument"); + ```java + class Test { + public void problem(String arg) { + if (arg.isEmpty()) + ; + { + System.out.println("Empty argument"); + } + } + + public void good(String arg) { + if (arg.isEmpty()) { + System.out.println("Empty argument"); + } } } - - public void good(String arg) { - if (arg.isEmpty()) { - System.out.println("Empty argument"); - } - } -} - - ``` + ``` ### Execute the test From 8e324de14bc83f4606bdccf886fd61b1eabf35ba Mon Sep 17 00:00:00 2001 From: Y4er <45418382@qq.com> Date: Fri, 30 Jun 2023 18:47:48 +0800 Subject: [PATCH 2/2] fix codeql database api 404 error (#26300) --- .../using-the-codeql-cli/creating-codeql-databases.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/code-security/codeql-cli/using-the-codeql-cli/creating-codeql-databases.md b/content/code-security/codeql-cli/using-the-codeql-cli/creating-codeql-databases.md index 1d140e1913..c4358c2fe1 100644 --- a/content/code-security/codeql-cli/using-the-codeql-cli/creating-codeql-databases.md +++ b/content/code-security/codeql-cli/using-the-codeql-cli/creating-codeql-databases.md @@ -406,7 +406,7 @@ steps: You can check if a repository has any {% data variables.product.prodname_codeql %} databases available for download using the `/repos///code-scanning/codeql/databases` endpoint. For example, to check for {% data variables.product.prodname_codeql %} databases using the [{% data variables.product.prodname_cli %}](https://cli.github.com/manual/gh_api) you would run: ``` -gh api /repos///code-scanning/codeql/databases/ +gh api /repos///code-scanning/codeql/databases ``` This command returns information about any {% data variables.product.prodname_codeql %} databases that are available for a repository, including the language the database represents, and when the database was last updated. If no {% data variables.product.prodname_codeql %} databases are available, the response is empty.