Awesome Reviewers

Verification · Hygiene

File hygiene

Cheap checks on files as files: valid syntax for config formats, no merge markers, no trailing whitespace, no oversized or binary blobs.

Sub-techniques

  • Config syntax validation V1002.001

    Parse every JSON, YAML and TOML file, and validate the important ones against a schema.

  • Merge marker and whitespace checks V1002.002

    Reject conflict markers, trailing whitespace and missing final newlines.

  • Large file guard V1002.003

    Refuse files above a size limit so binaries go to LFS or object storage.

How to build it

  1. Add pre-commit-hooks with check-yaml, check-json, check-toml, check-merge-conflict and check-added-large-files.
  2. Validate CI and app config against published JSON schemas with check-jsonschema.
  3. Run pre-commit run --all-files in CI so the hooks are not optional.

Signals in a repository

  • A .pre-commit-config.yaml listing pre-commit-hooks ids.
  • A CI job that runs pre-commit run --all-files.
  • A .yamllint or schema files referenced from hooks.