QL: Autoformat test files#22232
Open
redsun82 wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b14eb21f-33ec-4f61-b650-823abc8940aa
Contributor
There was a problem hiding this comment.
Pull request overview
Autoformats seven QL test fixtures by moving trailing inline-expectation comments. However, the moved markers no longer share lines with their expected alerts.
Changes:
- Reformats
$ Alertcomments. - Adjusts spacing around affected declarations.
Show a summary per file
| File | Description |
|---|---|
UseInstanceofExtension/Foo.qll |
Reformats four alert markers. |
NonDocBlock/Foo.qll |
Reformats two alert markers. |
Misspelling/Test.qll |
Reformats class alert markers. |
DeadCode/Foo.qll |
Reformats a module alert marker. |
DataFlowConfigModuleNaming/Test.qll |
Reformats module alert markers. |
AcronymsShouldBeCamelCase/Test.qll |
Reformats a newtype alert marker. |
MissingNoInline/Test.qll |
Reformats a predicate alert marker. |
Review details
Comments suppressed due to low confidence (6)
ql/ql/test/queries/style/UseInstanceofExtension/Foo.qll:17
- This marker is on line 17, but the
Inst2alert is located on the declaration at line 16. Because QL inline expectations match the line comment location only to results on the same line, this marker no longer validates the alert.
// $ Alert
ql/ql/test/queries/style/UseInstanceofExtension/Foo.qll:24
- This marker is on line 24, while the
Inst3alert remains on declaration line 23. The QL inline-expectation postprocessor only matches comments and results on the same line, so this becomes an unmatched expectation.
// $ Alert
ql/ql/test/queries/style/UseInstanceofExtension/Foo.qll:33
- This marker is now one line below the
Inst4result location. QL inline expectations compare the line comment's own line with the alert line, so the postprocessor will report this expectation as missing and the declaration alert as unexpected.
// $ Alert
ql/ql/test/queries/style/NonDocBlock/Foo.qll:12
- Moving this marker to line 12 separates it from the reported block comment on line 11. Since the QL inline-expectation postprocessor only matches results on the marker's exact line, this expectation will fail.
// $ Alert
ql/ql/test/queries/style/Misspelling/Test.qll:21
- This marker is one line below the
AnalysedIntdeclaration that carries the alert location. Exact same-line matching in the QL inline-expectation postprocessor means the marker and result will not pair.
// $ Alert
ql/ql/test/queries/style/DataFlowConfigModuleNaming/Test.qll:20
- The
EmptyFlowresult is located on line 19 and this marker is on line 20. Exact same-line matching in the QL inline-expectation postprocessor leaves both the expectation and result unmatched.
// $ Alert
- Files reviewed: 7/7 changed files
- Comments generated: 7
- Review effort level: Medium
|
|
||
| class Inst extends string { // $ Alert | ||
| class Inst extends string { | ||
| // $ Alert |
| */ // $ Alert | ||
| */ | ||
|
|
||
| // $ Alert |
| */ // $ Alert | ||
| class PublicallyAccessible extends string { // $ Alert | ||
| class PublicallyAccessible extends string { | ||
| // $ Alert |
|
|
||
| private module Input2 implements InputSig { // $ Alert | ||
| private module Input2 implements InputSig { | ||
| // $ Alert |
| // BAD - does not end with "Config" | ||
| module EmptyConfiguration implements DataFlow::ConfigSig { // $ Alert | ||
| module EmptyConfiguration implements DataFlow::ConfigSig { | ||
| // $ Alert |
| // BAD | ||
| newtype TXMLElements = // $ Alert | ||
| newtype TXMLElements = | ||
| // $ Alert |
| */ | ||
| predicate missingNoInline(AddExpr add, Expr e1, Expr e2) { // $ Alert | ||
| predicate missingNoInline(AddExpr add, Expr e1, Expr e2) { | ||
| // $ Alert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This autoformats seven QL test files that were left unformatted by commit 4ad3a44 ("QL: Convert qlref tests to inline expectations").
The inline expectation comments introduced there were not run through formatter output, which causes the Check Autoformatting CI job in semmle-code to fail.