From d6842629c77a54b461473adb838803ca6221db5d Mon Sep 17 00:00:00 2001 From: jsinglet Date: Wed, 28 Sep 2022 17:03:38 +0000 Subject: [PATCH 1/2] Version bump to 2.9.0. --- c/cert/src/qlpack.yml | 2 +- c/cert/test/qlpack.yml | 2 +- c/common/src/qlpack.yml | 2 +- c/common/test/qlpack.yml | 2 +- c/misra/src/qlpack.yml | 2 +- c/misra/test/qlpack.yml | 2 +- cpp/autosar/src/qlpack.yml | 2 +- cpp/autosar/test/qlpack.yml | 2 +- cpp/cert/src/qlpack.yml | 2 +- cpp/cert/test/qlpack.yml | 2 +- cpp/common/src/qlpack.yml | 2 +- cpp/common/test/qlpack.yml | 2 +- cpp/misra/src/qlpack.yml | 2 +- cpp/misra/test/qlpack.yml | 2 +- cpp/report/src/qlpack.yml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/c/cert/src/qlpack.yml b/c/cert/src/qlpack.yml index c8c8a32d4b..9b8b4c6d56 100644 --- a/c/cert/src/qlpack.yml +++ b/c/cert/src/qlpack.yml @@ -1,4 +1,4 @@ name: cert-c-coding-standards -version: 2.9.0-dev +version: 2.9.0 suites: codeql-suites libraryPathDependencies: common-c-coding-standards \ No newline at end of file diff --git a/c/cert/test/qlpack.yml b/c/cert/test/qlpack.yml index 4254c55baa..69f673f348 100644 --- a/c/cert/test/qlpack.yml +++ b/c/cert/test/qlpack.yml @@ -1,4 +1,4 @@ name: cert-c-coding-standards-tests -version: 2.9.0-dev +version: 2.9.0 libraryPathDependencies: cert-c-coding-standards extractor: cpp \ No newline at end of file diff --git a/c/common/src/qlpack.yml b/c/common/src/qlpack.yml index 7ee86c91f1..91e3027719 100644 --- a/c/common/src/qlpack.yml +++ b/c/common/src/qlpack.yml @@ -1,3 +1,3 @@ name: common-c-coding-standards -version: 2.9.0-dev +version: 2.9.0 libraryPathDependencies: common-cpp-coding-standards diff --git a/c/common/test/qlpack.yml b/c/common/test/qlpack.yml index de2509acba..23ab835710 100644 --- a/c/common/test/qlpack.yml +++ b/c/common/test/qlpack.yml @@ -1,4 +1,4 @@ name: common-c-coding-standards-tests -version: 2.9.0-dev +version: 2.9.0 libraryPathDependencies: common-c-coding-standards extractor: cpp diff --git a/c/misra/src/qlpack.yml b/c/misra/src/qlpack.yml index 70b7c0a190..12583f5e2a 100644 --- a/c/misra/src/qlpack.yml +++ b/c/misra/src/qlpack.yml @@ -1,4 +1,4 @@ name: misra-c-coding-standards -version: 2.9.0-dev +version: 2.9.0 suites: codeql-suites libraryPathDependencies: common-c-coding-standards diff --git a/c/misra/test/qlpack.yml b/c/misra/test/qlpack.yml index 8ce6bf2226..2dc188b90c 100644 --- a/c/misra/test/qlpack.yml +++ b/c/misra/test/qlpack.yml @@ -1,4 +1,4 @@ name: misra-c-coding-standards-tests -version: 2.9.0-dev +version: 2.9.0 libraryPathDependencies: misra-c-coding-standards extractor: cpp \ No newline at end of file diff --git a/cpp/autosar/src/qlpack.yml b/cpp/autosar/src/qlpack.yml index 59dfeb5ac9..dfdf8f5ea9 100644 --- a/cpp/autosar/src/qlpack.yml +++ b/cpp/autosar/src/qlpack.yml @@ -1,4 +1,4 @@ name: autosar-cpp-coding-standards -version: 2.9.0-dev +version: 2.9.0 suites: codeql-suites libraryPathDependencies: common-cpp-coding-standards diff --git a/cpp/autosar/test/qlpack.yml b/cpp/autosar/test/qlpack.yml index 07f0742c9f..b465189500 100644 --- a/cpp/autosar/test/qlpack.yml +++ b/cpp/autosar/test/qlpack.yml @@ -1,4 +1,4 @@ name: autosar-cpp-coding-standards-tests -version: 2.9.0-dev +version: 2.9.0 libraryPathDependencies: autosar-cpp-coding-standards extractor: cpp diff --git a/cpp/cert/src/qlpack.yml b/cpp/cert/src/qlpack.yml index 61fc858bd7..85e1db0ce7 100644 --- a/cpp/cert/src/qlpack.yml +++ b/cpp/cert/src/qlpack.yml @@ -1,4 +1,4 @@ name: cert-cpp-coding-standards -version: 2.9.0-dev +version: 2.9.0 suites: codeql-suites libraryPathDependencies: common-cpp-coding-standards diff --git a/cpp/cert/test/qlpack.yml b/cpp/cert/test/qlpack.yml index 54cd878e23..0fdf27e6e8 100644 --- a/cpp/cert/test/qlpack.yml +++ b/cpp/cert/test/qlpack.yml @@ -1,4 +1,4 @@ name: cert-cpp-coding-standards-tests -version: 2.9.0-dev +version: 2.9.0 libraryPathDependencies: cert-cpp-coding-standards extractor: cpp diff --git a/cpp/common/src/qlpack.yml b/cpp/common/src/qlpack.yml index 39e3c65503..fe070599d5 100644 --- a/cpp/common/src/qlpack.yml +++ b/cpp/common/src/qlpack.yml @@ -1,3 +1,3 @@ name: common-cpp-coding-standards -version: 2.9.0-dev +version: 2.9.0 libraryPathDependencies: codeql-cpp diff --git a/cpp/common/test/qlpack.yml b/cpp/common/test/qlpack.yml index ca0d89ee1e..8118155fe2 100644 --- a/cpp/common/test/qlpack.yml +++ b/cpp/common/test/qlpack.yml @@ -1,4 +1,4 @@ name: common-cpp-coding-standards-tests -version: 2.9.0-dev +version: 2.9.0 libraryPathDependencies: common-cpp-coding-standards extractor: cpp diff --git a/cpp/misra/src/qlpack.yml b/cpp/misra/src/qlpack.yml index fb22013421..47cb6677df 100644 --- a/cpp/misra/src/qlpack.yml +++ b/cpp/misra/src/qlpack.yml @@ -1,3 +1,3 @@ name: misra-cpp-coding-standards -version: 2.9.0-dev +version: 2.9.0 libraryPathDependencies: common-cpp-coding-standards diff --git a/cpp/misra/test/qlpack.yml b/cpp/misra/test/qlpack.yml index 7dc4a9fe6e..efcf229ecd 100644 --- a/cpp/misra/test/qlpack.yml +++ b/cpp/misra/test/qlpack.yml @@ -1,4 +1,4 @@ name: misra-cpp-coding-standards-tests -version: 2.9.0-dev +version: 2.9.0 libraryPathDependencies: misra-cpp-coding-standards extractor: cpp diff --git a/cpp/report/src/qlpack.yml b/cpp/report/src/qlpack.yml index 508dea59e8..01ab377d7b 100644 --- a/cpp/report/src/qlpack.yml +++ b/cpp/report/src/qlpack.yml @@ -1,3 +1,3 @@ name: report-cpp-coding-standards -version: 2.9.0-dev +version: 2.9.0 libraryPathDependencies: codeql-cpp From 3779da92b4fba604719f91aa2c646876e39c187c Mon Sep 17 00:00:00 2001 From: Kristen Newbury Date: Wed, 28 Sep 2022 16:21:45 -0400 Subject: [PATCH 2/2] Declarations 1and2: patch shared query alert format --- .../notdistinctidentifier/NotDistinctIdentifier.expected | 8 ++++---- .../notdistinctidentifier/NotDistinctIdentifier.qll | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/c/common/test/rules/notdistinctidentifier/NotDistinctIdentifier.expected b/c/common/test/rules/notdistinctidentifier/NotDistinctIdentifier.expected index 4a0178ec23..165e80c6fc 100644 --- a/c/common/test/rules/notdistinctidentifier/NotDistinctIdentifier.expected +++ b/c/common/test/rules/notdistinctidentifier/NotDistinctIdentifier.expected @@ -1,4 +1,4 @@ -| test.c:2:5:2:36 | iltiqzxgfqsgigwfuyntzghvzltueeeB | test.c:1:5:1:36 | iltiqzxgfqsgigwfuyntzghvzltueeeA | External identifer iltiqzxgfqsgigwfuyntzghvzltueeeB is nondistinct in characters at or over 31 limit, compared to iltiqzxgfqsgigwfuyntzghvzltueeeA | -| test.c:5:5:5:35 | iltiqzxgfqsgigwfuyntzghvzltueea | test.c:4:5:4:36 | iltiqzxgfqsgigwfuyntzghvzltueeaZ | External identifer iltiqzxgfqsgigwfuyntzghvzltueea is nondistinct in characters at or over 31 limit, compared to iltiqzxgfqsgigwfuyntzghvzltueeaZ | -| test.c:8:5:8:35 | iltiqzxgfqsgigwfuyntzghvzltueee | test.c:1:5:1:36 | iltiqzxgfqsgigwfuyntzghvzltueeeA | External identifer iltiqzxgfqsgigwfuyntzghvzltueee is nondistinct in characters at or over 31 limit, compared to iltiqzxgfqsgigwfuyntzghvzltueeeA | -| test.c:8:5:8:35 | iltiqzxgfqsgigwfuyntzghvzltueee | test.c:2:5:2:36 | iltiqzxgfqsgigwfuyntzghvzltueeeB | External identifer iltiqzxgfqsgigwfuyntzghvzltueee is nondistinct in characters at or over 31 limit, compared to iltiqzxgfqsgigwfuyntzghvzltueeeB | +| test.c:2:5:2:36 | iltiqzxgfqsgigwfuyntzghvzltueeeB | External identifer iltiqzxgfqsgigwfuyntzghvzltueeeB is nondistinct in characters at or over 31 limit, compared to $@ | test.c:1:5:1:36 | iltiqzxgfqsgigwfuyntzghvzltueeeA | iltiqzxgfqsgigwfuyntzghvzltueeeA | +| test.c:5:5:5:35 | iltiqzxgfqsgigwfuyntzghvzltueea | External identifer iltiqzxgfqsgigwfuyntzghvzltueea is nondistinct in characters at or over 31 limit, compared to $@ | test.c:4:5:4:36 | iltiqzxgfqsgigwfuyntzghvzltueeaZ | iltiqzxgfqsgigwfuyntzghvzltueeaZ | +| test.c:8:5:8:35 | iltiqzxgfqsgigwfuyntzghvzltueee | External identifer iltiqzxgfqsgigwfuyntzghvzltueee is nondistinct in characters at or over 31 limit, compared to $@ | test.c:1:5:1:36 | iltiqzxgfqsgigwfuyntzghvzltueeeA | iltiqzxgfqsgigwfuyntzghvzltueeeA | +| test.c:8:5:8:35 | iltiqzxgfqsgigwfuyntzghvzltueee | External identifer iltiqzxgfqsgigwfuyntzghvzltueee is nondistinct in characters at or over 31 limit, compared to $@ | test.c:2:5:2:36 | iltiqzxgfqsgigwfuyntzghvzltueeeB | iltiqzxgfqsgigwfuyntzghvzltueeeB | diff --git a/cpp/common/src/codingstandards/cpp/rules/notdistinctidentifier/NotDistinctIdentifier.qll b/cpp/common/src/codingstandards/cpp/rules/notdistinctidentifier/NotDistinctIdentifier.qll index 8e58cbac07..944168f0fe 100644 --- a/cpp/common/src/codingstandards/cpp/rules/notdistinctidentifier/NotDistinctIdentifier.qll +++ b/cpp/common/src/codingstandards/cpp/rules/notdistinctidentifier/NotDistinctIdentifier.qll @@ -32,14 +32,17 @@ abstract class NotDistinctIdentifierSharedQuery extends Query { } Query getQuery() { result instanceof NotDistinctIdentifierSharedQuery } -query predicate problems(ExternalIdentifiers d, ExternalIdentifiers d2, string message) { - not isExcluded(d, getQuery()) and +query predicate problems( + ExternalIdentifiers d, string message, ExternalIdentifiers d2, string nameplaceholder +) { not isExcluded(d, getQuery()) and + not isExcluded(d2, getQuery()) and not d = d2 and d.getLocation().getStartLine() >= d2.getLocation().getStartLine() and d.getSignificantName() = d2.getSignificantName() and not d.getName() = d2.getName() and + nameplaceholder = d2.getName() and message = "External identifer " + d.getName() + - " is nondistinct in characters at or over 31 limit, compared to " + d2.getName() + " is nondistinct in characters at or over 31 limit, compared to $@" }