-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Convert remaining {go,swift,ruby}-code-scanning.qls
query tests to .qlref
#19817
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
Conversation
{go,swift,ruby,java}-code-scanning.qls
query tests to .qlref
{go,swift,ruby,java}-code-scanning.qls
query tests to .qlref
{go,swift,ruby}-code-scanning.qls
query tests to .qlref
4a12777
to
2aaa656
Compare
2aaa656
to
c628653
Compare
c628653
to
657e782
Compare
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.
Swift changes LGTM. 👍
TestRemoteSource() { this.asExpr().(ApplyExpr).getStaticTarget().getName().matches("source%") } | ||
|
||
override string getSourceType() { result = "Test source" } | ||
} |
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.
This test source isn't supported in the new approach but ... doesn't appear to make any difference. All the test cases use String(contentsOf: ...)
as their sources anyway.
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.
Go 👍🏻
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.
Thanks a lot for doing this.
@@ -2,7 +2,7 @@ | |||
|
|||
def foo | |||
def download_tools(installer) | |||
Excon.get(installer[:url]) # $ MISSING: BAD= (requires hash flow) | |||
Excon.get(installer[:url]) # $ MISSING: $Alert (requires hash flow) |
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.
The $
in front of Alert
should be removed.
cmd = params[:cmd] | ||
`#{cmd}` | ||
system(cmd) | ||
cmd = params[:cmd] # $Source |
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.
Nit: We typically have a space after the $
marker.
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.
Oh yeah, I missed that when reviewing Go.
657e782
to
35a48e7
Compare
Rebased with the suggestions applied (including adding a space in |
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.
Swift still LGTM.
Converts the remaining
{go,swift,ruby}-code-scanning.qls
query tests to.qlref
.Example prior work: #18848
In the Go IncorrectIntegerConversion case, the
#select
,edges
, andnodes
query predicates have different results depending on whether the Go source is compiled under 64-bit or 32-bit mode. So I have filtered out those predicates using a custom test post-processor.Also, in the Ruby case I've made the
utils/test/PrettyPrintModels.ql
test postprocessor available; Swift apparently doesn't support the Models-as-Data extensible predicates, so I couldn't fit its existing MaD support into thecodeql.dataflow.test.ProvenancePathGraph::TestPostProcessing::TranslateProvenanceResults<>
interface.Anecdotally, the Copilot "Next Edit Suggestion" feature had some marginal benefit for this PR.