Skip to content

feat: add template stats and oversized template warnings (Phase 1 of #90)#94

Merged
nmccready merged 5 commits intomasterfrom
feat/template-stats-lint
Feb 18, 2026
Merged

feat: add template stats and oversized template warnings (Phase 1 of #90)#94
nmccready merged 5 commits intomasterfrom
feat/template-stats-lint

Conversation

@nmccready
Copy link
Copy Markdown

Summary

Phase 1 of #90 — Detection & Warnings for oversized CloudFormation templates.

What's new

  • --stats CLI flag — reports template statistics to stderr after processing:
    • Resource count with % of CloudFormation limit (500)
    • Output count with % of CloudFormation limit (200)
    • Template size in bytes with % of limit (1MB)
    • Breakdown of resource types and counts
  • 80% threshold warnings — automatically warns when any metric reaches 80% of its CloudFormation limit (400 resources, 160 outputs, ~800KB size)
  • All stats/warnings go to stderr so they don't interfere with template output on stdout

Docs

Usage

# Process template and show stats on stderr
cfn-include template.yml --stats

# Stats don't break piping
cfn-include template.yml --stats > output.json

What's NOT included (future phases)

  • Auto-split suggestions
  • Multi-stack generation
  • Dependency analysis

Refs #90

)

- Add --stats CLI flag to report template statistics to stderr
- Compute resource count, output count, and template size with % of CFN limits
- Warn at 80% thresholds (400 resources, 160 outputs, ~800KB size)
- List resource types and their counts
- All warnings/stats go to stderr to not break piping
- Add comprehensive tests for stats module

Refs #90
@nmccready nmccready merged commit c22e709 into master Feb 18, 2026
5 checks 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.

1 participant