Skip to content

Commit 9afbd5b

Browse files
authored
Merge pull request github#3565 from shati-patel/53-style-guides
Docs: Update markdown files with 1.24 title changes
2 parents bdecda2 + c12fd6f commit 9afbd5b

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
We welcome contributions to our CodeQL libraries and queries. Got an idea for a new check, or how to improve an existing query? Then please go ahead and open a pull request! Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE).
44

5-
There is lots of useful documentation to help you write queries, ranging from information about query file structure to tutorials for specific target languages. For more information on the documentation available, see [Writing CodeQL queries](https://help.semmle.com/QL/learn-ql/writing-queries/writing-queries.html) on [help.semmle.com](https://help.semmle.com).
5+
There is lots of useful documentation to help you write queries, ranging from information about query file structure to tutorials for specific target languages. For more information on the documentation available, see [CodeQL queries](https://help.semmle.com/QL/learn-ql/writing-queries/writing-queries.html) on [help.semmle.com](https://help.semmle.com).
66

77

88
## Submitting a new experimental query
@@ -32,7 +32,7 @@ If you have an idea for a query that you would like to share with other CodeQL u
3232

3333
For details, see the [guide on query metadata](docs/query-metadata-style-guide.md).
3434

35-
Make sure the `select` statement is compatible with the query `@kind`. See [Introduction to query files](https://help.semmle.com/QL/learn-ql/writing-queries/introduction-to-queries.html#select-clause) on help.semmle.com.
35+
Make sure the `select` statement is compatible with the query `@kind`. See [About CodeQL queries](https://help.semmle.com/QL/learn-ql/writing-queries/introduction-to-queries.html#select-clause) on help.semmle.com.
3636

3737
3. **Formatting**
3838

docs/ql-style-guide.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ class Type extends ... {
216216

217217
General requirements:
218218

219-
1. Documentation *must* adhere to the [QLDoc specification](https://help.semmle.com/QL/QLDocSpecification.html).
219+
1. Documentation *must* adhere to the [QLDoc specification](https://help.semmle.com/QL/ql-handbook/qldoc.html).
220220
1. Use `/** ... */` for documentation, even for single line comments.
221221
1. For single-line documentation, the `/**` and `*/` are written on the same line as the comment.
222222
1. For multi-line documentation, the `/**` and `*/` are written on separate lines. There is a `*` preceding each comment line, aligned on the first `*`.
@@ -417,16 +417,16 @@ deprecated Expr getInitializer()
417417

418418
| Phrase | Meaning |
419419
|-------------|----------|
420-
| *[annotation](https://help.semmle.com/QL/QLLanguageSpecification.html#annotations)* | An additional specifier used to modify a declaration, such as `private`, `override`, `deprecated`, `pragma`, `bindingset`, or `cached`. |
420+
| *[annotation](https://help.semmle.com/QL/ql-handbook/language.html#annotations)* | An additional specifier used to modify a declaration, such as `private`, `override`, `deprecated`, `pragma`, `bindingset`, or `cached`. |
421421
| *body* | The text inside `{ }`, `( )`, or each section of an `if`-`then`-`else` or `from`-`where`-`select`. |
422422
| *binary operator* | An operator with two operands, such as comparison operators, `and`, `or`, `implies`, or arithmetic operators. |
423423
| *call* | A *formula* that invokes a predicate, e.g. `this.isStatic()` or `calls(a,b)`. |
424-
| *[conjunct](https://help.semmle.com/QL/QLLanguageSpecification.html#conjunctions)* | A formula that is an operand to an `and`. |
424+
| *[conjunct](https://help.semmle.com/QL/ql-handbook/language.html#conjunctions)* | A formula that is an operand to an `and`. |
425425
| *declaration* | A class, module, predicate, field or newtype. |
426-
| *[disjunct](https://help.semmle.com/QL/QLLanguageSpecification.html#disjunctions)* | A formula that is an operand to an `or`. |
427-
| *[formula](https://help.semmle.com/QL/QLLanguageSpecification.html#formulas)* | A logical expression, such as `A = B`, a *call*, a *quantifier*, `and`, `or`, `not`, `in` or `instanceof`. |
426+
| *[disjunct](https://help.semmle.com/QL/ql-handbook/language.html#disjunctions)* | A formula that is an operand to an `or`. |
427+
| *[formula](https://help.semmle.com/QL/ql-handbook/language.html#formulas)* | A logical expression, such as `A = B`, a *call*, a *quantifier*, `and`, `or`, `not`, `in` or `instanceof`. |
428428
| *should/should not/avoid/prefer* | Adhere to this rule wherever possible, where it makes sense. |
429429
| *may/can* | This is a reasonable alternative, to be used with discretion. |
430430
| *must/always/do not* | Always adhere to this rule. |
431-
| *[quantifier/aggregation](https://help.semmle.com/QL/QLLanguageSpecification.html#aggregations)* | `exists`, `count`, `strictcount`, `any`, `forall`, `forex` and so on. |
431+
| *[quantifier/aggregation](https://help.semmle.com/QL/ql-handbook/language.html#aggregations)* | `exists`, `count`, `strictcount`, `any`, `forall`, `forex` and so on. |
432432
| *variable* | A parameter to a predicate, a field, a from variable, or a variable introduced by a *quantifier* or *aggregation*. |

docs/query-help-style-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Section-level elements are used to group the information within the query help f
3636
3. `example`—an example of code showing the problem. Where possible, this section should also include a solution to the issue.
3737
4. `references`—relevant references, such as authoritative sources on language semantics and best practice.
3838

39-
For further information about the other section-level, block, list and table elements supported by query help files, see the [Query help reference](https://help.semmle.com/QL/learn-ql/ql/writing-queries/query-help.html) on help.semmle.com.
39+
For further information about the other section-level, block, list and table elements supported by query help files, see [Query help files](https://help.semmle.com/QL/learn-ql/ql/writing-queries/query-help.html) on help.semmle.com.
4040

4141

4242
## English style

docs/query-metadata-style-guide.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ Query files have the extension `.ql`. Each file has two distinct areas:
1111
* Metadata area–displayed at the top of the file, contains the metadata that defines how results for the query are interpreted and gives a brief description of the purpose of the query.
1212
* Query definition–defined using QL. The query includes a select statement, which defines the content and format of the results. For further information about writing QL, see the following topics:
1313
* [Learning CodeQL](https://help.semmle.com/QL/learn-ql/index.html)
14-
* [QL language handbook](https://help.semmle.com/QL/ql-handbook/index.html)
15-
* [QL language specification](https://help.semmle.com/QL/ql-spec/language.html)
14+
* [QL language reference](https://help.semmle.com/QL/ql-handbook/index.html)
1615
* [CodeQL style guide](https://github.com/github/codeql/blob/master/docs/ql-style-guide.md)
1716

1817

1918
For examples of query files for the languages supported by CodeQL, visit the following links:
2019

2120
* [C/C++ queries](https://help.semmle.com/wiki/display/CCPPOBJ/)
2221
* [C# queries](https://help.semmle.com/wiki/display/CSHARP/)
22+
* [Go queries](https://help.semmle.com/wiki/display/GO/)
2323
* [Java queries](https://help.semmle.com/wiki/display/JAVA/)
2424
* [JavaScript queries](https://help.semmle.com/wiki/display/JS/)
2525
* [Python queries](https://help.semmle.com/wiki/display/PYTHON/)
2626

2727
## Metadata area
2828

29-
Query file metadata contains important information that defines the identifier and purpose of the query. The metadata is included as the content of a valid [QLDoc](https://help.semmle.com/QL/ql-spec/qldoc.html) comment, on lines with leading whitespace followed by `*`, between an initial `/**` and a trailing `*/`. For example:
29+
Query file metadata contains important information that defines the identifier and purpose of the query. The metadata is included as the content of a valid [QLDoc](https://help.semmle.com/QL/ql-handbook/qldoc.html) comment, on lines with leading whitespace followed by `*`, between an initial `/**` and a trailing `*/`. For example:
3030

3131
```
3232
/**
@@ -134,6 +134,7 @@ There are also more specific `@tags` that can be added. See, the following pages
134134

135135
* [C/C++ queries](https://help.semmle.com/wiki/display/CCPPOBJ/)
136136
* [C# queries](https://help.semmle.com/wiki/display/CSHARP/)
137+
* [Go queries](https://help.semmle.com/wiki/display/GO/)
137138
* [Java queries](https://help.semmle.com/wiki/display/JAVA/)
138139
* [JavaScript queries](https://help.semmle.com/wiki/display/JS/)
139140
* [Python queries](https://help.semmle.com/wiki/display/PYTHON/)
@@ -158,7 +159,7 @@ When you tag a query like this, the associated CWE pages from [MITRE.org](http:/
158159

159160
## QL area
160161

161-
### Alert messages
162+
### Alert messages
162163

163164
The select clause of each alert query defines the alert message that is displayed for each result found by the query. Alert messages are strings that concisely describe the problem that the alert is highlighting and, if possible, also provide some context. For consistency, alert messages should adhere to the following guidelines:
164165

@@ -167,14 +168,15 @@ The select clause of each alert query defines the alert message that is displaye
167168
* Program element references should be in 'single quotes' to distinguish them from ordinary words. Quotes are not needed around substitutions ($@).
168169
* Avoid constant alert message strings and include some context, if possible. For example, `The class 'Foo' is duplicated as 'Bar'.` is preferable to `This class is duplicated here.`
169170
* 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.
170-
* 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 select statements](https://help.semmle.com/QL/learn-ql/ql/writing-queries/select-statement.html).
171+
* 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://help.semmle.com/QL/learn-ql/ql/writing-queries/select-statement.html).
171172

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

174175
* [C/C++ queries](https://help.semmle.com/wiki/display/CCPPOBJ/)
175176
* [C# queries](https://help.semmle.com/wiki/display/CSHARP/)
177+
* [Go queries](https://help.semmle.com/wiki/display/GO/)
176178
* [Java queries](https://help.semmle.com/wiki/display/JAVA/)
177179
* [JavaScript queries](https://help.semmle.com/wiki/display/JS/)
178180
* [Python queries](https://help.semmle.com/wiki/display/PYTHON/)
179181

180-
For further information on query writing, see [Writing CodeQL queries](https://help.semmle.com/QL/learn-ql/ql/writing-queries/writing-queries.html). For more information on learning CodeQL, see [Learning CodeQL](https://help.semmle.com/QL/learn-ql/index.html).
182+
For further information on query writing, see [CodeQL queries](https://help.semmle.com/QL/learn-ql/ql/writing-queries/writing-queries.html). For more information on learning CodeQL, see [Learning CodeQL](https://help.semmle.com/QL/learn-ql/index.html).

0 commit comments

Comments
 (0)