Skip to content
Latchkey

yamllint "line too long" error in CI

yamllint's line-length rule defaults to a maximum of 80 characters. Any longer line fails the check even though the YAML is otherwise valid.

What this error means

yamllint reports "line too long (112 > 80 characters) (line-length)" on a line with a long URL, command, or value. The parse is fine; only the style rule fails.

yamllint
ci.yml
  14:81     error    line too long (112 > 80 characters) (line-length)

Common causes

A long unbreakable value like a URL or command

A single scalar (a URL, a shell command, a base64 blob) is longer than the configured limit and cannot be split casually.

The default 80-char limit is stricter than your team wants

Many teams prefer 120; the default 80 flags lines they consider fine.

How to fix it

Raise or relax the line-length rule

Set a higher max, or allow long lines that have no spaces to break at (URLs), in your yamllint config.

.yamllint
rules:
  line-length:
    max: 120
    allow-non-breakable-words: true

Wrap long scalars with a block style

Use a folded (>) or literal (|) block scalar so a long value spans multiple shorter lines.

ci.yml
command: >
  echo "a very long command that would
  otherwise exceed the line length limit"

How to prevent it

  • Agree on a team-wide line-length.max and commit it in .yamllint.
  • Enable allow-non-breakable-words for URL-heavy files.
  • Use block scalars for long multi-word values.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →