Skip to content

thegeeklab/vscode-extension-yamlfmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

134 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yamlfmt

Format yaml files with yamlfmt for VS Code.

VS Code Version License: MIT

A VS Code extension that formats yaml files using the external binary yamlfmt.

Usage

Note The binary must exist in the system path or be configured via yamlfmt.path. See the official install instructions.

Configuration

The binary is invoked with the workspace folder, containing the document to format, as cwd. So the official documentation, regarding yamlfmt configuration, applies.

If the file is not opened from a workspace, the extension will fallback to the files parent directory as cwd. If that is not sufficient to pick up the right config file, you can create a .yamlfmt at one of the common locations. i.e. ~/config/yamlfmt/ or export XDG_CONFIG_HOME. Alternatively point to the right at via the -conf flag, in your settings.json.

You can pass extra flags from the settings.json:

{
  "yamlfmt.path": "yamlfmt",
  "yamlfmt.args": [],
  "yamlfmt.autoInstall": false
}

Note The flag -in is always appended to the args, since the current document is passed via stdin to yamlfmt.

Auto-install

When yamlfmt.autoInstall is set to true, the extension will automatically download and install the latest yamlfmt binary from GitHub releases if it is not found in the system PATH or at the configured yamlfmt.path.

The binary is stored in the extension's global storage directory and reused on subsequent activations. The following platforms and architectures are supported:

OS Architectures
macOS arm64, x86_64
Linux arm64, x86_64, i386
Windows arm64, x86_64, i386

Contributors

Special thanks to all contributors. If you would like to contribute, please see the instructions.

This project is a fork of bluebrown/vscode-extension-yamlfmt from Nico Braun. Thanks for your work.

AI Disclaimer

Artificial Intelligence (AI) tools are utilized in the development of this project. This includes AI assistance for writing and reviewing code, as well as generating the extension's icon. All AI-generated contributions are carefully reviewed and tested by human maintainers.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Format yaml files with yamlfmt for VS Code

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors