Skip to content

Commit

Permalink
adds hcl alias for terraform syntax (#2375)
Browse files Browse the repository at this point in the history
This PR adds hcl as an option for highlighting HCL syntax as Hashicorp uses HCL for more than just Terraform, like Nomad.
  • Loading branch information
Inveracity committed Mar 29, 2023
1 parent 8677860 commit 03610d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pygments/lexers/_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@
'TeraTermLexer': ('pygments.lexers.teraterm', 'Tera Term macro', ('teratermmacro', 'teraterm', 'ttl'), ('*.ttl',), ('text/x-teratermmacro',)),
'TermcapLexer': ('pygments.lexers.configs', 'Termcap', ('termcap',), ('termcap', 'termcap.src'), ()),
'TerminfoLexer': ('pygments.lexers.configs', 'Terminfo', ('terminfo',), ('terminfo', 'terminfo.src'), ()),
'TerraformLexer': ('pygments.lexers.configs', 'Terraform', ('terraform', 'tf'), ('*.tf',), ('application/x-tf', 'application/x-terraform')),
'TerraformLexer': ('pygments.lexers.configs', 'Terraform', ('terraform', 'tf', 'hcl'), ('*.tf', '*.hcl'), ('application/x-tf', 'application/x-terraform')),
'TexLexer': ('pygments.lexers.markup', 'TeX', ('tex', 'latex'), ('*.tex', '*.aux', '*.toc'), ('text/x-tex', 'text/x-latex')),
'TextLexer': ('pygments.lexers.special', 'Text only', ('text',), ('*.txt',), ('text/plain',)),
'ThingsDBLexer': ('pygments.lexers.thingsdb', 'ThingsDB', ('ti', 'thingsdb'), ('*.ti',), ()),
Expand Down
4 changes: 2 additions & 2 deletions pygments/lexers/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,8 @@ class TerraformLexer(ExtendedRegexLexer):

name = 'Terraform'
url = 'https://www.terraform.io/'
aliases = ['terraform', 'tf']
filenames = ['*.tf']
aliases = ['terraform', 'tf', 'hcl']
filenames = ['*.tf', '*.hcl']
mimetypes = ['application/x-tf', 'application/x-terraform']

classes = ('backend', 'data', 'module', 'output', 'provider',
Expand Down

0 comments on commit 03610d6

Please sign in to comment.