fix: format ci (#1513)
* fix: remove _-prefixed ids qmlformat crashes cause of them * fix: pin ci image to Qt 6.11.0 6.11.1 is the broken qmlformat version * chore: format c++ * ci: print tool versions at start of ci
This commit is contained in:
parent
2b63ffe70c
commit
c85dfc6a1b
6 changed files with 53 additions and 43 deletions
2
.github/workflows/check-format.yml
vendored
2
.github/workflows/check-format.yml
vendored
|
|
@ -18,6 +18,7 @@ jobs:
|
||||||
- name: Check QML format
|
- name: Check QML format
|
||||||
shell: fish {0}
|
shell: fish {0}
|
||||||
run: |
|
run: |
|
||||||
|
/usr/lib/qt6/bin/qmlformat --version
|
||||||
for file in (string match -v 'build/*' **.qml)
|
for file in (string match -v 'build/*' **.qml)
|
||||||
/usr/lib/qt6/bin/qmlformat $file | diff -u $file - || exit 1
|
/usr/lib/qt6/bin/qmlformat $file | diff -u $file - || exit 1
|
||||||
end
|
end
|
||||||
|
|
@ -34,5 +35,6 @@ jobs:
|
||||||
- name: Check C++ format
|
- name: Check C++ format
|
||||||
shell: fish {0}
|
shell: fish {0}
|
||||||
run: |
|
run: |
|
||||||
|
clang-format --version
|
||||||
find plugin extras -name '*.cpp' -o -name '*.hpp' \
|
find plugin extras -name '*.cpp' -o -name '*.hpp' \
|
||||||
| xargs clang-format --dry-run --Werror
|
| xargs clang-format --dry-run --Werror
|
||||||
|
|
|
||||||
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
|
|
@ -25,6 +25,8 @@ jobs:
|
||||||
- name: Lint QML
|
- name: Lint QML
|
||||||
shell: fish {0}
|
shell: fish {0}
|
||||||
run: |
|
run: |
|
||||||
|
/usr/lib/qt6/bin/qmllint --version
|
||||||
|
|
||||||
# Generate tooling
|
# Generate tooling
|
||||||
touch .qmlls.ini
|
touch .qmlls.ini
|
||||||
QT_QPA_PLATFORM=offscreen QML2_IMPORT_PATH="$PWD/build/qml:$QML2_IMPORT_PATH" timeout 2 qs -p .
|
QT_QPA_PLATFORM=offscreen QML2_IMPORT_PATH="$PWD/build/qml:$QML2_IMPORT_PATH" timeout 2 qs -p .
|
||||||
|
|
|
||||||
8
.github/workflows/update-image.yml
vendored
8
.github/workflows/update-image.yml
vendored
|
|
@ -23,7 +23,13 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cat > /tmp/Dockerfile <<EOF
|
cat > /tmp/Dockerfile <<EOF
|
||||||
FROM archlinux:latest
|
FROM archlinux:latest
|
||||||
RUN pacman -Syu --needed --noconfirm sudo base-devel cmake ninja fish git clazy qt6-declarative qt6-shadertools python libpipewire aubio libqalculate && \
|
# TEMPORARY (remove once the upstream qmlformat regression is fixed): pin to the
|
||||||
|
# 2026-05-13 Arch archive snapshot to hold qmlformat at qt6-declarative 6.11.0.
|
||||||
|
# qt6-declarative 6.11.1 silently crashes qmlformat (exit 1, empty output) on QML files
|
||||||
|
# that declare a property named 'id'. To unpin: delete the mirrorlist line below and
|
||||||
|
# change 'pacman -Syyuu' back to 'pacman -Syu'.
|
||||||
|
RUN echo 'Server = https://archive.archlinux.org/repos/2026/05/13/\$repo/os/\$arch' > /etc/pacman.d/mirrorlist && \
|
||||||
|
pacman -Syyuu --needed --noconfirm sudo base-devel cmake ninja fish git clazy qt6-declarative qt6-shadertools python libpipewire aubio libqalculate && \
|
||||||
useradd -m builder && \
|
useradd -m builder && \
|
||||||
echo 'builder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
|
echo 'builder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
|
||||||
sudo -u builder git clone https://aur.archlinux.org/yay-bin.git /home/builder/yay-bin && \
|
sudo -u builder git clone https://aur.archlinux.org/yay-bin.git /home/builder/yay-bin && \
|
||||||
|
|
|
||||||
|
|
@ -10,25 +10,25 @@ import Caelestia.Config
|
||||||
Item {
|
Item {
|
||||||
id: model
|
id: model
|
||||||
|
|
||||||
property alias visibleModel: _visibleModel
|
property alias visibleModel: visibleModel
|
||||||
property string activeLabel: ""
|
property string activeLabel: ""
|
||||||
property int activeIndex: -1
|
property int activeIndex: -1
|
||||||
property var _xkbMap: ({})
|
property var _xkbMap: ({})
|
||||||
property bool _notifiedLimit: false
|
property bool _notifiedLimit: false
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
_xkbXmlBase.running = true;
|
xkbXmlBase.running = true;
|
||||||
_getKbLayoutOpt.running = true;
|
getKbLayoutOpt.running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function refresh() {
|
function refresh() {
|
||||||
_notifiedLimit = false;
|
_notifiedLimit = false;
|
||||||
_getKbLayoutOpt.running = true;
|
getKbLayoutOpt.running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function switchTo(idx) {
|
function switchTo(idx) {
|
||||||
_switchProc.command = ["hyprctl", "switchxkblayout", "all", String(idx)];
|
switchProc.command = ["hyprctl", "switchxkblayout", "all", String(idx)];
|
||||||
_switchProc.running = true;
|
switchProc.running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function _buildXmlMap(xml) {
|
function _buildXmlMap(xml) {
|
||||||
|
|
@ -50,19 +50,19 @@ Item {
|
||||||
|
|
||||||
_xkbMap = map;
|
_xkbMap = map;
|
||||||
|
|
||||||
if (_layoutsModel.count > 0) {
|
if (layoutsModel.count > 0) {
|
||||||
const tmp = [];
|
const tmp = [];
|
||||||
for (let i = 0; i < _layoutsModel.count; i++) {
|
for (let i = 0; i < layoutsModel.count; i++) {
|
||||||
const it = _layoutsModel.get(i);
|
const it = layoutsModel.get(i);
|
||||||
tmp.push({
|
tmp.push({
|
||||||
layoutIndex: it.layoutIndex,
|
layoutIndex: it.layoutIndex,
|
||||||
token: it.token,
|
token: it.token,
|
||||||
label: _pretty(it.token)
|
label: _pretty(it.token)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
_layoutsModel.clear();
|
layoutsModel.clear();
|
||||||
tmp.forEach(t => _layoutsModel.append(t));
|
tmp.forEach(t => layoutsModel.append(t));
|
||||||
_fetchActiveLayouts.running = true;
|
fetchActiveLayouts.running = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -78,7 +78,7 @@ Item {
|
||||||
|
|
||||||
function _setLayouts(raw) {
|
function _setLayouts(raw) {
|
||||||
const parts = raw.split(",").map(s => s.trim()).filter(Boolean);
|
const parts = raw.split(",").map(s => s.trim()).filter(Boolean);
|
||||||
_layoutsModel.clear();
|
layoutsModel.clear();
|
||||||
|
|
||||||
const seen = new Set();
|
const seen = new Set();
|
||||||
let idx = 0;
|
let idx = 0;
|
||||||
|
|
@ -87,7 +87,7 @@ Item {
|
||||||
if (seen.has(p))
|
if (seen.has(p))
|
||||||
continue;
|
continue;
|
||||||
seen.add(p);
|
seen.add(p);
|
||||||
_layoutsModel.append({
|
layoutsModel.append({
|
||||||
layoutIndex: idx,
|
layoutIndex: idx,
|
||||||
token: p,
|
token: p,
|
||||||
label: _pretty(p)
|
label: _pretty(p)
|
||||||
|
|
@ -97,19 +97,19 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _rebuildVisible() {
|
function _rebuildVisible() {
|
||||||
_visibleModel.clear();
|
visibleModel.clear();
|
||||||
|
|
||||||
let arr = [];
|
let arr = [];
|
||||||
for (let i = 0; i < _layoutsModel.count; i++)
|
for (let i = 0; i < layoutsModel.count; i++)
|
||||||
arr.push(_layoutsModel.get(i));
|
arr.push(layoutsModel.get(i));
|
||||||
|
|
||||||
arr = arr.filter(i => i.layoutIndex !== activeIndex);
|
arr = arr.filter(i => i.layoutIndex !== activeIndex);
|
||||||
arr.forEach(i => _visibleModel.append(i));
|
arr.forEach(i => visibleModel.append(i));
|
||||||
|
|
||||||
if (!GlobalConfig.utilities.toasts.kbLimit)
|
if (!GlobalConfig.utilities.toasts.kbLimit)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_layoutsModel.count > 4) {
|
if (layoutsModel.count > 4) {
|
||||||
Toaster.toast(qsTr("Keyboard layout limit"), qsTr("XKB supports only 4 layouts at a time"), "warning");
|
Toaster.toast(qsTr("Keyboard layout limit"), qsTr("XKB supports only 4 layouts at a time"), "warning");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -124,26 +124,26 @@ Item {
|
||||||
visible: false
|
visible: false
|
||||||
|
|
||||||
ListModel {
|
ListModel {
|
||||||
id: _visibleModel
|
id: visibleModel
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel {
|
ListModel {
|
||||||
id: _layoutsModel
|
id: layoutsModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: _xkbXmlBase
|
id: xkbXmlBase
|
||||||
|
|
||||||
command: ["xmllint", "--xpath", "//layout/configItem[name and description]", "/usr/share/X11/xkb/rules/base.xml"]
|
command: ["xmllint", "--xpath", "//layout/configItem[name and description]", "/usr/share/X11/xkb/rules/base.xml"]
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
onStreamFinished: model._buildXmlMap(text)
|
onStreamFinished: model._buildXmlMap(text)
|
||||||
}
|
}
|
||||||
onRunningChanged: if (!running && (typeof _xkbXmlBase.exitCode !== "undefined") && _xkbXmlBase.exitCode !== 0) // qmllint disable missing-property
|
onRunningChanged: if (!running && (typeof xkbXmlBase.exitCode !== "undefined") && xkbXmlBase.exitCode !== 0) // qmllint disable missing-property
|
||||||
_xkbXmlEvdev.running = true
|
xkbXmlEvdev.running = true
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: _xkbXmlEvdev
|
id: xkbXmlEvdev
|
||||||
|
|
||||||
command: ["xmllint", "--xpath", "//layout/configItem[name and description]", "/usr/share/X11/xkb/rules/evdev.xml"]
|
command: ["xmllint", "--xpath", "//layout/configItem[name and description]", "/usr/share/X11/xkb/rules/evdev.xml"]
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
|
|
@ -152,7 +152,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: _getKbLayoutOpt
|
id: getKbLayoutOpt
|
||||||
|
|
||||||
command: ["hyprctl", "-j", "getoption", "input:kb_layout"]
|
command: ["hyprctl", "-j", "getoption", "input:kb_layout"]
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
|
|
@ -162,17 +162,17 @@ Item {
|
||||||
const raw = (j?.str || j?.value || "").toString().trim();
|
const raw = (j?.str || j?.value || "").toString().trim();
|
||||||
if (raw.length) {
|
if (raw.length) {
|
||||||
model._setLayouts(raw);
|
model._setLayouts(raw);
|
||||||
_fetchActiveLayouts.running = true;
|
fetchActiveLayouts.running = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
_fetchLayoutsFromDevices.running = true;
|
fetchLayoutsFromDevices.running = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: _fetchLayoutsFromDevices
|
id: fetchLayoutsFromDevices
|
||||||
|
|
||||||
command: ["hyprctl", "-j", "devices"]
|
command: ["hyprctl", "-j", "devices"]
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
|
|
@ -184,13 +184,13 @@ Item {
|
||||||
if (raw.length)
|
if (raw.length)
|
||||||
model._setLayouts(raw);
|
model._setLayouts(raw);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
_fetchActiveLayouts.running = true;
|
fetchActiveLayouts.running = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: _fetchActiveLayouts
|
id: fetchActiveLayouts
|
||||||
|
|
||||||
command: ["hyprctl", "-j", "devices"]
|
command: ["hyprctl", "-j", "devices"]
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
|
|
@ -201,7 +201,7 @@ Item {
|
||||||
const idx = kb?.active_layout_index ?? -1;
|
const idx = kb?.active_layout_index ?? -1;
|
||||||
|
|
||||||
model.activeIndex = idx >= 0 ? idx : -1;
|
model.activeIndex = idx >= 0 ? idx : -1;
|
||||||
model.activeLabel = (idx >= 0 && idx < _layoutsModel.count) ? _layoutsModel.get(idx).label : "";
|
model.activeLabel = (idx >= 0 && idx < layoutsModel.count) ? layoutsModel.get(idx).label : "";
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
model.activeIndex = -1;
|
model.activeIndex = -1;
|
||||||
model.activeLabel = "";
|
model.activeLabel = "";
|
||||||
|
|
@ -213,9 +213,9 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: _switchProc
|
id: switchProc
|
||||||
|
|
||||||
onRunningChanged: if (!running)
|
onRunningChanged: if (!running)
|
||||||
_fetchActiveLayouts.running = true
|
fetchActiveLayouts.running = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ Singleton {
|
||||||
readonly property real uploadTotal: _uploadTotal
|
readonly property real uploadTotal: _uploadTotal
|
||||||
|
|
||||||
// History buffers for sparkline
|
// History buffers for sparkline
|
||||||
readonly property CircularBuffer downloadBuffer: _downloadBuffer
|
readonly property alias downloadBuffer: downloadHistory
|
||||||
readonly property CircularBuffer uploadBuffer: _uploadBuffer
|
readonly property alias uploadBuffer: uploadHistory
|
||||||
readonly property int historyLength: 30
|
readonly property int historyLength: 30
|
||||||
|
|
||||||
// Private properties
|
// Private properties
|
||||||
|
|
@ -137,13 +137,13 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
CircularBuffer {
|
CircularBuffer {
|
||||||
id: _downloadBuffer
|
id: downloadHistory
|
||||||
|
|
||||||
capacity: root.historyLength + 1
|
capacity: root.historyLength + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
CircularBuffer {
|
CircularBuffer {
|
||||||
id: _uploadBuffer
|
id: uploadHistory
|
||||||
|
|
||||||
capacity: root.historyLength + 1
|
capacity: root.historyLength + 1
|
||||||
}
|
}
|
||||||
|
|
@ -200,10 +200,10 @@ Singleton {
|
||||||
root._uploadSpeed = txDelta / timeDelta;
|
root._uploadSpeed = txDelta / timeDelta;
|
||||||
|
|
||||||
if (root._downloadSpeed >= 0 && isFinite(root._downloadSpeed))
|
if (root._downloadSpeed >= 0 && isFinite(root._downloadSpeed))
|
||||||
_downloadBuffer.push(root._downloadSpeed);
|
downloadHistory.push(root._downloadSpeed);
|
||||||
|
|
||||||
if (root._uploadSpeed >= 0 && isFinite(root._uploadSpeed))
|
if (root._uploadSpeed >= 0 && isFinite(root._uploadSpeed))
|
||||||
_uploadBuffer.push(root._uploadSpeed);
|
uploadHistory.push(root._uploadSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate totals with overflow handling
|
// Calculate totals with overflow handling
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue