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 Terraform code review #322

Merged
merged 1 commit into from
Jan 29, 2024
Merged

Conversation

lintaonz
Copy link
Contributor

@lintaonz lintaonz commented Jan 23, 2024

Support HashiCorp Terraform code review:

  • .tf: Terraform file
  • .hcl: HashiCorp Configuration Language

I have tested both file extensions with the 'gpt-3.5-turbo' model. It works great.

Example

Risk Level 3 - variables.tf

The code changes in this file have a medium risk to the code base. Here are a few suggestions for improvement:

  1. The enabled variable can have a more descriptive name. Consider renaming it to something like diagnosticsEnabled.

  2. The diag_object variable can be defined as a complex object type to improve readability and maintainability. Consider using a map or a struct to define the structure of the diag_object variable.

Example:

variable \"diag_object\" {
  description = \"(Required) Contains the diagnostics setting object.\"
  type        = map(object({
    diagnosticsEnabled = bool
    retentionEnabled   = bool
    retentionPeriod    = number
  }))
}

@mattzcarey mattzcarey merged commit 87bce4d into mattzcarey:main Jan 29, 2024
1 check passed
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.

2 participants