Repository navigation
Error Format Tracing Tool v1.0.0
🚀 Initial Release
A comprehensive tool for checking whether the error argument passed to CheckDeletedDiag method in Terraform Provider code has been formatted. Formatting errors corrupts the original error type, preventing effective error recognition.
✨ Key Features
- Error Format Detection: Identifies when error parameters are formatted using
fmt.Errorfor similar patterns - Go AST Parser: Accurate function extraction using Go's AST parser for robust code analysis
- Error Flow Tracing: Traces error variables from
CheckDeletedDiagcalls back to their source functions - Context-Aware: Only checks
ReadContextmethods, ignoring other contexts - High Performance: Processes 3,340+ files in ~13.6 seconds with parallel processing
📋 Rule: CQ.001
Checks whether the error parameter used by common.CheckDeletedDiag method is formatted. The rule:
- Only checks
CheckDeletedDiagcalls withinReadContextmethods - Traces errors back to their source functions
- Verifies errors actually reach
CheckDeletedDiag - Prevents false positives by filtering out errors handled earlier
🚀 Quick Installation
English Version
curl -fsSL https://raw.githubusercontent.com/Lance52259/errors-format-tracing/v1.0.0/tools/en-us/quick_install.sh | bash
Chinese Version
curl -fsSL https://raw.githubusercontent.com/Lance52259/errors-format-tracing/v1.0.0/tools/zh-cn/quick_install.sh | bash### 💻 Usage
error-format-check -d /path/to/terraform-provider-huaweicloud
error-format-check -d ./huaweicloud/services/fgs
error-format-check -d /path/to/file.go -p true### 🔧 GitHub Actions Integration
See Workflow Integration Guide for detailed instructions on integrating this tool into your CI/CD pipeline.
📖 Documentation
🎯 Recommended For
Terraform Provider developers, code quality teams, and organizations seeking to prevent error type corruption in CheckDeletedDiag method calls.