Skip to content

ci: check-qml fails after 2026-05-31 flake update (qmlformat outputs empty for files using as type cast) #1506

@Mentigen

Description

@Mentigen

What happened

After the [CI] chore: update flake commit from 2026-05-31 (63bb827), the check-qml CI job fails on any open PR. The formatter outputs an empty file for modules/bar/Bar.qml (and likely other files), causing diff to see the entire file as removed.

Observed via PR #1457, which does not touch Bar.qml at all.

Root cause

Bar.qml (and several other files in the repo) use the inline type assertion syntax introduced in Qt 6:

const loader = repeater.itemAt(i) as WrappedLoader;

Some versions of qmlformat do not parse the as TypeName expression correctly and silently output nothing instead of the formatted file. When the flake was updated today, the pinned Qt/qmlformat version appears to have changed to one that regresses on this syntax.

The CI script exits on the first failure:

for file in (string match -v 'build/*' **.qml)
    /usr/lib/qt6/bin/qmlformat $file | diff -u $file - || exit 1
end

modules/bar/Bar.qml comes first alphabetically, so the job stops there.

Possible fixes

  • Pin the flake to a Qt version where qmlformat handles as correctly.
  • Upgrade to a Qt version where the regression is fixed.
  • Rewrite the affected as casts to a style that the current qmlformat accepts (if one exists).
  • Skip files that use as casts in the format check until upstream qmlformat support is stable.

Affected files

At minimum modules/bar/Bar.qml. Other files using the same syntax are likely affected too but the CI exits before reaching them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions