Skip to content

Add support for .terraform-docs.yml config file #272

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

Merged
merged 5 commits into from
Jul 14, 2020

Conversation

khos2ow
Copy link
Member

@khos2ow khos2ow commented Jun 4, 2020

Prerequisites

Put an x into the box(es) that apply:

  • This pull request fixes a bug.
  • This pull request adds a feature.
  • This pull request enhances existing functionality.
  • This pull request introduces breaking change.

For more information, see the Contributing Guide.

Description

This PR adds support for reading configuration from file. There's a new flag added for this -c, --config which accepts name of the config file (default to .terraform-docs.yml).

Example .terraform-docs.yml:

formatter: markdown table
header-from: doc.txt
sections:
  hide:
    - inputs
    - outputs
settings:
  indent: 4
  required: false

Example Usage:

terraform-docs ./example/ # this will read the config above
                          # generate output of Markdown Table
                          # Inputs and Outputs will be hidden
                          # Indention will be 4
                          # Required column won't be shown

Issues Resolved

n/a

Checklist

Put an x into all boxes that apply:

Tests

  • I have added tests to cover my changes.
  • All tests pass when I run make test.

Documentation

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Code Style

  • My code follows the code style of this project.

@codecov-commenter
Copy link

codecov-commenter commented Jun 4, 2020

Codecov Report

Merging #272 into master will decrease coverage by 7.03%.
The diff coverage is 50.29%.

@@            Coverage Diff             @@
##           master     #272      +/-   ##
==========================================
- Coverage   81.68%   74.64%   -7.04%     
==========================================
  Files          34       39       +5     
  Lines        1796     2134     +338     
==========================================
+ Hits         1467     1593     +126     
- Misses        274      486     +212     
  Partials       55       55              
Impacted Files Coverage Δ
internal/cli/run.go 0.00% <0.00%> (ø)
internal/cli/config.go 31.42% <50.00%> (ø)
internal/cli/reader.go 51.54% <51.54%> (ø)
internal/cli/annotations.go 100.00% <100.00%> (ø)
internal/cli/util.go 100.00% <100.00%> (ø)

@khos2ow khos2ow force-pushed the config-file branch 3 times, most recently from 2afc62a to 3a580d7 Compare June 30, 2020 03:07
@khos2ow khos2ow merged commit fd97ec5 into terraform-docs:master Jul 14, 2020
@khos2ow khos2ow deleted the config-file branch July 14, 2020 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants