Formatting

Formatting your Puppet manifests

VS Code has great support for source code formatting. You can invoke the formatting commands from the Command Palette (Ctrl+Shift+P) or the editor context menu.

The Puppet VS Code extension supports; Format the line while typing and Format a file on save.

Format While You Type

Hash Rocket Alignment

Automatically align hash rockets (also known as arrows or fat commas) when typing. The alignment happens with you type >.

hash_rocket_alignment

Format Document

The Format Document (Shift+Alt+F or ⇧⌥F) command automatically fixes any linting errors using the equivalent of puppet-lint --fix. See the puppet-lint documentation for information about the available checks.

format_document

Format on Save

VS Code can automatically apply any formatting fixes every time you save the document. You can enable this feature with the editor.formatOnSave setting.

format_on_save