Add basic qml linter config

This commit is contained in:
Nicolas Werner 2023-10-26 21:03:36 +02:00
parent 2b1c9af311
commit d0c43eb872
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
3 changed files with 77 additions and 1 deletions

View file

@ -8,6 +8,7 @@
set -eu
FILES=$(find src -type f \( -iname "*.cpp" -o -iname "*.h" \))
QML_FILES=$(find resources/qml -type f \( -iname "*.qml" \))
for f in $FILES
do
@ -15,3 +16,11 @@ do
done;
git diff --exit-code
if command -v /usr/lib64/qt6/bin/qmllint &> /dev/null; then
/usr/lib64/qt6/bin/qmllint $QML_FILES
elif command -v /usr/lib/qt6/bin/qmllint &> /dev/null; then
/usr/lib/qt6/bin/qmllint $QML_FILES
else
echo "No qmllint found, skipping check!"
fi

View file

@ -312,7 +312,7 @@ linting:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine:latest
tags: [docker]
before_script:
- apk update && apk add make git python3 py3-pip
- apk update && apk add make git python3 py3-pip qt6-qtdeclarative-dev
- apk add clang-extra-tools --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main
- export PATH="$PATH:/root/.local/bin"
- pip3 install --user reuse

67
.qmllint.ini Normal file
View file

@ -0,0 +1,67 @@
[General]
AdditionalQmlImportPaths=
DisableDefaultImports=false
DisablePlugins=
OverwriteImportTypes=
ResourcePath=
[Warnings]
#AccessSingletonViaObject=warning
#AttachedPropertyReuse=disable
#BadSignalHandlerParameters=warning
#CompilerWarnings=disable
#Deprecated=warning
#DuplicatePropertyBinding=warning
#DuplicatedName=warning
#ImportFailure=warning
#IncompatibleType=warning
#InheritanceCycle=warning
#InvalidLintDirective=warning
#LintPluginWarnings=disable
#MissingProperty=warning
#MissingType=warning
#MultilineStrings=info
#NonListProperty=warning
#PrefixedImportType=warning
#PropertyAliasCycles=warning
#ReadOnlyProperty=warning
#RequiredProperty=warning
#RestrictedType=warning
#TopLevelComponent=warning
#UncreatableType=warning
#UnqualifiedAccess=warning
#UnresolvedType=warning
#UnusedImports=info
#UseProperFunction=warning
#VarUsedBeforeDeclaration=warning
#WithStatement=warning
AccessSingletonViaObject=disable
AttachedPropertyReuse=disable
BadSignalHandlerParameters=disable
CompilerWarnings=disable
Deprecated=disable
DuplicatePropertyBinding=disable
DuplicatedName=disable
ImportFailure=disable
IncompatibleType=disable
InheritanceCycle=disable
InvalidLintDirective=disable
LintPluginWarnings=disable
MissingProperty=disable
MissingType=disable
MultilineStrings=info
NonListProperty=disable
PrefixedImportType=disable
PropertyAliasCycles=disable
ReadOnlyProperty=disable
RequiredProperty=disable
RestrictedType=disable
TopLevelComponent=disable
UncreatableType=disable
UnqualifiedAccess=disable
UnresolvedType=disable
UnusedImports=info
UseProperFunction=disable
VarUsedBeforeDeclaration=disable
WithStatement=disable