Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Req: Apply Canonical formatting #8

Open
maroskukan opened this issue Dec 16, 2021 · 0 comments
Open

Feature Req: Apply Canonical formatting #8

maroskukan opened this issue Dec 16, 2021 · 0 comments

Comments

@maroskukan
Copy link

First of all, thanks for this plugin, it is awesome. I was wondering whether you could add a feature plugin command that could apply canonical file formatting.

Therefore taking for example:

data "amazon-ami" "amazon-linux-2" {
    filters = {
        name = "amzn2-ami-hvm-2.*-x86_64-gp2"
        root-device-type = "ebs"
        virtualization-type = "hvm"
    }
    most_recent = true
    owners = ["amazon"]
    region = var.aws_region
}

And run packer fmt file.pkr.hcl resulting in:

data "amazon-ami" "amazon-linux-2" {
  filters = {
    name                = "amzn2-ami-hvm-2.*-x86_64-gp2"
    root-device-type    = "ebs"
    virtualization-type = "hvm"
  }
  most_recent = true
  owners      = ["amazon"]
  region      = var.aws_region
}

I tried to use runonsave extension but I have automatic saving of file every few seconds and when I am in the middle of writing a template it causes issues. It would be more convenient to pen a command pallet and execute this action through your plugin.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant