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

feat: Support .tofu files #14

Merged

Conversation

hinricht
Copy link
Contributor

@hinricht hinricht commented Oct 16, 2024

Put an x into the box if that apply:

  • This PR introduces breaking change.
  • This PR fixes a bug.
  • This PR adds new functionality.
  • This PR enhances existing functionality.

Description of your changes

Fixes #6

How can we test changes

Current behaviour:

$ git clonehttps://github.com/NorddeutscherRundfunk/opentofu-example.git
$ cd opentofu-example
$ echo "#" >> hello.tofu 
$ git add hello.tofu
$ git commit -m'test'
OpenTofu fmt.........................................(no files to check)Skipped
OpenTofu validate....................................(no files to check)Skipped
OpenTofu validate with tflint........................(no files to check)Skipped
[main c5fa2ee] test
 1 file changed, 1 insertion(+)

Behaviour of this PR:

$ git checkout support-tofu-files 
$ echo "#" >> hello.tofu 
$ git add hello.tofu
$ git commit -m'test'
OpenTofu fmt.............................................................Passed
OpenTofu validate........................................................Passed
OpenTofu validate with tflint............................................Failed
- hook id: tofu_tflint
- exit code: 2

Command 'tflint --init' successfully done:




TFLint in ./:
5 issue(s) found:

Warning: Missing version constraint for provider "null" in `required_providers` (terraform_required_providers)

  on hello.tf line 1:
   1: resource "null_resource" "hello_tf" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.9.1/docs/rules/terraform_required_providers.md

Warning: terraform "required_version" attribute is required (terraform_required_version)

  on hello.tf line 1:

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.9.1/docs/rules/terraform_required_version.md

Warning: Module should include a main.tf file as the primary entrypoint (terraform_standard_module_structure)

  on main.tf line 1:
   (source code not available)

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.9.1/docs/rules/terraform_standard_module_structure.md

Warning: Module should include an empty outputs.tf file (terraform_standard_module_structure)

  on outputs.tf line 1:
   (source code not available)

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.9.1/docs/rules/terraform_standard_module_structure.md

Warning: Module should include an empty variables.tf file (terraform_standard_module_structure)

  on variables.tf line 1:
   (source code not available)

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.9.1/docs/rules/terraform_standard_module_structure.md

@hinricht hinricht changed the title Support .tofu files (#6) feat: support .tofu files (#6) Oct 16, 2024
Copy link
Collaborator

@kvendingoldo kvendingoldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thank you!

@kvendingoldo
Copy link
Collaborator

Can you fix DCO, please?

@hinricht hinricht changed the title feat: support .tofu files (#6) Feat: support .tofu files (#6) Oct 16, 2024
@hinricht hinricht changed the title Feat: support .tofu files (#6) seat: support .tofu files Oct 16, 2024
@hinricht hinricht changed the title seat: support .tofu files feat: support .tofu files Oct 16, 2024
@hinricht
Copy link
Contributor Author

@kvendingoldo I fixed the DCO job, but I'm struggleing with the remaining jobs, i.e. https://github.com/tofuutils/pre-commit-opentofu/actions/runs/11363665717/job/31608100666?pr=14

Error: The subject "support .tofu files" found in the pull request title "feat: support .tofu files"
didn't match the configured pattern. Please ensure that the subject
starts with an uppercase character.

I already tried Feat: in the beginning of the PR title, but it didn't work neither. Can you help me here pls ?

@hinricht hinricht changed the title feat: support .tofu files feat: Support .tofu files Oct 16, 2024
@hinricht
Copy link
Contributor Author

@kvendingoldo Nevermind, I fixed all CI jobs already.

@hinricht
Copy link
Contributor Author

I updated the description with steps how to test this PR.

@kvendingoldo
Copy link
Collaborator

Great job!

@kvendingoldo kvendingoldo merged commit 3f2a01a into tofuutils:main Oct 16, 2024
6 of 10 checks passed
@kvendingoldo
Copy link
Collaborator

This PR is included in version 2.1.0 🎉

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.

support .tofu files
2 participants