Skip to content

no-octal-values

GitHub ActionsYAMLsuspiciousno fixdefault: warnyaml/yamllint

Reports a plain 0755 (octal to YAML 1.1 parsers, decimal 755 to YAML 1.2) or 0o755 (octal to YAML 1.2, a string to YAML 1.1). Quoted and tagged scalars are not checked. The options implicit and explicit choose which form is reported. No fix: the intended value is not known.

The same text is a different number to different parsers: a file mode written as 0755 is 493 to one and 755 to the other, so the permissions come out wrong without an error.

To fix, quote the value (a string that the program converts itself) or write the decimal number.

Reported
mode: 0755
name: "0755"
github-actions:
lint:
rules:
no-octal-values:
level: warn # off, warn (default), error
options:
implicit: true
explicit: true
yaml:
lint:
rules:
no-octal-values:
level: warn # off, warn (default), error
options:
implicit: true
explicit: true
Option Type Default Description
implicit bool true Report 0755.
explicit bool true Report 0o755.

Enabled by the presets: yaml/yamllint.

Suppress one line with sudsy-disable-next-line no-octal-values in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
yamllint octal-values full
yamllint octal-values.forbid-implicit-octal / forbid-explicit-octal full