Skip to content

Commit 9e56128

Browse files
apply suggestions from doc review
Co-authored-by: hubwriter <[email protected]>
1 parent 8b3ba38 commit 9e56128

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

docs/query-metadata-style-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ The select clause of each alert query defines the alert message that is displaye
182182
* If a reference to the current location can't be avoided use "this location" instead of "here". For example, `Bad thing at this location.` is preferable to `Bad thing here.`. This avoids the "click here" anti-pattern.
183183
* Where you reference another program element, link to it if possible using a substitution (`$@`). Links should be used inline in the sentence, rather than as parenthesised lists or appositions.
184184
* When a message contains multiple links, construct a sentence that has the most variable link (that is, the link with most targets) last. For further information, see [Defining the results of a query](https://codeql.github.com/docs/writing-codeql-queries/defining-the-results-of-a-query/).
185-
* Make link texts as concise and precise as possible. E.g. avoid starting a link text with an indefinite article (a, an). For example `Path construction depends on a [user-provided value]` is preferable to `Path construction depends on [a user-provided value]`. (Where the square brackets indicate a link.) See [the W3C guide on link texts](https://www.w3.org/WAI/WCAG22/Understanding/link-purpose-in-context.html) for further information.
185+
* Make link text as concise and precise as possible. For example, avoid starting a link text with an indefinite article (a, an). `Path construction depends on a [user-provided value]` is preferable to `Path construction depends on [a user-provided value]`. (Where the square brackets indicate a link.) See [the W3C guide on link texts](https://www.w3.org/WAI/WCAG22/Understanding/link-purpose-in-context.html) for further information.
186186
* For path queries, if possible, try to follow the template: `This path depends on a [user-provided value].`, or alternatively (if the first option doesn't work) `[User-provided value] flows to this location and is used in a path.`.
187-
* Taint tracking queries generally have that a sink "depends on" the source, and dataflow queries generally have a source that "flows to" the sink.
187+
* Taint tracking queries generally have a sink that "depends on" the source, and dataflow queries generally have a source that "flows to" the sink.
188188

189189

190190
For examples of select clauses and alert messages, see the query source files at the following pages:

ql/ql/src/queries/style/AlertMessage.ql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ private AstNode getSelectPart(Select sel, int index) {
4040
}
4141

4242
/**
43-
* Gets a string element that is the last part of the message, that doesn't end with a full stop.
43+
* Gets a string element that is the last part of the message, that doesn't end with a period.
4444
*
45-
* E.g.
45+
* For example:
4646
* ```CodeQL
4747
* select foo(), "This is a description" // <- bad
4848
*
@@ -63,7 +63,7 @@ String shouldHaveFullStop(Select sel) {
6363
/**
6464
* Gets a string element that is the first part of the message, that starts with a lower case letter.
6565
*
66-
* E.g.
66+
* For example:
6767
* ```CodeQL
6868
* select foo(), "this is a description." // <- bad
6969
*
@@ -83,7 +83,7 @@ String shouldStartCapital(Select sel) {
8383
/**
8484
* Gets a string element that is used in a message that contains "here" or "this location".
8585
*
86-
* E.g.
86+
* For example:
8787
* ```CodeQL
8888
* select foo(), "XSS happens here from using a unsafe value." // <- bad
8989
*
@@ -101,7 +101,7 @@ String avoidHere(string part) {
101101
/**
102102
* Avoid using an indefinite article ("a" or "an") in a link text.
103103
*
104-
* E.g.
104+
* For example:
105105
* ```CodeQL
106106
* select foo(), "XSS from $@", val, "an unsafe value." // <- bad
107107
*
@@ -119,7 +119,7 @@ String avoidArticleInLinkText(Select sel) {
119119
/**
120120
* Don't quote substitutions in a message.
121121
*
122-
* E.g.
122+
* For example:
123123
* ```CodeQL
124124
* select foo(), "XSS from '$@'", val, "an unsafe value." // <- bad
125125
*

0 commit comments

Comments
 (0)