Skip to content

Commit f9c9efe

Browse files
authored
Merge pull request #1188 from geoffw0/donotedit
CPP: Consider more files to be generated.
2 parents 65d0412 + bce6ee5 commit f9c9efe

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

cpp/ql/src/semmle/code/cpp/AutogeneratedFile.qll

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@ private bindingset[comment] predicate autogeneratedComment(string comment) {
2323

2424
// changes made in this file will be lost
2525
"(changes made in this file will be lost)|" +
26-
27-
// do not edit/modify
26+
27+
// do not edit/modify (not mid-sentence)
2828
"(^ do(n't|nt| not) (hand-?)?(edit|modify))|" +
29-
"(! do(n't|nt| not) (hand-?)?(edit|modify))" and
30-
29+
"(! do(n't|nt| not) (hand-?)?(edit|modify))|" +
30+
31+
// do not edit/modify + generated
32+
"(do(n't|nt| not) (hand-?)?(edit|modify).*generated)|" +
33+
"(generated.*do(n't|nt| not) (hand-?)?(edit|modify))" and
34+
3135
comment.regexpMatch("(?si).*(" +
3236
// replace `generated` with a regexp that also catches things like
3337
// `auto-generated`.

0 commit comments

Comments
 (0)