Skip to content

Allow comments in .terraform-version file - #347

Closed
OJFord wants to merge 3 commits into
tfutils:masterfrom
OJFord:impl-283
Closed

OJFord wants to merge 3 commits into
tfutils:masterfrom
OJFord:impl-283

Conversation

@OJFord

@OJFord OJFord commented Jul 15, 2022

Copy link
Copy Markdown
Contributor

Using syntax:

# this whole line is a comment
1.2.3
# this is also a comment

but not inline comments.

Closes #283

Comment thread lib/tfenv-version-name.sh Resolved
@jgrumboe

jgrumboe commented Aug 24, 2022 •

Copy link
Copy Markdown

Hi @OJFord
I would vote against comments as there are probably also other tools relying on this file in the existing format.
And there’s also an open issue at the setup-terraform action which could also rely on the file.
hashicorp/setup-terraform#208

Additionally, I checked .ruby-version and .node-version and both also don't support comments as that supports the simple "cat" use case like rbenv use $(cat .ruby-version) for example.

Comment thread test/test_install_and_use.sh Resolved
Comment thread lib/tfenv-version-name.sh Resolved
@mputilin

mputilin commented Nov 8, 2022

Copy link
Copy Markdown

Useful feature. Please merge.

OJFord added 2 commits August 6, 2023 20:36
Using syntax:

    # this whole line is a comment
    1.2.3
    # this is also a comment

but not inline comments.

Closes tfutils#283
@OJFord
OJFord force-pushed the impl-283 branch 4 times, most recently from 45c4370 to 5277b7e Compare August 6, 2023 20:09
@Zordrak

Zordrak commented Jul 4, 2025

Copy link
Copy Markdown
Collaborator

It does seem that the general consensus, especially in a wider community sense, with different tools consolidating on common configuration files, that while this might sometimes be handy, it's likely to be more troublesome than the minor value it would add.

@Zordrak Zordrak closed this Jul 4, 2025
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

Successfully merging this pull request may close these issues.

Feature: Ignore comments in .terraform-version

4 participants