Skip to content
BETAGuardrails are in beta. The library, the configuration format and the CLI command can still change.

Guardrails / docs

Repository publishes a code of conduct

docs/code-of-conduct@v1

The repository carries a CODE_OF_CONDUCT.md, so the standard contributors are held to is written down and so is who enforces it.

Iddocs/code-of-conduct
Versionv1
Categorydocs
Default severityinfo
Interpreterpython3
Timeout30 seconds
Violations tolerated0
Collectsfiles

Collectors

This guardrail gathers nothing itself. It depends on the collectors below, which the CLI runs once per build before any check, and reads what they found out of GUARDRAIL_FACTS. A collector that collects nothing skips this guardrail rather than failing it.

CollectorGathersInputs it is given
filesPresence, size and line counts of the well known files a repository is expected to carry, plus any extra path the guardrail asks for.path

The inputs above are this guardrail's own, passed straight through. Configuring one in buildnote.json changes what is collected, and two guardrails configured the same way share the one collection.

Configuration

json
{
  "guardrails": {
      "failOn": "error",
      "comment": true,
      "checks": [
          {
              "use": "docs/code-of-conduct@v1",
              "severity": "info",
              "with": {
                  "path": "CODE_OF_CONDUCT.md",
                  "minLines": "5"
              },
              "exemptions": []
          }
      ]
  }
}

Inputs

InputDescriptionDefaultEnvironment variable
pathPath to the code of conduct, relative to the directory the CLI runs in.CODE_OF_CONDUCT.mdGUARDRAIL_INPUT_PATH
minLinesHow many non-blank lines it must have before it counts as published.5GUARDRAIL_INPUT_MINLINES

How to fix

Add a CODE_OF_CONDUCT.md at the repository root, or under .github/. Adopting an existing one is normal and is not a lesser answer: the Contributor Covenant is the usual choice, and the only part that must be written for you is the address reports go to.

An unwritten standard is enforced inconsistently and cannot be appealed, which is worse for the person reporting than for the person reported.

More in docs

  • docs/agent-instructions. The repository carries an agent instruction file, and it is long enough to say something and short enough to be read.
  • docs/changelog. The repository carries a changelog, so what changed between two releases is written down rather than reconstructed from commits.
  • docs/contributing. The repository carries a CONTRIBUTING.md saying how a change is proposed, built and reviewed.
  • docs/license-present. The repository carries a licence file, so what may be done with the code is written down rather than assumed.
  • docs/readme. The repository has a README, and it says more than its title.
  • docs/security-policy. The repository carries a SECURITY.md naming where a security problem should be reported.

All 7 docs guardrails

Buildnote Limited
Registered in England and Wales, Reg: 16140412