TerraformPilot

Infrastructure as Code

Terraform-docs v0.24.0: Bug Fix for Directories Without .tf Files

Terraform-docs v0.24.0 fixes doc generation on directories lacking .tf files and bumps the Golang base image. Upgrade notes and verification included.

LLuca Berton2 min read

Introduction

#

terraform-docs is the de facto tool for generating documentation from Terraform modules, commonly wired into CI pipelines or pre-commit hooks to keep module README.md files in sync with actual variables, outputs, and resources. Version v0.24.0 is a small maintenance release. This article covers exactly what changed and how to upgrade.

What Is New

#

The release notes for v0.24.0 are thin — there are no new flags, formatters, or config options in this release. The changes are:

  • Bug fix: terraform-docs now ignores directories that don't contain any .tf files when generating docs, instead of erroring or producing unexpected output (#931, commit f5dca81).
  • Dependency update: the base Docker image was bumped from golang:1.26.2-alpine to golang:1.26.3-alpine (#930).
  • Chore: a typo fix (genereted → generated) in internal code/comments (#932).

No deprecations or breaking changes are documented. If you rely on recursive module discovery (e.g. terraform-docs markdown recursive ./modules) and previously saw errors or empty output for sub-directories without Terraform files, this release addresses that.

For the full list of changes, see the release page.

Upgrade Steps

#

If you install terraform-docs via Go:

go install github.com/terraform-docs/terraform-docs@v0.24.0

If you run it as a pre-commit hook, pin the version explicitly:

repos:
  - repo: https://github.com/terraform-docs/terraform-docs
    rev: v0.24.0
    hooks:
      - id: terraform-docs-go
        args: ["markdown", "table", "--output-file", "README.md", "./"]

If you use the Docker image:

docker pull quay.io/terraform-docs/terraform-docs:0.24.0

Terraform-docs is a standalone binary, not a Terraform provider, so there is no required_providers block or terraform init -upgrade step involved. Simply replace the binary/image/pinned ref in your tooling.

Verify

#

Confirm the installed version and run doc generation against a module directory (including a nested one without .tf files, if applicable) to make sure it no longer errors:

terraform-docs --version
 
terraform-docs markdown table ./modules/network

Expect terraform-docs v0.24.0 in the version output and clean generation without failures on empty/no-.tf sub-directories.

Conclusion

#

v0.24.0 is a low-risk, bug-fix-only release: it resolves an edge case with directories lacking .tf files and refreshes the Go base image. There are no breaking changes or new features to adapt to, so upgrading is safe to do as part of routine dependency maintenance.

#Terraform-Docs#Terraform#Docker#Golang#CI/CD

Share this article