# hoprig check

A coding session runs `hoprig check` in a project before it says it is done, and a Work task has to pass the same list.
It prints one line for each check and ends with a code a session can read. It starts no model.

```
hoprig check                                  # the change since your branch left the main one, and new files
hoprig check --base main -- npm test          # the test command is the words after "--"
hoprig check --look http://127.0.0.1:3000/    # also look at a preview that already runs
hoprig check --confirm                        # see the project's tools and whether it is a public website; say yes once
```

Each line ends as **passed**, **failed** (with the place: file and line) or **not checked** (with why). A check that
could not run is never counted as passed.

| line | what it reads |
|---|---|
| tests | the project's test command, only in the box ([BOX.md](/docs/box/)); on a computer with no box: not checked |
| leftovers | to-do marks, debug lines, a focused or skipped test, in the lines the change added |
| secrets | a key, token or password in the lines the change added; named by place, never printed |
| copies | a block of 8 or more lines the change added that also stands elsewhere in the project |
| dependencies | the dependencies the change adds or changes, named so they are seen (this line does not fail) |
| lint and types | the project's own lint and type commands, in the box after your yes; with no such tool: which to add |
| dead code | the project's own dead-code tool, in the box after your yes; with none: which to add |
| site | a public website only: per page a title (60 characters at most), a description (160 at most), one h1, `lang`, a canonical address, no `noindex`, structured data that parses, images with alt and with width and height, links that answer; `robots.txt` and `sitemap.xml` |
| page weight | a public website only: HTML, scripts, styles and images of each page against their bounds, and a script that blocks the first paint |
| look | with `--look`: a preview that already runs on this computer; page errors, failed requests, sideways scrolling |

The first four read files only. The change is your work against `--base` (default: where your branch left `origin/main`,
`main` or `master`) plus the files git does not know yet. A line you mean to keep, such as a program's own output, carries
the words `hoprig-check-ok`.

The test command is the one you type after `--`, or the one set for the project in Tia's settings. A file of the project
never chooses what runs. The look never starts a preview: with no address, or nothing answering, it is not checked.

**The project's tools.** The commands are found from the project's own files: `package.json` scripts (`lint`,
`typecheck`, `knip` and the like) and dependencies with `tsconfig.json`, `pubspec.yaml` and `analysis_options.yaml`
(`dart analyze` or `flutter analyze`, whose unused-code warnings are the dead-code line), `phpstan.neon` and `phpcs.xml`,
`pyproject.toml` (ruff, mypy, vulture). Nothing found runs before `hoprig check --confirm` showed you the exact words,
a script's own words and its `pre` and `post` scripts included, and you said yes on your terminal; when those words
change, they wait for your yes again. They run in the box like the tests; on a computer with no box they are not checked.

**A public website.** A project that looks like one (a `robots.txt` or `sitemap.xml`, a site framework's config, a pages
folder) is shown once by `--confirm`: your yes adds the site and page weight lines, your no keeps only the other lines.
They read the running preview of the project when there is one (or the address after `--look`), else the built pages
(`out`, `dist`, `build`, `_site`, `public`). A `noindex` on a staging address (a name such as `staging.`, `preview.`,
`dev.`, or a host's preview address) is said and not counted. No `llms.txt` is said as advice. The bounds per page: 100 KB
of HTML, 200 KB of scripts, 100 KB of styles, 1,000 KB of images; files on another address are not counted.

**In the chat.** The Check of a chat's preview says the same project lines: a failed line's places are among its
problems, a line not checked is a note under them.

Exit code: 0 all passed, 1 a check failed, 3 nothing failed but one could not run, 2 a wrong option.

**In Work.** After a code task's tests, the gate reads the same four lines over the task's branch. A task with a failed
line does not pass, and its card says which line and where. A task whose tests could not run still waits for you, with the
check's line beside it.

---

This page on the web: https://hoprig.com/docs/check/ · Every page: https://hoprig.com/llms.txt
