LLM-first low-noise Build@1 guard for HarmonyOS and ArkTS repos.
Project description
hmos-precheck
LLM-first, low-noise Build@1 guard for HarmonyOS / ArkTS repositories.
hmos-precheck is a small CLI for HarmonyOS repositories. It focuses on
changed files, keeps stdout compact, and degrades cleanly when optional
HarmonyOS tooling is not configured.
Features
- runs low-noise SDK-backed checks for ArkTS and CodeLinter
- writes compact repair-oriented JSON instead of dumping raw backend output
- keeps debug artifacts opt-in
- warns clearly when
command-line-toolsorcodelinterare unavailable
Install
pip install hmos-precheck
After install, hmos-precheck is available directly from PATH through the
project.scripts entry point.
Quick start
hmos-precheck doctor --project-root /path/to/project
hmos-precheck init --scope user --commandline-tools /abs/path/to/command-line-tools
hmos-precheck run --project-root /path/to/project --output-dir /tmp/hmos-out
Commands:
hmos-precheck runhmos-precheck doctorhmos-precheck init
Config
User config locations:
- Linux:
~/.config/hmos-precheck/config.json - macOS:
~/Library/Application Support/hmos-precheck/config.json - Windows:
%APPDATA%\\hmos-precheck\\config.json
Project config location:
- repository root:
.hmos-precheck.json
Resolution order:
--commandline-tools- project config:
.hmos-precheck.json - user config: platform-specific
config.json lab_root/config/projects.local.json- environment variable:
HARMONYOS_COMMANDLINE_TOOLS - built-in auto-detect locations
Example config:
{
"toolchain": {
"commandline_tools": "/path/to/command-line-tools"
},
"run": {
"profiles": ["arkts-diff", "codelinter-diff"]
}
}
Profiles
- default:
arkts-diff,codelinter-diff - supported:
arkts-diff,codelinter-diff
codelinter-diff runs the SDK command-line-tools/bin/codelinter only for
changed .ets files, then keeps only diagnostics on changed lines. Only
error diagnostics are blocking; warning and suggestion diagnostics are
kept in artifacts and hidden from the repair payload. This keeps stdout as a
status signal plus compact repair summary, while filtered lint details stay in
--output-dir.
Scan scope
By default, run checks the working tree diff against HEAD:
hmos-precheck run --project-root /path/to/project --output-dir /tmp/hmos-out
This is diff-working-tree mode. It includes changed tracked files and
untracked files that are not ignored by Git. Untracked temporary/generated paths
covered by .gitignore or Git excludes are skipped through git ls-files --others --exclude-standard.
To compare two refs explicitly:
hmos-precheck run \
--project-root /path/to/project \
--output-dir /tmp/hmos-out \
--base-ref origin/main \
--head-ref HEAD
Output
runprints compact JSON intended for repair loopsdoctorprints detailed environment and toolchain discovery state--output-diralways receives run artifactshmos-precheck-result.jsoncontains the reduced repair payloadhmos-precheck-summary.mdcontains the human-readable summaryhmos-precheck-debug.jsonis written only when--debug-artifactis passed
Tooling Gaps
- ArkTS-dependent checks degrade gracefully instead of crashing
- CodeLinter timeouts degrade to
not_checkedinstead of failing the run doctorexplains what is missing and how to configure it
Release check
python3 -m pylint src tests
python3 -m pytest -q
python3 -m build
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hmos_precheck-0.1.0.tar.gz.
File metadata
- Download URL: hmos_precheck-0.1.0.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c00f257b85c50a997ddd4527b202dafa127e198d9f51c0b0a9d0cabdc52450a
|
|
| MD5 |
25655b87267e4272453a5a910f86f0e5
|
|
| BLAKE2b-256 |
8336f706261e2376470ed2c826911555f9dbc35aa1e0a80b3541a1e815c3e780
|
File details
Details for the file hmos_precheck-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hmos_precheck-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3ead937d757c4de25476b556260575ec224bc4cc5ee70c21d9bc77f8cd4efb3
|
|
| MD5 |
febf91ebf83fde16cb0b4756bd1ac02b
|
|
| BLAKE2b-256 |
be95fb2ff9c9ff404d2384d9508e1d25dec70bdf1ac5022b579e3cc2818a018f
|