add qmllint check with baseline diffing and Qt/Quickshell import paths

This commit is contained in:
Damocles 2026-04-18 15:44:58 +02:00
parent 91cd18cbcd
commit 3944f99316
2 changed files with 119 additions and 0 deletions

View file

@ -86,6 +86,7 @@
clippy
rustfmt
libnotify
qt6.qtdeclarative
];
};
}
@ -98,6 +99,40 @@
build = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
nova-stats = self.packages.${pkgs.stdenv.hostPlatform.system}.nova-stats;
docs = self.packages.${pkgs.stdenv.hostPlatform.system}.docs;
qmllint =
pkgs.runCommand "nova-shell-qmllint"
{
nativeBuildInputs = [ pkgs.qt6.qtdeclarative ];
src = self;
}
''
cd $src
export QML_IMPORT_PATH="${pkgs.qt6.qtdeclarative}/lib/qt-6/qml:${
quickshell.packages.${pkgs.stdenv.hostPlatform.system}.default
}/lib/qt-6/qml"
qmllint -E \
-I shell/modules -I shell/services -I shell/applets -I shell/lock \
shell/shell.qml shell/modules/*.qml shell/services/*.qml \
shell/applets/*.qml shell/lock/*.qml \
> $TMPDIR/output.txt 2>&1 || true
# Extract unique warning messages (file:message, without line numbers)
grep -E "^Warning:" $TMPDIR/output.txt \
| sed 's/^Warning: //' \
| sed 's/\([^:]*\):[0-9]*:[0-9]*: /\1: /' \
| sort -u > $TMPDIR/current.txt
# Diff against known baseline - new warnings = failure
if ! diff -u test/qmllint-baseline.txt $TMPDIR/current.txt > $TMPDIR/diff.txt 2>&1; then
new=$(grep '^+[^+]' $TMPDIR/diff.txt || true)
if [ -n "$new" ]; then
echo "qmllint found new warnings not in baseline:"
echo "$new"
exit 1
fi
fi
cp $TMPDIR/output.txt $out
'';
nova-stats-clippy = (pkgs.callPackage ./nix/stats-daemon.nix { }).overrideAttrs (old: {
pname = "nova-stats-clippy";
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.clippy ];

84
test/qmllint-baseline.txt Normal file
View file

@ -0,0 +1,84 @@
shell/applets/CpuApplet.qml: Member "_barColor" not found on type "QQuickItem" [missing-property]
shell/applets/CpuApplet.qml: Member "_f" not found on type "QQuickItem" [missing-property]
shell/applets/CpuApplet.qml: Member "_throttled" not found on type "QQuickItem" [missing-property]
shell/applets/CpuApplet.qml: Member "index" not found on type "QQuickItem" [missing-property]
shell/applets/CpuApplet.qml: Unqualified access [unqualified]
shell/applets/DiskApplet.qml: Unqualified access [unqualified]
shell/applets/MemoryApplet.qml: Unqualified access [unqualified]
shell/applets/MprisApplet.qml: Member "frac" not found on type "QQuickItem" [missing-property]
shell/applets/MprisApplet.qml: Member "spacing" not found on type "Repeater" [missing-property]
shell/applets/MprisApplet.qml: Unqualified access [unqualified]
shell/applets/TemperatureApplet.qml: Unqualified access [unqualified]
shell/applets/VolumeApplet.qml: Unqualified access [unqualified]
shell/lock/Lock.qml: Unqualified access [unqualified]
shell/lock/LockAuth.qml: Unqualified access [unqualified]
shell/lock/LockSurface.qml: Cannot combine value source and binding on property "opacity" [duplicate-property-binding]
shell/lock/LockSurface.qml: Cannot combine value source and binding on property "scale" [duplicate-property-binding]
shell/lock/LockSurface.qml: Unqualified access [unqualified]
shell/modules/BackgroundOverlay.qml: Type PanelWindow is not creatable. [uncreatable-type]
shell/modules/BacklightModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/Bar.qml: Type PanelWindow is not creatable. [uncreatable-type]
shell/modules/BarGroup.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/BarGroup.qml: Unqualified access [unqualified]
shell/modules/BarIcon.qml: Member "accentColor" not found on type "QQuickItem" [missing-property]
shell/modules/BarIcon.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/BarLabel.qml: Member "accentColor" not found on type "QQuickItem" [missing-property]
shell/modules/BarLabel.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/BarSection.qml: Member "accentColor" not found on type "QQuickItem" [missing-property]
shell/modules/BarSection.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/BatteryModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/BluetoothMenu.qml: Unqualified access [unqualified]
shell/modules/BluetoothModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/BluetoothModule.qml: Unqualified access [unqualified]
shell/modules/CpuModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/DiskModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/Flyout.qml: Could not find property "left". [missing-property]
shell/modules/Flyout.qml: Could not find property "top". [missing-property]
shell/modules/Flyout.qml: Type PanelWindow is not creatable. [uncreatable-type]
shell/modules/Flyout.qml: Type margins is used but it is not resolved [unresolved-type]
shell/modules/Flyout.qml: unknown grouped property scope margins. [unqualified]
shell/modules/GpuModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/HoverPanel.qml: Could not find property "top". [missing-property]
shell/modules/HoverPanel.qml: Type PanelWindow is not creatable. [uncreatable-type]
shell/modules/HoverPanel.qml: Type margins is used but it is not resolved [unresolved-type]
shell/modules/HoverPanel.qml: unknown grouped property scope margins. [unqualified]
shell/modules/MemoryModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/MprisModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/NetworkMenu.qml: Unqualified access [unqualified]
shell/modules/NetworkModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/NotifCard.qml: Unqualified access [unqualified]
shell/modules/NotifCenter.qml: Member "_notif" not found on type "QQuickItem" [missing-property]
shell/modules/NotifCenter.qml: Member "_type" not found on type "QQuickItem" [missing-property]
shell/modules/NotifCenter.qml: Unqualified access [unqualified]
shell/modules/NotifPopup.qml: Could not find property "right". [missing-property]
shell/modules/NotifPopup.qml: Could not find property "top". [missing-property]
shell/modules/NotifPopup.qml: Type PanelWindow is not creatable. [uncreatable-type]
shell/modules/NotifPopup.qml: Type margins is used but it is not resolved [unresolved-type]
shell/modules/NotifPopup.qml: Unqualified access [unqualified]
shell/modules/NotifPopup.qml: unknown grouped property scope margins. [unqualified]
shell/modules/NotificationsModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/NotificationsModule.qml: Unqualified access [unqualified]
shell/modules/OverviewBackdrop.qml: Type PanelWindow is not creatable. [uncreatable-type]
shell/modules/PowerMenu.qml: Unqualified access [unqualified]
shell/modules/PowerModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/PowerModule.qml: Unqualified access [unqualified]
shell/modules/ScreenCapture.qml: Type PanelWindow is not creatable. [uncreatable-type]
shell/modules/ScreenCorners.qml: Type PanelWindow is not creatable. [uncreatable-type]
shell/modules/ScreenCorners.qml: Unqualified access [unqualified]
shell/modules/TemperatureModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/ThemedIcon.qml: Unqualified access [unqualified]
shell/modules/TrayMenu.qml: Unqualified access [unqualified]
shell/modules/TrayModule.qml: Member "length" not found on type "UntypedObjectModel" [missing-property]
shell/modules/TrayModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/TrayModule.qml: Type "qs::dbus::dbusmenu::DBusMenuHandle" of property "menu" not found. This is likely due to a missing dependency entry or a type not being exposed declaratively. [unresolved-type]
shell/modules/TrayModule.qml: Unqualified access [unqualified]
shell/modules/VolumeModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/WindowTitleModule.qml: Unqualified access [unqualified]
shell/modules/WorkspacesModule.qml: Member "screen" not found on type "QObject" [missing-property]
shell/modules/WorkspacesModule.qml: Unqualified access [unqualified]
shell/services/BluetoothService.qml: Unqualified access [unqualified]
shell/services/LockService.qml: Type QProcess::ExitStatus of parameter exitStatus in signal called exited was not found, but is required to compile onExited. Did you add all imports and dependencies? [signal-handler-parameters]
shell/services/LockService.qml: Unqualified access [unqualified]
shell/services/MprisService.qml: Unqualified access [unqualified]
shell/services/PowerProfileService.qml: Unqualified access [unqualified]
shell/shell.qml: Unqualified access [unqualified]