Skip to content

build: Bump the patch-minor-action-updates group across 1 directory w… #63

build: Bump the patch-minor-action-updates group across 1 directory w…

build: Bump the patch-minor-action-updates group across 1 directory w… #63

Workflow file for this run

name: Guardrails
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tier-1-purity:
name: Tier 1 has no Qt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Everything under ui/ is Tier 1 except the backends that are allowed a toolkit. Phrased as
# an exclusion rather than a list of Tier 1 directories: a list silently stops covering any
# directory added after it was written, which is how ui/charts went unpoliced.
- name: No Qt includes in Tier 1
run: |
offenders=$(grep -rn --include='*.hpp' --include='*.cpp' -E '#include *[<"]Q' ui | grep -v '^ui/backend/qt/' || true)
if [ -n "$offenders" ]; then
echo "::error::Tier 1 directories must not include Qt headers (AGENTS.md invariant 1)"
echo "$offenders"
exit 1
fi
echo "ok: no Qt includes in Tier 1"
- name: No Qt links in Tier 1
run: |
offenders=$(grep -rn --include='CMakeLists.txt' 'Qt6::' ui | grep -v '^ui/backend/qt/' || true)
if [ -n "$offenders" ]; then
echo "::error::Tier 1 targets must not link Qt6:: (AGENTS.md invariant 1)"
echo "$offenders"
exit 1
fi
echo "ok: no Qt links in Tier 1"
- name: setStyleSheet confined to QtTheme.cpp
run: |
# Matches the call, not the name: the rule is about who may style widgets, and the
# header that declares the sanctioned helper has to be able to say so.
offenders=$(grep -rln -E 'setStyleSheet *\(' ui | grep -v '^ui/backend/qt/QtTheme.cpp$' || true)
if [ -n "$offenders" ]; then
echo "::error::setStyleSheet is allowed only in ui/backend/qt/QtTheme.cpp (AGENTS.md invariant 3)"
echo "$offenders"
exit 1
fi
echo "ok: setStyleSheet confined"
- name: No I-prefixed interfaces
run: |
if grep -rn --include='*.hpp' -E '^\s*class I[A-Z][A-Za-z]*$' ui; then
echo "::error::Interfaces use plain role names, no I prefix (AGENTS.md Style)"
exit 1
fi
echo "ok: no I-prefixed interfaces"