flowpactworkflow contracts

Editors

flowpact's findings, hover traces and go to definition while you edit — in VS Code and any editor that speaks LSP.

flowpact ships a language server, so the analysis runs while you edit instead of only in CI:

  • Diagnostics as you type — the findings of flowpact lint for the whole repository, closed files included, updated on every edit (unsaved ones too). Editing a reusable workflow updates its callers' findings at once. When .github/flowpact/contracts/ exists, flowpact check's contract findings (FP801–FP805) are included.
  • Hover — how an input, secret, output, env variable or matrix key is declared, where its value comes from and where it flows, through every level of nesting.
  • Go to definition across workflow calls and local actions: from with: config: to the callee's input, from needs.build.outputs.url to the reusable workflow's output, from steps.x.outputs.y to the action's output.
  • Find references and highlights across files.

The server treats every directory with a .github folder as a repository, so monorepos and nested repositories work without configuration: the workspace folders are analyzed when the editor starts, and a repository nested inside one once you open one of its files. Your config (severities, overrides, ignores) applies as in the CLI.

VS Code

The flowpact extension bundles the language server; it needs nothing else installed. It works in VS Code 1.101 and later, and in editors built on it.

Not on the Marketplace yet

Until the extension is published, build it from a checkout of the repository and install the .vsix with Extensions: Install from VSIX…:

pnpm install
pnpm --filter ./packages/vscode build
pnpm --filter ./packages/vscode package

Settings

SettingDefaultDescription
flowpact.pluginstrueLoad the plugins the config lists. They run JavaScript from the repository, so they never load in an untrusted workspace (Restricted Mode), whatever this setting says.
flowpact.contractsautoReport contract drift and breaking interface changes: auto when .github/flowpact/contracts/ exists, on or off.
flowpact.overlappingRulesautoFP502–FP505 (expression syntax, schema, YAML syntax, context availability) repeat checks the GitHub Actions extension makes. auto hides them in files you open in the editor while that extension runs (it checks those files, and keeps its findings after you close them); show or hide them everywhere.
flowpact.hiddenRules[]Rule codes not to show in the editor. To turn a rule off in the CLI and CI too, set it to off in the config.
flowpact.trace.servermessagesWhen the output's log level is Trace: messages names each message between VS Code and the server, verbose adds its content.

Logs: the flowpact output channel (flowpact: Show Output). Its log level (Developer: Set Log Level…) is also the server's: set it to Debug to see every stage of the analysis, or to Trace for the protocol messages too.

Commands: flowpact: Restart Language Server — also needed after you edit a plugin, since a loaded plugin stays loaded — and flowpact: Show Output.

Workspace trust

In an untrusted workspace (Restricted Mode), everything works except plugins, which run code from the repository. Trusting the workspace loads them without a restart; the language status item next to the file type says when they are off. Plugins load only for repositories inside the workspace folders: not for a file opened from elsewhere, nor for a repository above the folder you opened.

Other editors

flowpact lsp starts the same server over stdin/stdout, for any editor with an LSP client. It needs flowpact installed. Settings are read from the client's initializationOptions, and from workspace/didChangeConfiguration under flowpact:

SettingDefaultDescription
pluginsfalseLoad the plugins the config lists. Enable this only for repositories you trust.
contractsautoauto, on or off, as above.
hiddenRules[]Rule codes not to show.
logLevelinfosilent, error, warn, info, debug or trace, sent to the editor's log.

Neovim

With Neovim 0.11 or later:

vim.lsp.config('flowpact', {
  cmd = { 'flowpact', 'lsp' },
  filetypes = { 'yaml' },
  root_markers = { '.github' },
})
vim.lsp.enable('flowpact')

To use the plugins the config lists, add init_options = { plugins = true }.

On this page