Skip to content

Config File

Optional project configuration lives in .gitlab/ci-verify.yml relative to the project root. The file is not required. Missing files, empty files, and unknown sections are ignored, so new tools can add sections later.

Values from the file are defaults. A command-line flag wins when it is set.

shfmt:
  enabled: true
shellcheck:
  flags: "-s sh"
  merged_yaml: true
checks:
  severity: warning
  exclude:
    - SC-2086
opa:
  bundles:
    - https://cdn.example.com/team/ci-policies/bundle.tar.gz
shellformat:
  indent: 2

shfmt

The enabled switch turns on the formatting check, the same as the --shfmt flag. The check is off by default.

Key Type Default Effect
enabled bool false Run the formatting check (FMT-1)

shellcheck

Options for the ShellCheck checks.

Key Type Default Effect
flags string "" Custom flags for ShellCheck, the same as the --shellcheck-flags flag
merged_yaml bool false Also analyze scripts from the merged YAML of the CI Lint API, the same as --shellcheck-merged-yaml

checks

Policy for the findings.

Key Type Default Effect
severity string style Finding level at which the run fails, the same as the -S/--severity flag
exclude string list [] Check codes the project accepts, the same as the -E/--exclude flag

exclude is the project-wide complement to the inline ignore comments. A list passed with --exclude on the command line replaces the list from the file.

opa

Remote OPA bundles for checks.

Key Type Default Effect
bundles string list [] Remote bundle urls, the same as the -I/--include-opa-bundle flag

Do not put bundle urls with tokens in the file, because the file is committed to the repository.

shellformat

Formatting options for the script formatting check (finding FMT-1). The keys match the shfmt option names. All options are optional, and unset options fall back to the shfmt defaults.

Key Type Default Effect
binary_next_line bool false Put binary operators, such as pipes, on the next line when a command spans multiple lines
function_next_line bool false Place a function's opening brace on the next line
indent int 0 Number of spaces for indentation, 0 uses tabs
space_redirects bool false Put a space after redirection operators, for example echo hi > out.txt
switch_case_indent bool false Indent switch case bodies two levels deeper than the switch

Example with two-space indentation and spaced redirects:

shellformat:
  indent: 2
  space_redirects: true

Scripts are always formatted as POSIX shell, because GitLab runs CI scripts with sh.