Skip to content

Conversation

@yhakbar
Copy link
Collaborator

@yhakbar yhakbar commented Oct 22, 2025

Description

Documenting support for --filter in hcl commands.

TODOs

Read the Gruntwork contribution guidelines.

  • I authored this code entirely myself
  • I am submitting code based on open source software (e.g. MIT, MPL-2.0, Apache)]
  • I am adding or upgrading a dependency or adapted code and confirm it has a compatible open source license
  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added / Removed / Updated [X].

Migration Guide

Summary by CodeRabbit

  • Documentation
    • Extended --filter flag docs to include hcl fmt and hcl validate
    • Added usage examples for both commands (path-based filter syntax)
    • Introduced an experimental hcl fmt filter doc with examples and note about requiring the filter-flag experiment; clarifies only path-based filtering applies
    • Marked hcl fmt and hcl validate as implemented (previously planned) and updated command reference
    • Updated future-plans list (added dag graph)

@vercel
Copy link

vercel bot commented Oct 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
terragrunt-docs Ready Ready Preview Comment Oct 24, 2025 7:52pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

📝 Walkthrough

Walkthrough

Updated filter documentation to mark --filter as available for hcl fmt and hcl validate, added command-specific flag docs, created a new hcl-fmt-filter docs page, adjusted usage examples, and moved planned-items entries accordingly.

Changes

Cohort / File(s) Summary
Main filter docs
docs-starlight/src/content/docs/03-features/18-filter.mdx, docs-starlight/src/data/flags/filter.mdx
Marked hcl fmt and hcl validate as supported for --filter, added usage examples for both, removed them from planned items and added dag graph to planned features.
Command flag docs
docs-starlight/src/data/commands/hcl/fmt.mdx, docs-starlight/src/data/commands/hcl/validate.mdx
Added --filter flag documentation to the hcl fmt and hcl validate command flag lists.
New flag page
docs-starlight/src/data/flags/hcl-fmt-filter.mdx
Added a new experimental hcl-fmt-filter documentation page describing the experimental flag, required experiment gate, path-based filtering behavior, examples (relative/absolute/glob), and notes on attribute-based filters not applying to file-level formatting.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • denis256
  • levkohimins

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description follows the required template structure with a Description section, TODOs checklist, Release Notes, and Migration Guide sections present. However, the description is incomplete in critical areas: the Description section contains only one vague sentence that essentially repeats the PR title without detailing specific changes made across the four documentation files; the Release Notes section still contains placeholder text ("Added / Removed / Updated [X].") rather than an actual one-line summary suitable for release notes; and notably, the "I authored this code entirely myself" checkbox is unchecked, which may require clarification. While the TODOs checklist is mostly completed with appropriate checkmarks, the narrative content lacks the detail needed to understand the full scope of documentation updates.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "docs: Documenting support for --filter in hcl commands" clearly and concisely summarizes the main objective of the changeset. The title accurately reflects that the pull request documents the availability of the --filter flag in hcl fmt and hcl validate commands across multiple documentation files. The title is specific, descriptive, and avoids vague language, making it clear to reviewers what the primary change accomplishes.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/documenting-support-for-filter-in-hcl-commands

Comment @coderabbitai help to get the list of available commands and usage tips.

@yhakbar yhakbar force-pushed the feat/adding-support-for-filter-in-hcl-commands branch from 5d4f36a to e97200a Compare October 24, 2025 13:25
@yhakbar yhakbar force-pushed the docs/documenting-support-for-filter-in-hcl-commands branch from 4785b77 to 30de841 Compare October 24, 2025 18:57
Base automatically changed from feat/adding-support-for-filter-in-hcl-commands to main October 24, 2025 19:35
@yhakbar yhakbar force-pushed the docs/documenting-support-for-filter-in-hcl-commands branch from 30de841 to ca2abbe Compare October 24, 2025 19:38
@yhakbar yhakbar force-pushed the docs/documenting-support-for-filter-in-hcl-commands branch from ca2abbe to 9a4bd40 Compare October 24, 2025 19:45
@yhakbar yhakbar marked this pull request as ready for review October 24, 2025 19:46
@yhakbar yhakbar requested a review from denis256 as a code owner October 24, 2025 19:46
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs-starlight/src/data/flags/filter.mdx (1)

20-20: Update experimental feature note to reflect newly supported commands.

Line 20 states the filter flag is only available in find, list, and run commands, but the examples on lines 31–32 and the supported commands list on lines 119–120 document support for hcl fmt and hcl validate. Update this line to be consistent with the rest of the documentation.

Apply this diff to fix the inconsistency:

-Currently, the `--filter` flag is available in the `find`, `list`, and `run` commands.
+Currently, the `--filter` flag is available in the `find`, `list`, `run`, `hcl fmt`, and `hcl validate` commands.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3b29e48 and 9a4bd40.

📒 Files selected for processing (5)
  • docs-starlight/src/content/docs/03-features/18-filter.mdx (2 hunks)
  • docs-starlight/src/data/commands/hcl/fmt.mdx (1 hunks)
  • docs-starlight/src/data/commands/hcl/validate.mdx (1 hunks)
  • docs-starlight/src/data/flags/filter.mdx (2 hunks)
  • docs-starlight/src/data/flags/hcl-fmt-filter.mdx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs-starlight/**/*.md*

⚙️ CodeRabbit configuration file

Review the documentation for clarity, grammar, and spelling. Make sure that the documentation is easy to understand and follow. There is currently a migration underway from the Jekyll based documentation in docs to the Starlight + Astro based documentation in docs-starlight. Make sure that the docs-starlight documentation is accurate and up-to-date with the docs documentation, and that any difference between them results in an improvement in the docs-starlight documentation.

Files:

  • docs-starlight/src/data/flags/hcl-fmt-filter.mdx
  • docs-starlight/src/data/commands/hcl/fmt.mdx
  • docs-starlight/src/data/commands/hcl/validate.mdx
  • docs-starlight/src/content/docs/03-features/18-filter.mdx
  • docs-starlight/src/data/flags/filter.mdx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: license_check / License Check
  • GitHub Check: lint / lint
  • GitHub Check: Pull Request has non-contributor approval
  • GitHub Check: build-and-test
🔇 Additional comments (8)
docs-starlight/src/data/commands/hcl/fmt.mdx (1)

15-15: Good – flag reference is correctly positioned.

The addition of hcl-fmt-filter is properly placed in the flags list and aligns with the broader filter documentation updates.

docs-starlight/src/data/commands/hcl/validate.mdx (1)

15-15: Good – standard filter flag correctly referenced for validate command.

The filter flag is appropriately included for the hcl validate command.

docs-starlight/src/content/docs/03-features/18-filter.mdx (2)

23-23: Good – filter command support is clearly listed.

The update properly includes hcl fmt and hcl validate in the list of commands supporting the --filter flag.


321-322: Good – implementation status correctly reflects documented support.

The checklist properly marks hcl fmt and hcl validate as implemented with the --filter flag.

docs-starlight/src/data/flags/filter.mdx (2)

31-32: Clear usage examples correctly demonstrate hcl fmt and hcl validate support.

The examples effectively show how to use --filter with the newly supported HCL commands.


122-124: Good – planned releases section correctly reflects current implementation status.

The simplification to only include dag graph as a planned feature is appropriate given the new support for hcl fmt and hcl validate.

docs-starlight/src/data/flags/hcl-fmt-filter.mdx (2)

23-34: Excellent – filter behavior limitations are clearly documented.

The note effectively explains that hcl fmt uses path-based filtering only, with clear examples of supported and unsupported patterns. This helps users understand the important difference from other commands.


36-88: Examples are well-organized and clearly demonstrate filtering capabilities.

The usage section effectively progresses from basic to advanced patterns, with all examples appropriately constrained to path-based filtering as documented in the limitations note. Examples are clear, practical, and follow good documentation practices.


Examples below will omit the `--experiment filter-flag` flag for brevity.

Currently, the `--filter` flag is available in the `find`, `list`, and `run` commands.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Clarify or update the experimental feature note to avoid confusion.

This file documents filter support for hcl fmt specifically, but line 20 states the filter flag is only available in find, list, and run commands. This is contradictory since the entire file documents hcl fmt filter usage.

Consider either:

  1. Updating line 20 to reflect that filters are now available in find, list, run, hcl fmt, and hcl validate, OR
  2. Removing or adjusting this statement since it's a flag-specific documentation file

Verify the relationship between the hcl-fmt-filter flag (referenced in fmt.mdx) and the usage documented in this file to clarify whether this documentation applies to the standard --filter flag or the --hcl-fmt-filter flag specifically.



---

🏁 Script executed:

```shell
#!/bin/bash
# Read the hcl-fmt-filter.mdx file to verify the actual content
cat docs-starlight/src/data/flags/hcl-fmt-filter.mdx

Length of output: 2667


🏁 Script executed:

#!/bin/bash
# Search for fmt.mdx to check how it references the filter flag
find docs-starlight -name "fmt.mdx" -type f -exec cat {} \;

Length of output: 783


🏁 Script executed:

#!/bin/bash
# Search for references to "hcl-fmt-filter" and "--filter" in documentation
rg -n "hcl-fmt-filter|--filter" docs-starlight/src/data/flags/ -A 2 -B 2

Length of output: 10667


🏁 Script executed:

#!/bin/bash
# Check for other filter documentation files to understand the broader context
find docs-starlight/src/data/flags -name "*filter*" -type f

Length of output: 89


Update line 20 to reflect actual filter support in hcl fmt.

Line 20 contradicts the rest of the file. It states the --filter flag is "available in the find, list, and run commands" only, but the entire file documents hcl fmt filter usage with multiple examples. This is an outdated copy-paste error from the generic filter documentation.

Update line 20 to:

Currently, the `--filter` flag is available in the `find`, `list`, `run`, `hcl fmt`, and `hcl validate` commands.

Or remove it entirely since this is a specialized documentation page for hcl fmt filter support and the statement is now inaccurate.

🤖 Prompt for AI Agents
In docs-starlight/src/data/flags/hcl-fmt-filter.mdx around line 20, the sentence
about which commands support the `--filter` flag is outdated and contradicts the
rest of the page; update line 20 to read: "Currently, the `--filter` flag is
available in the `find`, `list`, `run`, `hcl fmt`, and `hcl validate` commands."
Alternatively, if you prefer the page to focus solely on `hcl fmt`, remove the
line entirely so no inaccurate generic support statement remains.

@yhakbar yhakbar force-pushed the docs/documenting-support-for-filter-in-hcl-commands branch from 9a4bd40 to cb39153 Compare October 24, 2025 19:51
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
docs-starlight/src/data/flags/hcl-fmt-filter.mdx (1)

1-5: Consider making the frontmatter description more context-specific.

The description: "Filter configurations using a flexible query language" in the frontmatter is generic and may mislead users into expecting attribute-based filtering (like type=unit). Since the content note clarifies this, a more specific description would improve discoverability—for example: "Filter HCL files to format using path-based queries".

Consider updating the YAML description:

---
name: filter
-description: Filter configurations using a flexible query language
+description: Filter HCL files to format using path-based queries
type: list(string)
---

This makes the scope clearer at the metadata level and aligns with the file's focused purpose.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9a4bd40 and cb39153.

📒 Files selected for processing (5)
  • docs-starlight/src/content/docs/03-features/18-filter.mdx (2 hunks)
  • docs-starlight/src/data/commands/hcl/fmt.mdx (1 hunks)
  • docs-starlight/src/data/commands/hcl/validate.mdx (1 hunks)
  • docs-starlight/src/data/flags/filter.mdx (2 hunks)
  • docs-starlight/src/data/flags/hcl-fmt-filter.mdx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs-starlight/src/data/commands/hcl/fmt.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs-starlight/src/data/commands/hcl/validate.mdx
🧰 Additional context used
📓 Path-based instructions (1)
docs-starlight/**/*.md*

⚙️ CodeRabbit configuration file

Review the documentation for clarity, grammar, and spelling. Make sure that the documentation is easy to understand and follow. There is currently a migration underway from the Jekyll based documentation in docs to the Starlight + Astro based documentation in docs-starlight. Make sure that the docs-starlight documentation is accurate and up-to-date with the docs documentation, and that any difference between them results in an improvement in the docs-starlight documentation.

Files:

  • docs-starlight/src/content/docs/03-features/18-filter.mdx
  • docs-starlight/src/data/flags/filter.mdx
  • docs-starlight/src/data/flags/hcl-fmt-filter.mdx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: license_check / License Check
  • GitHub Check: lint / lint
  • GitHub Check: build-and-test
  • GitHub Check: Pull Request has non-contributor approval
🔇 Additional comments (4)
docs-starlight/src/data/flags/filter.mdx (1)

29-30: ✓ Good additions to supported commands and examples.

The new examples for hcl fmt and hcl validate follow the established format and are consistent with the existing command examples. The future plans have been correctly updated to reflect current support and add dag graph as planned.

Also applies to: 117-121

docs-starlight/src/data/flags/hcl-fmt-filter.mdx (1)

21-32: ✓ Excellent behavioral note clarifying filter limitations for hcl fmt.

The <Aside> note clearly explains that hcl fmt filters HCL files, not configurations, and that only path-based filtering is supported. The concrete examples of what works and what doesn't prevent user confusion.

docs-starlight/src/content/docs/03-features/18-filter.mdx (2)

23-23: ✓ Clear update to supported commands list.

Line 23 accurately reflects that --filter is now available across five commands. The ordering and phrasing are consistent with the detailed flag documentation.


321-322: ✓ Correct implementation status for hcl fmt and hcl validate.

The checkboxes are correctly marked as [x] to indicate these commands now support --filter, moving them from planned to implemented. This is consistent with the expanded support documented elsewhere in the PR.

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