CLI command

critiq rules normalize

Print the canonical normalized form of one concrete rule file.

#Syntax

bash
critiq rules normalize <file> [--format pretty|json]

#Arguments

  • file: Exactly one rule YAML file. Globs are not accepted.

#Flags

  • --format pretty|json: Output format. Defaults to pretty.

#Examples

bash
npx critiq rules normalize .critiq/rules/security.rule.yaml
npx critiq rules normalize .critiq/rules/security.rule.yaml --format json

#Defaults

  • The command requires one concrete rule file.

#JSON output

json
{
  "command": "rules normalize",
  "format": "json",
  "exitCode": 0,
  "file": {
    "path": ".critiq/rules/security.rule.yaml",
    "uri": "file:///repo/.critiq/rules/security.rule.yaml"
  },
  "normalizedRule": {},
  "diagnostics": []
}

#Exit behavior

  • 0: the rule loaded and normalized successfully.
  • 1: invalid arguments or rule diagnostics.
  • 2: internal/runtime errors.

#Notes

  • Use this when a rule author needs to inspect the executable representation.