blob: 4cca4d81142b7e7ace5878edd43942c2887b4248 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#!/usr/bin/env bash
# Author: cirakg & claude ai
# Summary: All static checks: project policy, Python lint and types, and strict Monkey C builds without warnings.
#
# Usage: lint.sh DEVICE [DEVICE ...]
#
# 1. tools/lint_project.py: project rules (headers, no logging, no network, ...)
# 2. ruff (lint + formatting) and mypy --strict on the Python tools
# 3. tools/gen_products.py --check: the manifest's products meet the targets
# tools/check_resources.py: resource XML valid against the SDK's
# resources.xsd; settings, properties and strings agree
# 4. Debug and release builds with strict type checking (-l 3) on each device;
# build-app.sh fails on any compiler warning.
set -euo pipefail
# shellcheck source=ciq-env.sh
source "$(dirname "${BASH_SOURCE[0]}")/ciq-env.sh"
(($# > 0)) || die "usage: lint.sh DEVICE [DEVICE ...]"
log "project policy"
python3 /work/tools/lint_project.py /work
log "Python tools: ruff and mypy"
ruff check /work/tools /work/spike
ruff format --check /work/tools /work/spike
(cd /work && mypy)
log "product list"
python3 /work/tools/gen_products.py --check
log "resource XML against the SDK schema, settings cross-check"
ciq_require_sdk
python3 /work/tools/check_resources.py /work
for device in "$@"; do
build-app.sh debug "${device}"
build-app.sh release "${device}"
done
log "lint passed"
|