Skip to content

Commit 7ec2c05

Browse files
author
james
committed
docs: address review comments and fix a few other things
1 parent 0ebc396 commit 7ec2c05

File tree

3 files changed

+32
-19
lines changed

3 files changed

+32
-19
lines changed

CONTRIBUTING.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,41 @@ Before we accept your pull request, we require that you have agreed to our Contr
99
If you have an idea for a query that you would like to share with other Semmle users, please open a pull request to add it to this repository.
1010
Follow the steps below to help other users understand what your query does, and to ensure that your query is consistent with the other Semmle queries.
1111

12-
1. Consult the QL documentation for query writers
12+
1. **Consult the QL documentation for query writers**
1313

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

16-
2. Format your QL correctly
16+
2. **Format your QL correctly**
1717

18-
All of Semmle's standard QL queries and libraries are uniformly formatted for clarity and consistency, so we strongly recommend that all QL contributions follow the same formatting guidelines. For more information, see the [QL style guide](https://github.com/Semmle/ql/blob/master/docs/ql-style-guide.md).
18+
All of Semmle's standard QL queries and libraries are uniformly formatted for clarity and consistency, so we strongly recommend that all QL contributions follow the same formatting guidelines. If you use QL for Eclipse, you can auto-format your query in the [QL editor](https://help.semmle.com/ql-for-eclipse/Content/WebHelp/ql-editor.html)]. For more information, see the [QL style guide](https://github.com/Semmle/ql/blob/master/docs/ql-style-guide.md).
1919

20-
3. Make sure your query has the correct metadata
20+
3. **Make sure your query has the correct metadata**
2121

22-
Query metadata is used by Semmle's analysis to idenitfy your query and make sure the query results are displayed properly, so it's important that it's lncluded.
23-
For more information on writing query metadata, see the [Query metadata style guide](https://github.com/Semmle/ql/blob/master/docs/query-metadata-style-guide.md).
22+
Query metadata is used by Semmle's analysis to idenitfy your query and make sure the query results are displayed properly.
23+
The most important metadata to include are the `@name`, `@description`, and the `@kind`.
24+
Other metadata properties (`@precision`, `@severity`, and `@tags`) are usually added after the query has been reviewed by Semmle staff.
25+
For more information on writing query metadata, see the [Query metadata style guide](https://github.com/Semmle/ql/blob/master/docs/query-metadata-style-guide.md).
2426

25-
4. Save your query in a `.ql` file in correct language directory in the this repository.
27+
4. **Make sure the `select` statement is compatible with the query type**
2628

27-
There are five language-specific directories in this repository:
29+
The query type (determined by the `@kind` metadata property) must have the correct format for query results to be displayed correctly in LGTM or QL for Eclipse.
30+
For more information on `select` statement format, see [Introduction to query files](https://help.semmle.com/QL/learn-ql/writing-queries/introduction-to-queries.html#select-clause) on help.semmle.com.
2831

29-
* C/C++: `ql/cpp/ql/src`
30-
* C#: `ql/csharp/ql/src`
31-
* Java: `ql/java/ql/src`
32-
* JavaScript: `ql/javascript/ql/src`
33-
* Python: `ql/python/ql/src`
32+
5. **Save your query in a `.ql` file in correct language directory in the this repository**
3433

35-
5. Write a query help file
34+
There are five language-specific directories in this repository:
35+
36+
* C/C++: `ql/cpp/ql/src`
37+
* C#: `ql/csharp/ql/src`
38+
* Java: `ql/java/ql/src`
39+
* JavaScript: `ql/javascript/ql/src`
40+
* Python: `ql/python/ql/src`
3641

37-
Query help files explain the purpose of your query to other users. Write your query help in a `.qhelp` file and save it in the same directory as your new query. For more information on writing query help, see the [Query help style guide](https://github.com/Semmle/ql/blob/master/docs/query-help-style-guide.md).
42+
43+
6. **Write a query help file**
44+
45+
Query help files explain the purpose of your query to other users. Write your query help in a `.qhelp` file and save it in the same directory as your new query.
46+
For more information on writing query help, see the [Query help style guide](https://github.com/Semmle/ql/blob/master/docs/query-help-style-guide.md).
3847

3948
## Using your personal data
4049

docs/ql-style-guide.md

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

33
## Introduction
44

5-
This document describes how to format the QL code you contribute to this repository. It covers aspects such as layout, white-space, naming and documentation. Adhering to consistent standards makes code easier to read and maintain. Of course, these are only guidelines, and can be overridden as the need arises on a case-by-case basis. Where existing code deviates from these guidelines, prefer consistency with the surrounding code.
5+
This document describes how to format the QL code you contribute to this repository. It covers aspects such as layout, white-space, naming, and documentation. Adhering to consistent standards makes code easier to read and maintain. Of course, these are only guidelines, and can be overridden as the need arises on a case-by-case basis. Where existing code deviates from these guidelines, prefer consistency with the surrounding code.
6+
Note, if you use QL for Eclipse, you can auto-format your query in the (QL editor)[https://help.semmle.com/ql-for-eclipse/Content/WebHelp/ql-editor.html].
67

78
Words in *italic* are defined in the [Glossary](#glossary).
89

docs/query-metadata-style-guide.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ For examples of query files for the languages supported by Semmle, visit the fol
2727

2828
## Metadata area
2929

30-
Query file metadata contains important information which 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:
30+
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:
3131

3232
```
3333
/**
@@ -43,7 +43,10 @@ Query file metadata contains important information which defines the identifier
4343
*/
4444
```
4545

46-
In order to help others use your query, and to ensure that the query works correctly on LGTM, you should include all of the required information outlined below in the metadata, and as much of the optional information as possible. For further information on query metadata see [Query metadata](https://help.semmle.com/QL/learn-ql/ql/writing-queries/query-metadata.html) on help.semmle.com.
46+
To help others use your query, and to ensure that the query works correctly on LGTM, you should include all of the required information outlined below in the metadata, and as much of the optional information as possible. For further information on query metadata see [Query metadata](https://help.semmle.com/QL/learn-ql/ql/writing-queries/query-metadata.html) on help.semmle.com.
47+
48+
49+
4750

4851
### Query name `@name`
4952

0 commit comments

Comments
 (0)