Skip to main content

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-tools or codelinter are 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 run
  • hmos-precheck doctor
  • hmos-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:

  1. --commandline-tools
  2. project config: .hmos-precheck.json
  3. user config: platform-specific config.json
  4. lab_root/config/projects.local.json
  5. environment variable: HARMONYOS_COMMANDLINE_TOOLS
  6. 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

  • run prints compact JSON intended for repair loops
  • doctor prints detailed environment and toolchain discovery state
  • --output-dir always receives run artifacts
  • hmos-precheck-result.json contains the reduced repair payload
  • hmos-precheck-summary.md contains the human-readable summary
  • hmos-precheck-debug.json is written only when --debug-artifact is passed

Tooling Gaps

  • ArkTS-dependent checks degrade gracefully instead of crashing
  • CodeLinter timeouts degrade to not_checked instead of failing the run
  • doctor explains what is missing and how to configure it

Release check

python3 -m pylint src tests
python3 -m pytest -q
python3 -m build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hmos_precheck-0.1.0.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hmos_precheck-0.1.0-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

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

Hashes for hmos_precheck-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2c00f257b85c50a997ddd4527b202dafa127e198d9f51c0b0a9d0cabdc52450a
MD5 25655b87267e4272453a5a910f86f0e5
BLAKE2b-256 8336f706261e2376470ed2c826911555f9dbc35aa1e0a80b3541a1e815c3e780

See more details on using hashes here.

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

Hashes for hmos_precheck-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3ead937d757c4de25476b556260575ec224bc4cc5ee70c21d9bc77f8cd4efb3
MD5 febf91ebf83fde16cb0b4756bd1ac02b
BLAKE2b-256 be95fb2ff9c9ff404d2384d9508e1d25dec70bdf1ac5022b579e3cc2818a018f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page