diff --git a/.gitea/workflows/ci-image.yml b/.gitea/workflows/ci-image.yml index 3ee05f3..147a3df 100644 --- a/.gitea/workflows/ci-image.yml +++ b/.gitea/workflows/ci-image.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 - name: Install Docker CLI - run: apk add --no-cache docker-cli + run: apk add --no-cache docker-cli docker-cli-buildx - name: Login to registry run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.aramjonghu.dev --username aramjonghu --password-stdin diff --git a/.gitea/workflows/cpp.yml b/.gitea/workflows/cpp.yml index 90eb487..f990c90 100644 --- a/.gitea/workflows/cpp.yml +++ b/.gitea/workflows/cpp.yml @@ -17,46 +17,47 @@ jobs: run: | find . \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) \ -not -path './build/*' \ - -exec clang-format -i --style=file {} + - git diff --exit-code && echo "clang-format: passed" + -exec clang-format --dry-run -Werror --style=file {} + - build: + build & lint: runs-on: alpine container: image: git.aramjonghu.dev/aramjonghu/zshell-ci:latest - steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Configure - run: cmake -B build -G Ninja -DENABLE_MODULES=plugin -DCMAKE_BUILD_TYPE=Release - - - name: Build - run: ninja -C build - - clang-tidy: - runs-on: alpine - container: - image: git.aramjonghu.dev/aramjonghu/zshell-ci:latest - - steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Cache CMake build + uses: actions/cache@v4 with: - fetch-depth: 0 + path: build + key: cpp-build-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt') }} + restore-keys: | + cpp-build- + + - name: Cache ccache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ccache-${{ runner.os }}-${{ github.sha }} + restore-keys: | + ccache-${{ runner.os }}- - name: Configure run: cmake -B build -G Ninja -DENABLE_MODULES=plugin -DCMAKE_BUILD_TYPE=Release - name: Build run: ninja -C build + env: + CMAKE_CXX_COMPILER_LAUNCHER: ccache - name: clang-tidy run: | sed -i 's/-mno-direct-extern-access //g' build/compile_commands.json set -o pipefail - run-clang-tidy -p build -j $(nproc) -header-filter="Plugins/.*" 2>&1 | \ - grep -v 'Suppressed\|non-user\|non-system\|unknown argument.*mno-direct\|Found compiler error\|warnings generated\.\|^Use -header-filter' + run-clang-tidy -p build -j "$(nproc)" \ + -source-filter="^$(pwd)/Plugins/" \ + -header-filter=".*Plugins/.*" \ + -removed-arg=-mno-direct-extern-access diff --git a/.gitea/workflows/js-ts.yml b/.gitea/workflows/js-ts.yml index 639adaf..ce8672f 100644 --- a/.gitea/workflows/js-ts.yml +++ b/.gitea/workflows/js-ts.yml @@ -4,7 +4,7 @@ on: pull_request: jobs: - fmt: + fmt & lint: runs-on: alpine container: node:26-alpine @@ -24,20 +24,6 @@ jobs: else echo "No JS/TS files found" fi - - lint: - runs-on: alpine - container: node:26-alpine - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install tools - run: | - apk add --no-cache \ - git - - name: ESLint run: | if [ -n "$(find . \( -iname "*.js" -o -iname "*.jsx" -o -iname "*.ts" -o -iname "*.tsx" -o -iname "*.mjs" -o -iname "*.cjs" \) -print -quit)" ]; then diff --git a/.gitea/workflows/python.yml b/.gitea/workflows/python.yml index 06377a8..ac44cd9 100644 --- a/.gitea/workflows/python.yml +++ b/.gitea/workflows/python.yml @@ -7,7 +7,7 @@ on: pull_request: jobs: - static: + fmt & lint: runs-on: debian container: node:26-trixie-slim @@ -33,7 +33,7 @@ jobs: . .venv/bin/activate ruff check . - verify: + test & nuitka build: if: always() runs-on: debian container: node:26-trixie-slim @@ -64,4 +64,4 @@ jobs: - name: Nuitka module check run: | . .venv/bin/activate - nuitka --module --include-package=zshell cli/src/zshell/ \ No newline at end of file + nuitka --module --include-package=zshell cli/src/zshell/ diff --git a/.gitea/workflows/rust.yml b/.gitea/workflows/rust.yml index da2d4bf..9e840b4 100644 --- a/.gitea/workflows/rust.yml +++ b/.gitea/workflows/rust.yml @@ -4,149 +4,77 @@ on: pull_request: jobs: - build: + clippy & fmt: runs-on: alpine - container: node:26-alpine + container: rust:alpine env: CARGO_HOME: ${{ github.workspace }}/.cargo steps: + - name: Install node for actions + run: | + apk add --no-cache nodejs git + + - name: Install rust components + run: | + rustup component add clippy rustfmt + cargo clippy --version + rustfmt --version + - name: Checkout uses: actions/checkout@v4 - name: Cache cargo packages uses: actions/cache@v4 - env: - cache-name: cache-cargo-packages with: path: | .cargo/registry .cargo/git target - key: rust-build-${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }} + key: rust-build-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - rust-${{ runner.os }}-build-${{ env.cache-name }}- - rust-${{ runner.os }}-build- - rust- + rust-${{ runner.os }}-cargo- - - name: Install tools + - name: Clippy (with compile check) run: | - apk add --no-cache \ - git \ - cargo \ - rust - - - name: Cargo check - run: | - if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then - for manifest in $(find . -name "Cargo.toml"); do - cargo check --manifest-path "$manifest" && \ - echo "$manifest: check passed" || \ - { echo "$manifest: check failed"; exit 1; } - done - elif [ -n "$(find . -name "*.rs" -print -quit)" ]; then - echo "Rust files found but no Cargo.toml" - exit 1 - else + manifests=$(find . \( -name .cargo -o -name .git -o -name target \) -prune -o -name Cargo.toml -print) + if [ -z "$manifests" ]; then + if [ -n "$(find . \( -name .cargo -o -name target \) -prune -o -name '*.rs' -print -quit)" ]; then + echo "Rust files found but no Cargo.toml" + exit 1 + fi echo "No Rust project found" + exit 0 fi - - fmt: - runs-on: alpine - container: node:26-alpine - env: - CARGO_HOME: ${{ github.workspace }}/.cargo - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Cache cargo packages - uses: actions/cache@v4 - env: - cache-name: cache-cargo-packages - with: - path: | - .cargo/registry - .cargo/git - target - key: rust-fmt-${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - rust-${{ runner.os }}-build-${{ env.cache-name }}- - rust-${{ runner.os }}-build- - rust- - - - name: Install tools - run: | - apk add --no-cache \ - git \ - cargo \ - rust \ - rustfmt + status=0 + for manifest in $manifests; do + if (cd "$(dirname "$manifest")" && cargo clippy --all-targets --locked -- -D warnings); then + echo "$manifest: Clippy passed" + else + echo "$manifest: Clippy failed" + status=1 + fi + done + exit $status - name: Format check run: | - if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then - status=0 - for manifest in $(find . -name "Cargo.toml"); do - cargo fmt --manifest-path "$manifest" --check && \ - echo "$manifest: formatting OK" || \ - { echo "$manifest: needs formatting"; status=1; } - done - exit $status - elif [ -n "$(find . -name "*.rs" -print -quit)" ]; then - echo "Rust files found but no Cargo.toml" - exit 1 - else - echo "No Rust project found" - fi - - clippy: - runs-on: alpine - container: node:26-alpine - env: - CARGO_HOME: ${{ github.workspace }}/.cargo - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Cache cargo packages - uses: actions/cache@v4 - env: - cache-name: cache-cargo-packages - with: - path: | - .cargo/registry - .cargo/git - target - key: rust-clippy-${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - rust-${{ runner.os }}-build-${{ env.cache-name }}- - rust-${{ runner.os }}-build- - rust- - - - name: Install tools - run: | - apk add --no-cache \ - git \ - cargo \ - rust \ - rust-clippy - - - name: Clippy - run: | - if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then - status=0 - for manifest in $(find . -name "Cargo.toml"); do - cargo clippy --manifest-path "$manifest" --all-targets --all-features -- -D warnings && \ - echo "$manifest: Clippy passed" || \ - { echo "$manifest: Clippy failed"; status=1; } - done - exit $status - elif [ -n "$(find . -name "*.rs" -print -quit)" ]; then - echo "Rust files found but no Cargo.toml" - exit 1 - else + manifests=$(find . \( -name .cargo -o -name .git -o -name target \) -prune -o -name Cargo.toml -print) + if [ -z "$manifests" ]; then + if [ -n "$(find . \( -name .cargo -o -name target \) -prune -o -name '*.rs' -print -quit)" ]; then + echo "Rust files found but no Cargo.toml" + exit 1 + fi echo "No Rust project found" + exit 0 fi + status=0 + for manifest in $manifests; do + if (cd "$(dirname "$manifest")" && cargo fmt --check); then + echo "$manifest: formatting OK" + else + echo "$manifest: needs formatting" + status=1 + fi + done + exit $status diff --git a/.gitignore b/.gitignore index c6ff3ec..b2b5a49 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,38 @@ -**/__pycache__/ ./result/ .pyre/ -.cache/ -.venv/ -.qmlls.ini -build/ -compile_commands.json -testpython pkg/ *.tar.* -uv.lock -.qtcreator/ dist/ **/target/ **/test-plugins/ **/Charts/ network-dev/ -**/zshell.build/ **/zshell.dist/ + +# Qml +.qtcreator/ +.qmlls.ini + +# CMake compile artifacts +.cache/ +compile_commands.json +build/ + +# Cargo home (CI sets CARGO_HOME inside the workspace) +.cargo/ + +# Python +uv.lock +testpython +.venv/ +**/__pycache__/ + +# Nuitka compile +**/zshell.pyi +**/zshell.cpython-* +**/zshell.build/ + +# Agents stuff .opencode/ run-agent.sh AGENTS.md diff --git a/Components/CircularProgress.qml b/Components/CircularProgress.qml index 3e85179..27d1fc8 100644 --- a/Components/CircularProgress.qml +++ b/Components/CircularProgress.qml @@ -76,8 +76,7 @@ Item { strokeWidth: Math.max(1, Math.round(Math.min(1, remainingArc.sweepAngle) * root.strokeDev)) / root.dpr Behavior on strokeColor { - CAnim { - } + CAnim {} } PathAngleArc { @@ -115,8 +114,7 @@ Item { } } Behavior on color { - CAnim { - } + CAnim {} } Anim on waveProgress { id: waveProgAnim diff --git a/Components/ColorArcPicker.qml b/Components/ColorArcPicker.qml index 43b9c34..de580e1 100644 --- a/Components/ColorArcPicker.qml +++ b/Components/ColorArcPicker.qml @@ -160,8 +160,7 @@ Item { Behavior on color { enabled: false - CAnim { - } + CAnim {} } } diff --git a/Components/Coloriser.qml b/Components/Coloriser.qml index 77bdf8d..4de1dca 100644 --- a/Components/Coloriser.qml +++ b/Components/Coloriser.qml @@ -8,7 +8,6 @@ MultiEffect { colorization: 1 Behavior on colorizationColor { - CAnim { - } + CAnim {} } } diff --git a/Components/CustomClippingRect.qml b/Components/CustomClippingRect.qml index 9498a06..dc4c75a 100644 --- a/Components/CustomClippingRect.qml +++ b/Components/CustomClippingRect.qml @@ -7,7 +7,6 @@ ClippingRectangle { color: "transparent" Behavior on color { - CAnim { - } + CAnim {} } } diff --git a/Components/CustomClippingWrapperRect.qml b/Components/CustomClippingWrapperRect.qml index 0ff1995..7913be1 100644 --- a/Components/CustomClippingWrapperRect.qml +++ b/Components/CustomClippingWrapperRect.qml @@ -7,7 +7,6 @@ ClippingWrapperRectangle { color: "transparent" Behavior on color { - CAnim { - } + CAnim {} } } diff --git a/Components/CustomSwitch.qml b/Components/CustomSwitch.qml index bb25a54..b6a13530 100644 --- a/Components/CustomSwitch.qml +++ b/Components/CustomSwitch.qml @@ -105,20 +105,16 @@ Switch { width: height Behavior on end1 { - PropAnim { - } + PropAnim {} } Behavior on end2 { - PropAnim { - } + PropAnim {} } Behavior on start1 { - PropAnim { - } + PropAnim {} } Behavior on start2 { - PropAnim { - } + PropAnim {} } ShapePath { @@ -134,8 +130,7 @@ Switch { strokeWidth: 16 * 0.15 Behavior on strokeColor { - CAnim { - } + CAnim {} } PathLine { diff --git a/Components/CustomText.qml b/Components/CustomText.qml index 5445f5f..e8ee2b8 100644 --- a/Components/CustomText.qml +++ b/Components/CustomText.qml @@ -20,8 +20,7 @@ Text { textFormat: Text.PlainText Behavior on color { - CAnim { - } + CAnim {} } Behavior on text { enabled: root.animate @@ -33,8 +32,7 @@ Text { type: Anim.FastEffects } - PropertyAction { - } + PropertyAction {} TAnim { target: root diff --git a/Components/FadeImage.qml b/Components/FadeImage.qml index 79617aa..786e3a8 100644 --- a/Components/FadeImage.qml +++ b/Components/FadeImage.qml @@ -65,8 +65,7 @@ Image { value: root.source } - PropertyAction { - } + PropertyAction {} ScriptAction { script: root.maybeStartInAnim() diff --git a/Components/LoadingIndicator.qml b/Components/LoadingIndicator.qml index 2e1132a..21ceaea 100644 --- a/Components/LoadingIndicator.qml +++ b/Components/LoadingIndicator.qml @@ -64,8 +64,7 @@ MaterialShape { to: 360 } Behavior on color { - CAnim { - } + CAnim {} } ElapsedTimer { diff --git a/Components/MarqueeText.qml b/Components/MarqueeText.qml index 7d3d12d..aac13df 100644 --- a/Components/MarqueeText.qml +++ b/Components/MarqueeText.qml @@ -47,12 +47,10 @@ Item { implicitWidth: vertical ? elideText.implicitHeight : elideText.implicitWidth Behavior on leftFadeStrength { - Anim { - } + Anim {} } Behavior on rightFadeStrength { - Anim { - } + Anim {} } onHeightChanged: resetMarquee() diff --git a/Components/SplitButton.qml b/Components/SplitButton.qml index 5b0c0f8..2467695 100644 --- a/Components/SplitButton.qml +++ b/Components/SplitButton.qml @@ -103,8 +103,7 @@ Row { topLeftRadius: rad Behavior on rad { - Anim { - } + Anim {} } StateLayer { @@ -128,12 +127,10 @@ Row { text: "expand_more" Behavior on anchors.horizontalCenterOffset { - Anim { - } + Anim {} } Behavior on rotation { - Anim { - } + Anim {} } } } diff --git a/Components/Toast/Toasts.qml b/Components/Toast/Toasts.qml index 0c47503..d5f190c 100644 --- a/Components/Toast/Toasts.qml +++ b/Components/Toast/Toasts.qml @@ -44,8 +44,7 @@ Item { onValuesChanged: root.flagChanged() } - ToastWrapper { - } + ToastWrapper {} } component ToastWrapper: MouseArea { @@ -86,12 +85,10 @@ Item { } } Behavior on opacity { - Anim { - } + Anim {} } Behavior on scale { - Anim { - } + Anim {} } Component.onCompleted: modelData.lock(this) diff --git a/Components/WavyTopRect.qml b/Components/WavyTopRect.qml index 90052f3..718d171 100644 --- a/Components/WavyTopRect.qml +++ b/Components/WavyTopRect.qml @@ -20,8 +20,7 @@ Shape { strokeWidth: 0 Behavior on fillColor { - CAnim { - } + CAnim {} } PathSvg { diff --git a/Daemons/Audio.qml b/Daemons/Audio.qml index beac345..72e3aea 100644 --- a/Daemons/Audio.qml +++ b/Daemons/Audio.qml @@ -141,7 +141,6 @@ Singleton { BeatTracker { id: beatTracker - } PwObjectTracker { diff --git a/Daemons/Network.qml b/Daemons/Network.qml index 5604e1c..0dcb7a9 100644 --- a/Daemons/Network.qml +++ b/Daemons/Network.qml @@ -295,8 +295,7 @@ Singleton { Component { id: apComp - AccessPoint { - } + AccessPoint {} } Process { diff --git a/Daemons/Nmcli.qml b/Daemons/Nmcli.qml index 77fa771..d96a45f 100644 --- a/Daemons/Nmcli.qml +++ b/Daemons/Nmcli.qml @@ -1081,15 +1081,13 @@ Singleton { Component { id: commandProc - CommandProcess { - } + CommandProcess {} } Component { id: apComp - AccessPoint { - } + AccessPoint {} } Timer { @@ -1310,7 +1308,6 @@ Singleton { } stdout: StdioCollector { id: stdoutCollector - } onExited: code => { diff --git a/Greeter/Components/CircularProgress.qml b/Greeter/Components/CircularProgress.qml index 59b1bf5..e753280 100644 --- a/Greeter/Components/CircularProgress.qml +++ b/Greeter/Components/CircularProgress.qml @@ -46,8 +46,7 @@ Item { strokeWidth: Math.min(1, remainingArc.sweepAngle) * root.strokeWidth Behavior on strokeColor { - CAnim { - } + CAnim {} } PathAngleArc { @@ -84,8 +83,7 @@ Item { } } Behavior on color { - CAnim { - } + CAnim {} } Anim on waveProgress { id: waveProgAnim diff --git a/Greeter/Components/CustomClippingRect.qml b/Greeter/Components/CustomClippingRect.qml index 9498a06..dc4c75a 100644 --- a/Greeter/Components/CustomClippingRect.qml +++ b/Greeter/Components/CustomClippingRect.qml @@ -7,7 +7,6 @@ ClippingRectangle { color: "transparent" Behavior on color { - CAnim { - } + CAnim {} } } diff --git a/Greeter/Components/CustomText.qml b/Greeter/Components/CustomText.qml index 5445f5f..e8ee2b8 100644 --- a/Greeter/Components/CustomText.qml +++ b/Greeter/Components/CustomText.qml @@ -20,8 +20,7 @@ Text { textFormat: Text.PlainText Behavior on color { - CAnim { - } + CAnim {} } Behavior on text { enabled: root.animate @@ -33,8 +32,7 @@ Text { type: Anim.FastEffects } - PropertyAction { - } + PropertyAction {} TAnim { target: root diff --git a/Greeter/Components/FadeImage.qml b/Greeter/Components/FadeImage.qml index 79617aa..786e3a8 100644 --- a/Greeter/Components/FadeImage.qml +++ b/Greeter/Components/FadeImage.qml @@ -65,8 +65,7 @@ Image { value: root.source } - PropertyAction { - } + PropertyAction {} ScriptAction { script: root.maybeStartInAnim() diff --git a/Greeter/Components/LoadingIndicator.qml b/Greeter/Components/LoadingIndicator.qml index 2e1132a..21ceaea 100644 --- a/Greeter/Components/LoadingIndicator.qml +++ b/Greeter/Components/LoadingIndicator.qml @@ -64,8 +64,7 @@ MaterialShape { to: 360 } Behavior on color { - CAnim { - } + CAnim {} } ElapsedTimer { diff --git a/Greeter/Helpers/Weather.qml b/Greeter/Helpers/Weather.qml index 2254405..11cfae7 100644 --- a/Greeter/Helpers/Weather.qml +++ b/Greeter/Helpers/Weather.qml @@ -200,6 +200,5 @@ Singleton { ElapsedTimer { id: timer - } } diff --git a/Greeter/shell.qml b/Greeter/shell.qml index daedb80..0a8d24c 100644 --- a/Greeter/shell.qml +++ b/Greeter/shell.qml @@ -16,7 +16,6 @@ ShellRoot { GreeterState { id: greeter - } GreeterSurface { diff --git a/Helpers/Brightness.qml b/Helpers/Brightness.qml index 201a40a..09abce2 100644 --- a/Helpers/Brightness.qml +++ b/Helpers/Brightness.qml @@ -69,8 +69,7 @@ Singleton { model: Quickshell.screens - Monitor { - } + Monitor {} } Process { diff --git a/Helpers/IdleInhibitor.qml b/Helpers/IdleInhibitor.qml index 8aad68b..d3da4e3 100644 --- a/Helpers/IdleInhibitor.qml +++ b/Helpers/IdleInhibitor.qml @@ -33,8 +33,7 @@ Singleton { implicitHeight: 0 implicitWidth: 0 - mask: Region { - } + mask: Region {} } } diff --git a/Modules/Dashboard/Dash/Calendar.qml b/Modules/Dashboard/Dash/Calendar.qml index c1e2ea8..6be3a59 100644 --- a/Modules/Dashboard/Dash/Calendar.qml +++ b/Modules/Dashboard/Dash/Calendar.qml @@ -309,12 +309,10 @@ orientation: Qt.Vertical } } Behavior on x { - Anim { - } + Anim {} } Behavior on y { - Anim { - } + Anim {} } onTodayItemChanged: { diff --git a/Modules/Dashboard/Media/BackgroundShapes.qml b/Modules/Dashboard/Media/BackgroundShapes.qml index 1847944..fb8064c 100644 --- a/Modules/Dashboard/Media/BackgroundShapes.qml +++ b/Modules/Dashboard/Media/BackgroundShapes.qml @@ -33,8 +33,7 @@ Item { Repeater { id: shapes - DriftingShape { - } + DriftingShape {} } FrameAnimation { @@ -80,8 +79,7 @@ Item { shape: root.shapePool[Math.floor(Math.random() * root.shapePool.length)] Behavior on color { - CAnim { - } + CAnim {} } Behavior on opacity { Anim { diff --git a/Modules/Dashboard/Media/CoverArt.qml b/Modules/Dashboard/Media/CoverArt.qml index 6cb6f22..bc377b2 100644 --- a/Modules/Dashboard/Media/CoverArt.qml +++ b/Modules/Dashboard/Media/CoverArt.qml @@ -18,8 +18,7 @@ Item { layer.enabled: true Behavior on fallbackColor { - CAnim { - } + CAnim {} } layer.effect: MultiEffect { blurMax: 1 diff --git a/Modules/DesktopIcons/DesktopIconDelegate.qml b/Modules/DesktopIcons/DesktopIconDelegate.qml index 49b212c..9a4cae2 100644 --- a/Modules/DesktopIcons/DesktopIconDelegate.qml +++ b/Modules/DesktopIcons/DesktopIconDelegate.qml @@ -54,14 +54,12 @@ Item { Behavior on x { enabled: !mouseArea.drag.active && !root.isSnapping && !root.iconsRoot.selectedIcons.includes(root.filePath) - Anim { - } + Anim {} } Behavior on y { enabled: !mouseArea.drag.active && !root.isSnapping && !root.iconsRoot.selectedIcons.includes(root.filePath) - Anim { - } + Anim {} } Item { @@ -85,8 +83,7 @@ Item { y: (root.iconsRoot.selectedIcons.includes(root.filePath) && root.iconsRoot.dragLeader !== "" && root.iconsRoot.dragLeader !== root.filePath) ? root.iconsRoot.groupDragY : 0 } transitions: Transition { - Anim { - } + Anim {} } onXChanged: { @@ -208,8 +205,7 @@ Item { radius: Tokens.rounding.small Behavior on opacity { - Anim { - } + Anim {} } } @@ -268,8 +264,7 @@ Item { radius: Tokens.rounding.small Behavior on opacity { - Anim { - } + Anim {} } } } diff --git a/Modules/Dock/Parts/DockAppButton.qml b/Modules/Dock/Parts/DockAppButton.qml index 3a5db6d..44a01a6 100644 --- a/Modules/Dock/Parts/DockAppButton.qml +++ b/Modules/Dock/Parts/DockAppButton.qml @@ -87,8 +87,7 @@ CustomRect { Loader { active: isSeparator - sourceComponent: DockSeparator { - } + sourceComponent: DockSeparator {} anchors { fill: parent diff --git a/Modules/Launcher/CarouselView.qml b/Modules/Launcher/CarouselView.qml old mode 100755 new mode 100644 diff --git a/Modules/Launcher/Services/Actions.qml b/Modules/Launcher/Services/Actions.qml index 135dbc3..7306e04 100644 --- a/Modules/Launcher/Services/Actions.qml +++ b/Modules/Launcher/Services/Actions.qml @@ -22,8 +22,7 @@ Searcher { model: Config.launcher.actions.values.filter(a => (a.enabled ?? true) && (Config.launcher.enableDangerousActions || !(a.dangerous ?? false))) - Action { - } + Action {} } component Action: QtObject { diff --git a/Modules/Resources/Cards/BatteryTank.qml b/Modules/Resources/Cards/BatteryTank.qml index 4d8ed33..a9dd06f 100644 --- a/Modules/Resources/Cards/BatteryTank.qml +++ b/Modules/Resources/Cards/BatteryTank.qml @@ -16,8 +16,7 @@ ClipRect { radius: Tokens.rounding.largeIncreased Behavior on animPerc { - Anim { - } + Anim {} } Contents { diff --git a/Modules/Settings/Common/ConnectedRect.qml b/Modules/Settings/Common/ConnectedRect.qml index 04762a6..cdd5b0c 100644 --- a/Modules/Settings/Common/ConnectedRect.qml +++ b/Modules/Settings/Common/ConnectedRect.qml @@ -22,8 +22,7 @@ CustomRect { topRightRadius: first ? Tokens.rounding.largeIncreased : Tokens.rounding.extraSmall Behavior on opacity { - Anim { - } + Anim {} } CustomRect { diff --git a/Modules/Sidebar/Utils/Background.qml b/Modules/Sidebar/Utils/Background.qml index f312b26..7a873b3 100644 --- a/Modules/Sidebar/Utils/Background.qml +++ b/Modules/Sidebar/Utils/Background.qml @@ -17,8 +17,7 @@ ShapePath { strokeWidth: -1 Behavior on fillColor { - CAnim { - } + CAnim {} } PathLine { diff --git a/Plugins/ZShell/Models/wallpaperdb.cpp b/Plugins/ZShell/Models/wallpaperdb.cpp index ace438d..b70beb2 100644 --- a/Plugins/ZShell/Models/wallpaperdb.cpp +++ b/Plugins/ZShell/Models/wallpaperdb.cpp @@ -653,7 +653,8 @@ void WallpaperDb::queueMetadata( existingCache.isEmpty() ? "" : ", existing blob"); m_queue.append( - MetadataJob{entry, entry->path(), isVideo, existingCache, existingPoster}); + MetadataJob{ + entry, entry->path(), isVideo, existingCache, existingPoster}); if (!m_queueTimer.isActive()) { m_queueTimer.start(); @@ -771,8 +772,8 @@ void WallpaperDb::runMetadataJob(const MetadataJob& job) { QByteArray poster = job.existingPoster; if (poster.isEmpty()) { - poster = - job.isVideo ? videoPosterBytes(job.path, cacheSize) : cache; + poster = job.isVideo ? videoPosterBytes(job.path, cacheSize) + : cache; } result.cache = cache; diff --git a/Plugins/ZShell/Models/wallpaperdb.hpp b/Plugins/ZShell/Models/wallpaperdb.hpp index e41053d..b8cb4b1 100644 --- a/Plugins/ZShell/Models/wallpaperdb.hpp +++ b/Plugins/ZShell/Models/wallpaperdb.hpp @@ -110,8 +110,8 @@ class WallpaperDb : public QObject { [[nodiscard]] static QString thumbnailUrl(const QString& path); - Q_INVOKABLE QVariantMap crop(const QString& path, const QString& screen) - const; + Q_INVOKABLE QVariantMap + crop(const QString& path, const QString& screen) const; Q_INVOKABLE void setCrop( const QString& path, const QString& screen, const QVariantMap& crop); diff --git a/Plugins/ZShell/Wallpaper/videotranscoder.cpp b/Plugins/ZShell/Wallpaper/videotranscoder.cpp index 5e998ab..dfc1d55 100644 --- a/Plugins/ZShell/Wallpaper/videotranscoder.cpp +++ b/Plugins/ZShell/Wallpaper/videotranscoder.cpp @@ -50,7 +50,7 @@ QString VideoTranscoder::codecName(const QString& path) const { if (!probe.waitForFinished(2000) || probe.exitCode() != 0) { qWarning(transcodeLog) << "WallpaperService: ffprobe failed for" << path - << "(exit" << probe.exitCode() << ")"; + << "(exit" << probe.exitCode() << ")"; return {}; } @@ -120,7 +120,7 @@ void VideoTranscoder::start(const QString& src, const QString& dst) { }); qWarning(transcodeLog) << "WallpaperService: transcoding" << src << "->" - << dst; + << dst; proc->setProgram("nice"); proc->setArguments({ diff --git a/Plugins/ZShell/Wallpaper/wallpaperobject.cpp b/Plugins/ZShell/Wallpaper/wallpaperobject.cpp index 143a637..50ee9c6 100644 --- a/Plugins/ZShell/Wallpaper/wallpaperobject.cpp +++ b/Plugins/ZShell/Wallpaper/wallpaperobject.cpp @@ -72,11 +72,9 @@ void WallpaperObject::syncCrop(const QVariantMap& crop) { const qreal y = crop.value("y").toDouble(); const qreal width = crop.contains("width") ? crop.value("width").toDouble() : 1.0; - const qreal height = crop.contains("height") - ? crop.value("height").toDouble() - : 1.0; - const qreal z = - crop.contains("zoom") ? crop.value("zoom").toDouble() : 1.0; + const qreal height = + crop.contains("height") ? crop.value("height").toDouble() : 1.0; + const qreal z = crop.contains("zoom") ? crop.value("zoom").toDouble() : 1.0; const bool prev = m_pushEnabled; m_pushEnabled = false; diff --git a/Services/ShellState.qml b/Services/ShellState.qml index 7d48f4b..7c423f0 100644 --- a/Services/ShellState.qml +++ b/Services/ShellState.qml @@ -34,7 +34,6 @@ Singleton { model: Quickshell.screens - ScreenState { - } + ScreenState {} } } diff --git a/ci/Dockerfile b/ci/Dockerfile index d1b3965..310f217 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -1,56 +1,28 @@ FROM archlinux:latest -RUN pacman -Syyu --noconfirm +RUN pacman -Syu --noconfirm \ + && pacman -S --needed --noconfirm \ + base-devel cmake ninja clang lld nodejs tree-sitter \ + jkqtplotter cmark-gfm git wayland-protocols ffmpeg mpv \ + qt6-base qt6-declarative qt6-shadertools qt6-5compat \ + qt6-canvaspainter qt6-wayland qt5-wayland mpv \ + libqalculate pipewire aubio cava lm_sensors glib2 \ + && pacman -Scc --noconfirm -# Build toolchain -RUN pacman -S --noconfirm \ - base-devel \ - cmake \ - ninja \ - clang \ - lld \ - nodejs \ - tree-sitter \ - jkqtplotter \ - cmark-gfm \ - git - -# Qt6 -RUN pacman -S --noconfirm \ - qt6-base \ - qt6-declarative \ - qt6-shadertools \ - qt6-5compat \ - qt6-canvaspainter - -# Project-specific dependencies -RUN pacman -S --noconfirm \ - libqalculate \ - pipewire \ - aubio \ - cava \ - lm_sensors \ - glib2 - -# AUR: libcava (provides development headers for cava) -RUN pacman -Syu --noconfirm && \ - pacman -S --needed --noconfirm \ - sudo \ - meson \ - autoconf-archive \ - python-tqdm && \ - useradd -m builder && \ - echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers - -RUN for i in 1 2 3 4 5; do \ - rm -rf /tmp/libcava && \ - git clone --depth 1 https://aur.archlinux.org/libcava.git /tmp/libcava && \ - break || sleep 5; \ - done && \ - test -d /tmp/libcava/.git && \ - chown -R builder /tmp/libcava - -RUN su builder -c "cd /tmp/libcava && makepkg -si --noconfirm" && \ - rm -rf /tmp/libcava && \ - userdel -r builder && \ - sed -i '/^builder/d' /etc/sudoers +RUN pacman -Syu --noconfirm \ + && pacman -S --needed --noconfirm \ + sudo meson autoconf-archive python-tqdm \ + && useradd -m builder \ + && printf '%s\n' 'builder ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/builder \ + && chmod 0440 /etc/sudoers.d/builder \ + && for i in 1 2 3 4 5; do \ + rm -rf /tmp/libcava; \ + if git clone --depth 1 https://aur.archlinux.org/libcava.git /tmp/libcava; then break; fi; \ + sleep 5; \ + done \ + && test -d /tmp/libcava/.git \ + && chown -R builder:builder /tmp/libcava \ + && su builder -c "cd /tmp/libcava && makepkg -si --noconfirm" \ + && rm -rf /tmp/libcava /etc/sudoers.d/builder \ + && userdel -r builder \ + && pacman -Scc --noconfirm diff --git a/makefile b/makefile new file mode 100644 index 0000000..81a6ad0 --- /dev/null +++ b/makefile @@ -0,0 +1,114 @@ +BUILD ?= cmake -B build -G Ninja +NONUITKA ?= cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_MODULES="plugin;shell;m3shapes" +NINJA ?= ninja -C build +COMPILE ?= $(BUILD) && $(NINJA) +INSTALL ?= $(BUILD) && $(NINJA) && sudo ninja -C build install + +CPPFMT ?= find . \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -not -path './build/*' -exec clang-format -i --style=file {} + +CPPLINT ?= run-clang-tidy -p build -j "$$(nproc)" -source-filter="^$$(pwd)/Plugins/" -header-filter=".*Plugins/.*" -removed-arg=-mno-direct-extern-access + +NUITKA ?= nuitka --module --include-package=zshell cli/src/zshell/ --output-dir=cli/ + +.DEFAULT_GOAL := help + +# string is misaligned to align when run in terminal +help: + @echo "build cmake builds into build directory" + @echo "install cmake builds, compiles and installs into filesystem" + @echo "compile cmake builds and compiles C++ code" + @echo "cpp-fmt format C++ code with clang-format" + @echo "cpp-lint lint check C++ code with clang-tidy" + @echo "cpp-compile similar to make compile, but excludes Nuitka from compiling python" + @echo "py-fmt format Python code with ruff" + @echo "py-lint lint check Python code with ruff" + @echo "py-check lsp and typecheck all Python code using Basedpyright" + @echo "py-test run all Python tests using Pytest" + @echo "py-compile compiles Python code using Nuitka" + @echo "rs-compile compiles Rust code" + @echo "rs-format formats Rust code with Rustfmt" + @echo "rs-lint lint check Rust code with Clippy" + @echo "rs-test runs all Rust tests" + @echo "qml-fmt format QML code with qmlformat" + @echo "check-cpp runs all C++ checks" + @echo "check-py runs all Python checks" + @echo "check-rs runs all Rust checks" + @echo "make-fmt formats the makefile using mbake (in case you like spaces instead of tabs)" + @echo "cmake-fmt format CMake files with gersemi" + +build: + $(BUILD) + +install: + $(INSTALL) + +compile: + $(COMPILE) + +# C++ +cpp-fmt: + $(CPPFMT) + +cpp-lint: + $(CPPLINT) + +cpp-compile: + $(NONUITKA) + +# Python +py-fmt: + ruff format + +py-lint: + ruff check ./cli + +py-check: + basedpyright + +py-test: + python -m pytest ./cli/tests/ -v + +# Want to use gcc, clang or zig C compiler instead? Output directory? +py-compile: + $(NUITKA) + +# Rust +rs-compile: + cd ./zshell-img-tools/ && cargo run + +rs-fmt: + cd ./zshell-img-tools/ && cargo fmt && echo "formatted!" + +rs-lint: + cd ./zshell-img-tools/ && cargo clippy + +rs-test: + cd ./zshell-img-tools/ && cargo test + +# Qml +qml-fmt: + find -name '*.qml' -exec /usr/lib/qt6/bin/qmlformat -i {} + + +# Full checks +check-cpp: + $(MAKE) cpp-fmt + $(MAKE) cpp-lint + $(MAKE) compile + +check-rs: + $(MAKE) rs-fmt + $(MAKE) rs-lint + $(MAKE) rs-test + $(MAKE) rs-compile + +check-py: + $(MAKE) py-fmt + $(MAKE) py-lint + $(MAKE) py-test + $(MAKE) py-check + $(MAKE) py-compile + +make-fmt: + mbake format makefile + +cmake-fmt: + gersemi -i . \ No newline at end of file