Skip to content

Commit ecd3ace

Browse files
committed
QL: add test for ql/missing-parameter-qldoc
1 parent af112a0 commit ecd3ace

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/** `param1`, `param2`, and `param3` are the parameters. */
2+
predicate test1(int param1, int param2, int param3) { none() } // OK
3+
4+
/** `param1`, `par2` */
5+
predicate test2(int param1, int param2) { none() } // NOT OK - `par2` is not a parameter, and `param2` has no documentation
6+
7+
/** `param1`, `par2 + par3` */
8+
predicate test3(int param1, int par2, int par3) { none() } // OK
9+
10+
/** this mentions no parameters */
11+
predicate test4(int param1, int param2) { none() } // OK - the QLDoc mentions none of the parameters, that's OK
12+
13+
/** the param1 parameter is mentioned in a non-code block, but the `par2` parameter is misspelled */
14+
predicate test5(int param1, int param2) { none() } // NOT OK - the `param1` parameter is "documented" in clear text, but `par2` is misspelled
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| Foo.qll:5:1:5:50 | ClasslessPredicate test2 | The QLDoc has no documentation for param2, but the QLDoc mentions par2 |
2+
| Foo.qll:14:1:14:50 | ClasslessPredicate test5 | The QLDoc has no documentation for param2, but the QLDoc mentions par2 |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
queries/style/MissingParameterInQlDoc.ql

0 commit comments

Comments
 (0)