From ec084b2745fe8ea6e7c0252a2e423193a6bd797b Mon Sep 17 00:00:00 2001 From: Maxim Doucet Date: Wed, 1 Dec 2021 11:47:45 +0100 Subject: [PATCH] Add HCL file extensions HCL is used in [Terraform which uses the `.tf` file extension](https://www.nomadproject.io/docs/commands/job/run#examples) but it is already handled by the [terraform lexer](https://github.com/rouge-ruby/rouge/blob/master/lib/rouge/lexers/terraform.rb). But HCL is also used by other Hashicorp tools like: * [Packer which uses the `.pkr.hcl` extension](https://www.nomadproject.io/docs/commands/job/run#examples) * [Vault which uses the `.hcl` extension](https://www.vaultproject.io/docs/commands/server#command-options) * [Consul which uses the `.hcl` extension](https://www.consul.io/docs/agent/options#configuration) * [Waypoint which uses the `waypoint.hcl` file](https://www.waypointproject.io/docs/waypoint-hcl#project-configuration-waypoint-hcl) * [Nomad which uses the `.nomad` extension](https://www.nomadproject.io/docs/commands/job/run#examples) but also [Nomad Packs which uses the `.hcl` extension](https://learn.hashicorp.com/tutorials/nomad/nomad-pack-writing-packs#add-a-new-pack) (in fact the [list of HCL Schemas](https://learn.hashicorp.com/tutorials/nomad/nomad-pack-writing-packs#add-a-new-pack) seems to be the most comprehensive list of HCL implementations) --- lib/rouge/lexers/hcl.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rouge/lexers/hcl.rb b/lib/rouge/lexers/hcl.rb index 347ee5bfd0..eb290e7141 100644 --- a/lib/rouge/lexers/hcl.rb +++ b/lib/rouge/lexers/hcl.rb @@ -5,6 +5,7 @@ module Rouge module Lexers class Hcl < RegexLexer tag 'hcl' + filenames '*.hcl', '*.nomad' title 'Hashicorp Configuration Language' desc 'Hashicorp Configuration Language, used by Terraform and other Hashicorp tools'