Skip to content
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

Bump github/codeql-action from 2 to 3 #89

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ql-for-ql-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fetch-depth: 0
- name: Find codeql
id: find-codeql
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: javascript # does not matter
- uses: ./.github/actions/os-version
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
exclude:*/ql/lib/upgrades/
exclude:java/ql/integration-tests
- name: Upload sarif to code-scanning
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ql-for-ql.sarif
category: ql-for-ql
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ql-for-ql-dataset_measure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- name: Find codeql
id: find-codeql
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: javascript # does not matter
- uses: ./.github/actions/os-version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ql-for-ql-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v4
- name: Find codeql
id: find-codeql
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: javascript # does not matter
- uses: ./.github/actions/os-version
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
- name: Find codeql
id: find-codeql
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: javascript # does not matter
- uses: ./.github/actions/os-version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,9 @@ private void StubParameters(ICollection<IParameterSymbol> parameters)
case RefKind.In:
stubWriter.Write("in ");
break;
case RefKind.RefReadOnlyParameter:
stubWriter.Write("ref readonly ");
break;
default:
stubWriter.Write($"/* TODO: {parameter.RefKind} */");
break;
Expand Down Expand Up @@ -884,4 +887,4 @@ public override void VisitProperty(IPropertySymbol symbol)
if (explicitInterfaceImplementations.Length == 0)
StubProperty(symbol, null);
}
}
}
22 changes: 21 additions & 1 deletion csharp/extractor/Semmle.Extraction.Tests/StubGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void StubGeneratorMethodTest()
// Setup
const string source = @"
public class MyTest {
public int M1(string arg1) { return 0;}
public int M1(string arg1) { return 0; }
}";

// Execute
Expand All @@ -56,6 +56,26 @@ public class MyTest {
Assert.Equal(expected, stub);
}

[Fact]
public void StubGeneratorRefReadonlyParameterTest()
{
// Setup
const string source = @"
public class MyTest {
public int M1(ref readonly Guid guid) { return 0; }
}";

// Execute
var stub = GenerateStub(source);

// Verify
const string expected = @"public class MyTest {
public int M1(ref readonly Guid guid) => throw null;
}
";
Assert.Equal(expected, stub);
}

private static string GenerateStub(string source)
{
var st = CSharpSyntaxTree.ParseText(source);
Expand Down
Loading