project, docs: the linter goes
The Catcrafts house-style rules (Crafter.LintRules) rode in project.cpp as a dependency crafter-build cloned once and built on every load; the tree never passed them (111 findings on the 1.1.0 tree, 156 on an early freeze of this range (2e87e26), 100 of the 156 the shared naming rule's, each for a variable whose name begins with a capital — the fp6 journal's lint captures, lint-tip-2e87e26), CI never ran them, and AGENTS.md kept a census nobody acted on. Out: the dependency, the import and the five AddRules calls, the lint-disable comments in 25 files and on 4 lines, §4.2 and the census of §6 — now "Code style", the three rules that were never the linter's; the cross-compiling section becomes §4.2 and its six citations — §4.1's sysroot sentence, §9.1, the CI workflow, the APKBUILD, build-package.sh, make-sysroot.sh — follow. Jorijn, 2026-10-17: "just remove the linter, we are ignoring it anyway".
This commit is contained in:
parent
d0cfaf712d
commit
910e2594a0
30 changed files with 17 additions and 95 deletions
61
AGENTS.md
61
AGENTS.md
|
|
@ -196,7 +196,6 @@ crafter-build -- --product=dialerd # bin/imsd-dialerd-…/imsd-dialerd
|
|||
crafter-build -- --product=ofonod # bin/imsd-ofonod-…/imsd-ofonod
|
||||
crafter-build -- --product=pcscf # bin/imsd-pcscf-…/imsd-pcscf
|
||||
crafter-build test # the nine unit-test suites
|
||||
crafter-build lint # the house-style rules (§4.2, §6)
|
||||
```
|
||||
|
||||
Output directories under `bin/` are named `<product>-<target>-<march>-<mtune>-<id>`;
|
||||
|
|
@ -208,36 +207,9 @@ net.catcrafts.CrafterBuild//stable`, with `--socket=session-bus` for §8.3's
|
|||
daemons — the sandbox's own session bus is a filter that refuses their names;
|
||||
`crafter-build test` runs the suites there
|
||||
anyway). A sysroot
|
||||
build (§4.3) gets no such rpath — it links the sysroot's libc++.
|
||||
build (§4.2) gets no such rpath — it links the sysroot's libc++.
|
||||
|
||||
### 4.2 The lint rules, a dependency of project.cpp
|
||||
|
||||
`project.cpp` imports the house-style rules (§6) from their own repository:
|
||||
|
||||
```cpp
|
||||
#pragma crafter dependency "https://forgejo.catcrafts.net/Catcrafts/Crafter.LintRules.git" commit "<sha>"
|
||||
import Crafter.LintRules;
|
||||
```
|
||||
|
||||
crafter-build clones that repository — and updates the clone on later loads —
|
||||
and builds it for the host whenever it loads `project.cpp`: every build does
|
||||
this, CI's included, not only `lint`. The commit is pinned, so a change to
|
||||
the rules reaches imsd when the pin moves. `LintRules::AddRules` registers
|
||||
the rules on each product's configuration.
|
||||
|
||||
```sh
|
||||
crafter-build lint # report every finding; exit 1 on any
|
||||
crafter-build lint 'naming' # one rule (the argument is a glob)
|
||||
crafter-build format # apply the transform rules in place
|
||||
```
|
||||
|
||||
Six rules read the AST (`naming`, `no-char-pointer`, `const-local`,
|
||||
`constexpr-constant`, `fixed-width-types`, `single-declaration`) and need the
|
||||
module PCMs: build the five programs and the tests first. With crafter-build
|
||||
2.1.0 they still do not run on every file — `implementations/main.cpp` is
|
||||
among the misses (`'type_traits' file not found`).
|
||||
|
||||
### 4.3 Cross-compiling for a phone (aarch64 Alpine / postmarketOS)
|
||||
### 4.2 Cross-compiling for a phone (aarch64 Alpine / postmarketOS)
|
||||
|
||||
```sh
|
||||
packaging/make-sysroot.sh # one-time: Alpine aarch64 sysroot from the CDN (edge)
|
||||
|
|
@ -712,29 +684,12 @@ Rules:
|
|||
- `imsd --session` and `imsd-ofonod --session` own their names on the session
|
||||
bus for development without root, polkit or a phone (§8.3).
|
||||
|
||||
## 6. Code style and lint
|
||||
## 6. Code style
|
||||
|
||||
The rules are the Catcrafts house style,
|
||||
[Crafter.LintRules](https://forgejo.catcrafts.net/Catcrafts/Crafter.LintRules),
|
||||
pulled in by `project.cpp` (§4.2); that repository's README lists the
|
||||
seventeen of them. `// lint-disable-file <rule>` (by convention on line 4,
|
||||
after the SPDX header and a blank line) and `// lint-disable-next-line <rule>`
|
||||
suppress a rule where a file needs it; nearly every source file disables
|
||||
`fixed-width-types`.
|
||||
|
||||
The tree was written under an earlier, project-local copy of the rules and
|
||||
does not pass the shared ones yet: `crafter-build lint` reports findings in
|
||||
most files — `naming` first (constants and statics are PascalCase here, the
|
||||
shared rule wants camelCase), then `format-concat`, `const-local`,
|
||||
`wrap-join`, `single-declaration` and `no-char-pointer` (`const-local` and
|
||||
`single-declaration` the copy did not report) — and the count moves (72 on
|
||||
2026-10-06, before the Qmi files; 108 in 16 of 20 files on the tree that
|
||||
added them, 2026-10-13; 109 on the 1.0.0 tree, 2026-10-13: `naming` 69,
|
||||
`format-concat` 23, `const-local` 10, `wrap-join` 3, `single-declaration` 2,
|
||||
`no-char-pointer` 1 and `if-single-line` 1, the last new since). CI does not
|
||||
run lint.
|
||||
|
||||
Beyond the rules:
|
||||
No linter since 1.2.0: the Catcrafts house-style rules (Crafter.LintRules)
|
||||
rode in `project.cpp` as a dependency from 0.3.x to 1.1.0, the tree never
|
||||
passed them, CI never ran them, and the census kept here was dead weight
|
||||
(Jorijn, 2026-10-17: "we are ignoring it anyway"). What holds:
|
||||
|
||||
- Comments explain constraints the code cannot show — a network's observed
|
||||
behaviour, a spec clause, the reason a shape was chosen — and name their
|
||||
|
|
@ -1944,7 +1899,7 @@ id and a `failed: imsd is not registered` state (2026-10-16,
|
|||
### 9.1 The APKBUILD
|
||||
|
||||
`packaging/APKBUILD.binary` is **the** packaging since 2026-09-02: it wraps
|
||||
a crafter-build binary cross-compiled per §4.3 (bundled by
|
||||
a crafter-build binary cross-compiled per §4.2 (bundled by
|
||||
`packaging/make-bin-tarball.sh` together with the units, scripts and
|
||||
policies) into the apks CI publishes. `pkgver` is taken from the `Version`
|
||||
constant in `implementations/main.cpp` by `build-package.sh`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue