Skip to content

Types

These type shapes are shared between OctoGuide’s API and Building Rules.

A resolved entity retrieved from the GitHub API. It will contain:

See entities.ts for the specifics of the Entity type union and its constituents.

Metadata describing an OctoGuide rule.

The following properties are all required:

  • description: string: Single sentence description of the rule.
  • explanation: string[]: Additional sentences describing the rule.
  • name: string: kebab-case name of the rule.

See rules.ts for the specifics of the RuleAbout interface.

Shared context provided to rules when they run on an entity.

  • locator: Contains the owner and repository strings of the entity.
  • octokit: Octokit: instance that can send GitHub API calls.
  • report: RuleReporter: receives RuleReportData to register a new violation.

See rules.ts for the specifics of the RuleContext interface.

Shared context function that a rule can use to register a new violation. Receives a RuleReportData object.

See Building Rules for how these are used.

See rules.ts for the specifics of the RuleReporter interface.

A single report generated by a rule for a GitHub entity. Contains:

See reporters.ts for the specifics of the RuleReport interface.

A single report generated by a rule for a GitHub entity. Contains:

  • primary: string: Single sentence description of the reported violation.
  • secondary?: string[]: Any additional sentences detailing the violation.
  • suggestion: string[]: Steps the user can take to resolve the violation.

See Building Rules for how these are used.

See reporters.ts for the specifics of the RuleReportData interface.