Skip to content

Commit ae506f6

Browse files
committed
Add clazy tests
1 parent ca1d1db commit ae506f6

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

.craft.shelf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ revision = d8e04f2
1515

1616
[craft/craft-core]
1717
version = master
18-
revision = 3b9af473a
18+
revision = b3c1e0d20a760afa7d00729dab4a5f29c30e6cd0
1919

2020
[dev-utils/7zip-base]
2121
version = 25.00
Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1-
run-clang-tidy -p "$env:BUILD_DIR" | Tee-Object -Path "$([System.IO.Path]::GetTempPath())/clang-tidy.log"
1+
$clazyPlugin="ClazyClangTidy"
2+
3+
if($isWindows) {
4+
$clazyPlugin = $null
5+
#$clazy += ".dll" // don't use clazy on windows for now
6+
} elseif($isLinux) {
7+
$clazyPlugin = "${env:KDEROOT}/lib/${clazyPlugin}.so"
8+
} else
9+
{
10+
$clazyPlugin = "${env:KDEROOT}/lib/${clazyPlugin}.dylib"
11+
}
12+
$CLAZY_LEVEL0="clazy-overloaded-signal,clazy-connect-by-name,clazy-connect-non-signal,clazy-qstring-comparison-to-implicit-char,clazy-wrong-qevent-cast,clazy-lambda-in-connect,clazy-lambda-unique-connection,clazy-qdatetime-utc,clazy-qgetenv,clazy-qstring-insensitive-allocation,clazy-fully-qualified-moc-types,clazy-unused-non-trivial-variable,clazy-connect-not-normalized,clazy-mutable-container-key,clazy-qenums,clazy-qmap-with-pointer-key,clazy-qstring-ref,clazy-strict-iterators,clazy-writing-to-temporary,clazy-container-anti-pattern,clazy-qcolor-from-literal,clazy-qfileinfo-exists,clazy-qstring-arg,clazy-empty-qstringliteral,clazy-qt-macros,clazy-temporary-iterator,clazy-wrong-qglobalstatic,clazy-lowercase-qml-type-name,clazy-no-module-include,clazy-use-static-qregularexpression"
13+
$CLAZY_LEVEL1="clazy-auto-unexpected-qstringbuilder,clazy-connect-3arg-lambda,clazy-const-signal-or-slot,clazy-detaching-temporary,clazy-foreach,clazy-incorrect-emit,clazy-install-event-filter,clazy-non-pod-global-static,clazy-post-event,clazy-qdeleteall,clazy-qlatin1string-non-ascii,clazy-qproperty-without-notify,clazy-qstring-left,clazy-range-loop-detach,clazy-range-loop-reference,clazy-returning-data-from-temporary,clazy-rule-of-two-soft,clazy-child-event-qobject-cast,clazy-virtual-signal,clazy-overridden-signal,clazy-qhash-namespace,clazy-skipped-base-method,clazy-readlock-detaching"
14+
$CLAZY_LEVEL2="clazy-ctor-missing-parent-argument,clazy-base-class-event,clazy-copyable-polymorphic,clazy-function-args-by-ref,clazy-function-args-by-value,clazy-global-const-char-pointer,clazy-implicit-casts,clazy-missing-qobject-macro,clazy-missing-typeinfo,clazy-old-style-connect,clazy-qstring-allocations,clazy-returning-void-expression,clazy-rule-of-three,clazy-virtual-call-ctor,clazy-static-pmf"
15+
16+
if ($clazyPlugin)
17+
{
18+
$clazyCommand = @("-load=${clazyPlugin}", "-checks=${CLAZY_LEVEL0},-overloaded-signal,qt-keywords")
19+
} else {
20+
$clazyCommand = @()
21+
}
22+
23+
$clangCommand = $clazyCommand + @("-p", "$env:BUILD_DIR")
24+
25+
run-clang-tidy @clangCommand | Tee-Object -Path "$([System.IO.Path]::GetTempPath())/clang-tidy.log"

.github/workflows/main.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,9 @@ jobs:
163163
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c --no-cache --test opencloud/opencloud-desktop
164164
165165
- name: Clang tidy
166-
# disable for now
167-
if: ${{ true || github.event_name != 'pull_request' }}
166+
if: ${{ github.event_name != 'pull_request' }}
168167
run: |
169-
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c libs/llvm python-modules/pip
168+
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c libs/llvm dev-utils/clazy python-modules/pip
170169
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c --run python3 -m pip install clang-html
171170
$env:BUILD_DIR = $(& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c --get buildDir -q opencloud/opencloud-desktop)
172171
& "${env:GITHUB_WORKSPACE}/.github/workflows/.craft.ps1" -c --run pwsh "${env:GITHUB_WORKSPACE}/.github/workflows/.run-clang-tidy.ps1"

0 commit comments

Comments
 (0)