mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 02:54:26 +00:00
On a fresh Fedora dev container lint-mermaid failed most files with ConnectionClosedError: the browser aborted with `FATAL:third_party/skia/src/ports/SkFontMgr_FontConfigInterface.cpp:163] Not implemented.` in its font fallback, because the host had no font at all. install-lint provisions the browser's libraries by soname on dnf, yum and pacman, and a font is not a soname; apt-get gets fonts through puppeteer's --install-deps. It looked load-dependent because lint-packages installs rpmlint in the same parallel phase, which pulls fontconfig and Noto Sans: renders crashed until that transaction landed, and every later run was green. With every font removed, lint-mermaid alone fails 274 of 289 files the same way. ensure() now installs the distribution's font provide when /usr/share/fonts holds no file (`font(:lang=en)` on dnf and yum, `ttf-font` on pacman), and browser_installed() counts the font, so the install-lint stamp is not fresh on a font-less host. Closes #1154 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
utils/install
This directory hosts the Python implementation behind make install-lint.
For the general rules that govern READMEs in code directories see documentation.md.
Purpose
The package installs the lint toolchain (actionlint, shfmt, ruff, ansible-lint, mbake, markdownlint-cli2, eslint, shellcheck, ansible-playbook, ansible-galaxy) using the right channel per tool (system package manager, pip, npm, or GitHub release). Modules at this level are channel-agnostic primitives; per-tool policy lives one level down in lint/.
Structure
| File | Role |
|---|---|
primitives.py |
Logging, sudo wrapping, PATH mutation, and stdlib-based URL download. |
pip.py |
Venv-aware pip installer with --break-system-packages and --user fallback. |
npm.py |
Global / local npm install with per-user --prefix fallback. |
node.py |
Node.js runtime that is still supported upstream: the distro package, or the newest LTS from nodejs.org (signature- and checksum-verified) when the distro line has reached its end of life. |
github_release.py |
Latest-tag resolver and asset downloader for GitHub releases. |
system_pkg.py |
Per-manager dispatch for pacman / apt-get / dnf / yum / brew. |
lint/ |
One module per tool, each exposing ensure(). See lint README. |
The CLI entry point lives at __main__.py, invoked from lint.sh as python3 -m utils.install.lint.
The matching dispatcher wrapper.sh routes make install-lint host vs container based on INFINITO_LINT_RUNNER.
File Naming
- Module names MUST stay lowercase snake_case.
- Channel-agnostic helpers MUST live directly under
utils/install/. - Per-tool policy (one tool per file) MUST live under
lint/(see lint README). - Test files live in tests/unit/python/utils/install/ and mirror the module name with a
test_prefix.
Import Rules
primitives.pyMUST NOT import from any other module in this package.pip.py,npm.py,github_release.py, andsystem_pkg.pyMAY import fromprimitives.py.npm.pyMAY import fromsystem_pkg.pyandnode.pyto bootstrap npm itself; no other cross-imports between these four are allowed.node.pyMAY import fromprimitives.pyandsystem_pkg.py.- Per-tool modules under
lint/MUST NOT import each other (see lint README).