Skip to content

defineGleamPolicy

defineGleamPolicy<C>(args): PolicyShape<C>

Defined in: policyDefiners/defineGleamPolicy.ts:98

Define a repo policy for gleam.toml files.

C = undefined

DefineGleamPolicyArgs<C>

Policy metadata, parsed-TOML handler, and optional defaults.

PolicyShape<C>

A file policy that reads and parses matching gleam.toml files.

This is a helper function that creates a policy pre-configured to match gleam.toml files. The handler receives the parsed TOML content.

const MyGleamPolicy = defineGleamPolicy({
name: "MyGleamPolicy",
description: "Ensures gleam.toml has required fields",
handler: async (toml, { file }) => {
if (!toml.name) {
return { error: "Missing name field", fixable: false };
}
return true;
},
});