ack3 icon indicating copy to clipboard operation
ack3 copied to clipboard

Add Terraform filetypes

Open thiagowfx opened this issue 1 year ago • 7 comments

https://github.com/beyondgrep/ack3/blob/dev/CONTRIBUTING.md:

  • The name of the filetype: Terraform
  • What the definition of the filetype would be, taken from the .ackrc file that you've been using: .tf, .tfvars
  • URL of a web page that discusses what the filetype is: https://www.terraform.io/
  • What the file contains, and why it should be a filetype: terraform configuration, which is its own domain language
  • How widely used this filetype will be: Terraform is a quite popular IaC tool

thiagowfx avatar Apr 09 '24 20:04 thiagowfx

What the definition of the filetype would be, taken from the .ackrc file that you've been using: .tf, .tfvars

Can you please paste your .ackrc in here?

petdance avatar Apr 10 '24 04:04 petdance

URL of a web page that discusses what the filetype is: https://www.terraform.io/

Please point me to a page that describes this file format.

petdance avatar Apr 10 '24 04:04 petdance

Can you please paste your .ackrc in here?

# terraform
--type-add=tf=.tf,.tfvars

Please point me to a page that describes this file format.

  • .tf: https://developer.hashicorp.com/terraform/language/files
  • .tfvars: https://developer.hashicorp.com/terraform/language/values/variables

thiagowfx avatar Apr 10 '24 09:04 thiagowfx

Is there a different between the .tf and .tfvars? Why are they combined in one fileytype?

I'm thinking it might make more sense to be --terraform than --tf, for clarity, if not brevity.

petdance avatar May 02 '24 03:05 petdance

Let me make an analogy with shell: .tf. is like .sh, where you put in the bulk of your terraform config.

.tfvars is like .env or .envrc where you set / populate variables (environment variables in case of shell).

thiagowfx avatar May 02 '24 07:05 thiagowfx

--terraform is more verbose but it's indeed unambiguous, that would be fine too

thiagowfx avatar May 02 '24 07:05 thiagowfx

So .tf and .tfvars are the same format, but the extension you choose is based on its usage and convention?

petdance avatar May 03 '24 03:05 petdance

I chose tf initially merely because it's shorter.

In hindsight, --terraform is better as it can unambiguously refer to both formats.

Again, if I were to make an analogy with shell, --shell encompasses .bash, .zsh, .sh, etc. Whereas --sh is short to type but it's not apparently obvious whether it refers to only .sh or "any shell extension".

So let's go with your suggestion :P

--type-add=terraform=.tf,.tfvars

thiagowfx avatar May 03 '24 07:05 thiagowfx

Done, thanks, 9fd9834

petdance avatar May 05 '24 03:05 petdance