Skip to content

Commit

Permalink
Upload the Axivion config files to gerrit
Browse files Browse the repository at this point in the history
To review and comment on the rules.

Task-number: QTQAINFRA-6577
Change-Id: I3c4f85e307533346d393ed32adccb75c106d882e
Reviewed-by: Simo Fält <[email protected]>
  • Loading branch information
Mate Barany authored and Matti Paaso committed Oct 1, 2024
1 parent 2891afd commit 32a3103
Show file tree
Hide file tree
Showing 10 changed files with 1,153 additions and 53 deletions.
44 changes: 0 additions & 44 deletions coin/provisioning/common/linux/axivion-bauhaus-suite.sh

This file was deleted.

10 changes: 10 additions & 0 deletions coin/provisioning/common/linux/axivion/axivion_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"_Layers": [
"post_processing.py",
"ci_config.json",
"ci_config_common.json",
"compiler_config.json",
"rule_config.json",
"code_annotations.json"
]
}
32 changes: 32 additions & 0 deletions coin/provisioning/common/linux/axivion/ci_config_common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"Project": {
"Git": {
"_active": true,
"sourceserver_gitdir": "/data/axivion/databases/$(env:TESTED_MODULE_COIN).git"
},
"Project-GlobalOptions": {
"ci_mode": {
"clean_before": false
},
"directory": "../work/qt/$(env:TESTED_MODULE_COIN)",
"ir": "$(env:IRNAME)",
"name": "qt_$(env:PACKAGE)_$(env:MODULE)_dev_$(env:TARGET_OS_COIN)"
}
},
"Results": {
"Dashboard": {
"ci_mode": {
"directory": "/data/axivion/databases"
},
"dashboard_url": "https://axivion-srv.ci.qt.io/axivion/"
}
},
"_Format": "1.0",
"_Version": "7.6.2",
"_VersionNum": [
7,
6,
2,
12725
]
}
32 changes: 32 additions & 0 deletions coin/provisioning/common/linux/axivion/code_annotations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"Analysis": {
"CatchMalformedComments": {
"_active": true
},
"EnableDisable": {
"_active": true
},
"NextLine": {
"_active": true
},
"ReportUnclosedRestOfFileComments": {
"_active": true
},
"ReportUnusedComments": {
"_active": true
}
},
"Results": {
"Dashboard": {
"import_suppressed_issues": true
}
},
"_Format": "1.0",
"_Version": "trunk-d23a11ca62e",
"_VersionNum": [
7,
8,
0,
14394
]
}
786 changes: 786 additions & 0 deletions coin/provisioning/common/linux/axivion/compiler_config.json

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions coin/provisioning/common/linux/axivion/post_processing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#Copyright (C) 2024 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

import re

import axivion.config
from axivion.analysis.post_processing import FilterAction
from bauhaus import ir

analysis = axivion.config.get_analysis()

qt_inline_pattern = re.compile(r"QT_.*_INLINE(_IMPL)?_SINCE\(\d+,\d+\)")
def exclude_inlined_by_qt_inline_macro(sv, ir_graph):
node = ir_graph.get_node(ir.Physical, sv.primary_sloc.pir_node_number)

# we have to check on the token stream as the macro might expand to nothing
# -> only the invocation is in the IR, but not in the AST of the routine decl / def
preceeding_string = ""

token = node.Token
while True:
try:
token_value = re.sub('^#\\s+', '#', token.Value)
if token_value in {';', '{', '}', '#define'}:
break
preceeding_string = token.Value + preceeding_string
token = token.prev()
except StopIteration:
break
if re.match(qt_inline_pattern, preceeding_string):
return FilterAction.exclude
return FilterAction.normal

analysis['Qt-Generic-NoFunctionDefinitionInHeader'].post_processing.add_filter(exclude_inlined_by_qt_inline_macro, inputs=[ir.Graph])
210 changes: 210 additions & 0 deletions coin/provisioning/common/linux/axivion/rule_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
{
"Analysis": {
"CloneDetection": {
"_active": true,
"excludes": [
"$(splitpath:EXCLUDE_FILES)"
]
},
"Frameworks-QtSupport": {
"_active": true,
"exclude_qt_generated_files": true,
"qtdir": "/home/qt/work/install"
},
"Qt-AutoUnexpectedQStringbuilder": {
"_active": true
},
"Qt-BaseClassEvent": {
"_active": true
},
"Qt-ChildEventQObjectCast": {
"_active": true
},
"Qt-Connect3argLambda": {
"_active": true
},
"Qt-ConnectByName": {
"_active": true
},
"Qt-ConnectNonSignal": {
"_active": true
},
"Qt-ConstSignalOrSlot": {
"_active": true
},
"Qt-CtorMissingParentArgument": {
"_active": true
},
"Qt-DetachingTemporary": {
"_active": true
},
"Qt-FullyQualifiedMocTypes": {
"_active": true
},
"Qt-FunctionArgsByValueRef": {
"_active": true
},
"Qt-Generic-DuplicateIncludeGuard": {
"_active": true
},
"Qt-Generic-FormatSpecifier": {
"_active": true
},
"Qt-Generic-InitializeAllFieldsInConstructor": {
"_active": true
},
"Qt-Generic-MissingBaseCopy": {
"_active": true
},
"Qt-Generic-MissingIncludeGuard": {
"_active": true
},
"Qt-Generic-NoAbsoluteInclude": {
"_active": true
},
"Qt-Generic-NoFunctionDefinitionInHeader": {
"_active": true
},
"Qt-Generic-NoIrregularInclude": {
"_active": true
},
"Qt-Generic-NoMixOfClassStruct": {
"_active": true
},
"Qt-Generic-NoOverloadedOperators": {
"_active": true
},
"Qt-Generic-NoReferenceToLocalVariable": {
"_active": true
},
"Qt-Generic-QNetworkReplyDeleteLater": {
"_active": true
},
"Qt-Generic-ThrowByValueCatchByReference": {
"_active": true
},
"Qt-Generic-TypedefCheck": {
"_active": true
},
"Qt-Generic-WrongIncludeCasing": {
"_active": true
},
"Qt-GlobalConstCharPointer": {
"_active": true
},
"Qt-IncorrectEmit": {
"_active": true
},
"Qt-InstallEventFilter": {
"_active": true
},
"Qt-LambdaInConnect": {
"_active": true
},
"Qt-LambdaUniqueConnection": {
"_active": true
},
"Qt-LowercaseQmlTypeName": {
"_active": true
},
"Qt-MissingQObjectMacro": {
"_active": true
},
"Qt-MutableContainerKey": {
"_active": true
},
"Qt-NonPodGlobalStatic": {
"_active": true
},
"Qt-OldStyleConnect": {
"_active": true
},
"Qt-OverloadedSignal": {
"_active": true
},
"Qt-OverriddenSignal": {
"_active": true
},
"Qt-PostEvent": {
"_active": true
},
"Qt-QDateTimeUTC": {
"_active": true
},
"Qt-QEnums": {
"_active": true
},
"Qt-QLatin1StringNonAscii": {
"_active": true
},
"Qt-QMapWithPointerKey": {
"_active": true
},
"Qt-QPropertyWithoutNotify": {
"_active": true
},
"Qt-QStringArg": {
"_active": true
},
"Qt-QStringComparisonToImplicitChar": {
"_active": true
},
"Qt-QhashNamespace": {
"_active": true
},
"Qt-QtMacros": {
"_active": true
},
"Qt-RangeLoopDetach": {
"_active": false
},
"Qt-RangeLoopReference": {
"_active": true
},
"Qt-ReturningDataFromTemporary": {
"_active": true
},
"Qt-RuleOfThree": {
"_active": true
},
"Qt-RuleOfTwoSoft": {
"_active": true
},
"Qt-SkippedBaseMethod": {
"_active": true
},
"Qt-StrictIterators": {
"_active": true
},
"Qt-TemporaryIterator": {
"_active": true
},
"Qt-UnusedNonTrivialVariable": {
"_active": true
},
"Qt-VirtualSignal": {
"_active": true
},
"Qt-WritingToTemporary": {
"_active": true
},
"Qt-WrongQEventCast": {
"_active": true
},
"Qt-WrongQGlobalStatic": {
"_active": true
},
"Stylechecks": {
"excludes": [
"$(splitpath:EXCLUDE_FILES)"
]
}
},
"_Format": "1.0",
"_VersionNum": [
7,
8,
0,
15004
]
}
13 changes: 13 additions & 0 deletions coin/provisioning/common/linux/axivion/start_analysis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
#Copyright (C) 2024 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

$HOME/bauhaus-suite/setup.sh --non-interactive
export PATH=/home/qt/bauhaus-suite/bin:$PATH
export BAUHAUS_CONFIG=$(cd $(dirname $(readlink -f $0)) && pwd)
export AXIVION_VERSION_NAME=$(git rev-parse HEAD)
export EXCLUDE_FILES="build/*:src/3rdparty/*"
export MODULE=$TESTED_MODULE_COIN
export PACKAGE="Add-ons"
export IRNAME=build/$TESTED_MODULE_COIN.ir
axivion_ci "$@"
Loading

0 comments on commit 32a3103

Please sign in to comment.