# `jadpo check`

Check the project for errors.

Check every Jadpo file in the project: where each file sits, how things are named, what each name refers to and who may use it, types, logic and failures. Then write the manifest and the catalogues to build/, errors or not. Without a path, the project is found by walking up to app.jadpo. A file or folder outside any project is checked on its own, with the layout rules off, and writes nothing.

```text
jadpo check [path]
```

## Arguments

- `path` (optional): A project, file or folder to check

## Flags

- `--before <ref>`: The branch or commit to compare with

## On every command

- `--json`: Print data for tools instead of text
- `--full`: Show everything a report shortens
- `--help`: Show every flag, with examples
- `--color <when>`: Choose when to use colour

`jadpo check --json` writes one JSON document to standard output instead of text, with the same exit code. The document has `schemaVersion`, `command` (`"check"`), `ok`, `data` (what the command produced, `null` when it failed) and `diagnostics` (each error with its `rule`, `reason`, `next` and `help`). A command that needs a terminal refuses `--json` and names the flags that do the same job.

## Examples

```text
# Check the project you are in
jadpo check
# Check one file on its own
jadpo check main.jadpo
# Print the problems as data for tools
jadpo check --json
# Compare with another branch to judge acceptances
jadpo check --before release
```

## Errors

- [`cli.check_arguments`](/docs/errors/cli.check_arguments.md): A `jadpo check` command names a path that isn't there or isn't a `.jadpo` file, or a `--before` git doesn't know
- [`acceptance.base_missing`](/docs/errors/acceptance.base_missing.md): Base commit the change is compared with isn't in this clone
- [`acceptance.edited`](/docs/errors/acceptance.edited.md): Acceptance already on the before side was edited
- [`acceptance.missing`](/docs/errors/acceptance.missing.md): A change could break someone else or widen who can do what, and no acceptance this change adds says a person agreed to it
- [`acceptance.no_reason`](/docs/errors/acceptance.no_reason.md): An acceptance this change adds has no `///` line above `acceptance` saying why a person accepted the changes it lists
- [`acceptance.unmatched`](/docs/errors/acceptance.unmatched.md): Acceptance lists a change this change doesn't make
- [`migration.drop_not_accepted`](/docs/errors/migration.drop_not_accepted.md): A migration removes data, and no acceptance in the project says a person agreed to it
