Skip to content

Commit

Permalink
AlertFiltering: prohibit partial filtering
Browse files Browse the repository at this point in the history
This documentation-only commit clarifies that a query should either
ignore restrictAlertsTo completely or apply restrictAlertsTo filtering
to all alerts.  This update eliminates the ambiguity on whether a query
may choose to apply restrictAlertsTo filtering to only some alerts but
not others (it may not).
  • Loading branch information
cklin committed Dec 3, 2024
1 parent 06b1d8e commit 63c8769
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions shared/util/codeql/util/AlertFiltering.qll
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ private import codeql.util.Location
* - endLine: End line number (starting with 1, inclusive) to restrict alerts to.
*
* If startLine and endLine are both 0, accept alerts anywhere in the file.
*
* A query should either completely ignore this predicate (i.e., perform no filtering whatsoever),
* or only return alerts that meet the filtering criteria as specified above.
*/
extensible predicate restrictAlertsTo(string filePath, int startLine, int endLine);

Expand Down

0 comments on commit 63c8769

Please sign in to comment.