Skip to content

Commit ec90627

Browse files
authored
Merge pull request github#2909 from yo-h/experimental
Approved by aschackmull, jbj, max-schaefer, tausbn
2 parents f8bf055 + 63adc63 commit ec90627

File tree

12 files changed

+57
-0
lines changed

12 files changed

+57
-0
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ Follow the steps below to help other users understand what your query does, and
4646
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.
4747
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).
4848

49+
7. **Maintain backwards compatibility**
50+
51+
The standard CodeQL libraries must evolve in a backwards compatible manner. If any backwards incompatible changes need to be made, the existing API must first be marked as deprecated. This is done by adding a `deprecated` annotation along with a QLDoc reference to the replacement API. Only after at least one full release cycle has elapsed may the old API be removed.
52+
53+
In addition to contributions to our standard queries and libraries, we also welcome contributions of a more experimental nature, which do not need to fulfill all the requirements listed above. See the guidelines for [experimental queries and libraries](docs/experimental.md) for details.
54+
4955
## Using your personal data
5056

5157
If you contribute to this project, we will record your name and email

cpp/ql/src/experimental/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This directory contains [experimental](../../../../docs/experimental.md) CodeQL queries and libraries.

cpp/ql/test/experimental/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This directory contains tests for [experimental](../../../../docs/experimental.md) CodeQL queries and libraries.

csharp/ql/src/experimental/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This directory contains [experimental](../../../../docs/experimental.md) CodeQL queries and libraries.

csharp/ql/test/experimental/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This directory contains tests for [experimental](../../../../docs/experimental.md) CodeQL queries and libraries.

docs/experimental.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Experimental CodeQL queries and libraries
2+
3+
In addition to our standard CodeQL queries and libraries, this repository may also contain queries and libraries of a more experimental nature. Experimental queries and libraries can be improved incrementally and may eventually reach a sufficient maturity to be included in our standard libraries and queries.
4+
5+
Experimental queries and libraries may not be actively maintained as the standard libraries evolve. They may also be changed in backwards-incompatible ways or may be removed entirely in the future without deprecation warnings.
6+
7+
## Requirements
8+
9+
1. **Directory structure**
10+
11+
- Experimental queries and libraries are stored in the `experimental` subdirectory within each language-specific directory in the [CodeQL repository](https://github.com/Semmle/ql). For example, experimental Java queries and libraries are stored in `ql/java/ql/src/experimental` and any corresponding tests in `ql/java/ql/test/experimental`.
12+
- The structure of an `experimental` subdirectory mirrors the structure of standard queries and libraries (or tests) in the parent directory.
13+
14+
2. **Query metadata**
15+
16+
- The query `@id` must not clash with any other queries in the repository.
17+
- The query must have a `@name` and `@description` to explain its purpose.
18+
- The query must have a `@kind` and `@problem.severity` as required by CodeQL tools.
19+
20+
For details, see the [guide on query metadata](https://github.com/Semmle/ql/blob/master/docs/query-metadata-style-guide.md).
21+
22+
3. **Formatting**
23+
24+
- The queries and libraries must be [autoformatted](https://help.semmle.com/codeql/codeql-for-vscode/reference/editor.html#autoformatting).
25+
26+
4. **Compilation**
27+
28+
- Compilation of the query and any associated libraries and tests must be resilient to future development of the standard libraries. This means that the functionality cannot use internal APIs, cannot depend on the output of `getAQlClass`, and cannot make use of regexp matching on `toString`.
29+
- The query and any associated libraries and tests must not cause any compiler warnings to be emitted (such as use of deprecated functionality or missing `override` annotations).
30+
31+
5. **Results**
32+
33+
- The query must have at least one true positive result on some revision of a real project.
34+
35+
6. **Contributor License Agreement**
36+
37+
- The contributor can satisfy the [CLA](CONTRIBUTING.md#contributor-license-agreement).
38+
39+
## Non-requirements
40+
41+
Other criteria typically required for our standard queries and libraries are not required for experimental queries and libraries. In particular, fully disciplined query [metadata](docs/query-metadata-style-guide.md), query [help](docs/query-help-style-guide.md), tests, a low false positive rate and performance tuning are not required (but nonetheless recommended).

java/ql/src/experimental/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This directory contains [experimental](../../../../docs/experimental.md) CodeQL queries and libraries.

java/ql/test/experimental/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This directory contains tests for [experimental](../../../../docs/experimental.md) CodeQL queries and libraries.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This directory contains [experimental](../../../../docs/experimental.md) CodeQL queries and libraries.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This directory contains tests for [experimental](../../../../docs/experimental.md) CodeQL queries and libraries.

0 commit comments

Comments
 (0)