Skip to content

Use yamllint config to prevent empty-values & use new yaml-files setting #164

@myii

Description

@myii

This has come up before and there was a reminder of it here:

Having empty values in pillar.example (or any of the YAML files) is never a good idea, leading to confusion and rendering errors. Values should be set explicitly, with it being easy to set null if that's what's really required.

With yamllint now active in our repos, this can easily be enforced from its configuration file:

 rules:
+  empty-values:
+    forbid-in-block-mappings: true
+    forbid-in-flow-mappings: true
+
   line-length:
     # Increase from default of `80`
     # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
     max: 88

Propagating this is straightforward using the ssf-formula.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions