Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 157 additions & 0 deletions .github/SPELL_CHECK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# Spell Check Guide

## Overview

This repository uses automated spell-checking to maintain high documentation quality across all markdown files and text content.

## Tools & Configuration

### Primary Tool: Typos
- **Tool**: [crate-ci/typos](https://github.com/crate-ci/typos)
- **Configuration**: `typos.toml`
- **Integration**: Pre-commit hook

### Configuration File: typos.toml

The `typos.toml` file contains:
- **Company names**: HashiCorp, etc.
- **Common misspellings**: See typos.toml for full list
- **Technical terms**: AWS, Terraform, backup-specific vocabulary
- **Infrastructure terms**: resource, configuration, environment, etc.

## Pre-commit Integration

Spell-checking runs automatically via pre-commit hooks:

```yaml
- repo: https://github.com/crate-ci/typos
rev: v1.16.23
hooks:
- id: typos
types: [markdown, text]
args: ['--format', 'long', '--config', 'typos.toml']
exclude: '^test_.*\.md$|.*test_formatting.*'
```

## Running Spell Check Manually

### Check all files:
```bash
pre-commit run typos --all-files
```

### Check specific file:
```bash
pre-commit run typos --files README.md
```

### Check all markdown files:
```bash
pre-commit run typos --files $(find . -name "*.md")
```

## Adding New Words

### For legitimate words flagged as typos:

1. Edit `typos.toml`:
```toml
[default.extend-words]
YourWord = "YourWord"
```

2. Test the configuration:
```bash
pre-commit run typos --all-files
```

### For actual misspellings to fix:

1. Add the correction to `typos.toml`:
```toml
[default.extend-words]
misspelling = "misspelling"
```

2. This allows the word in existing content while encouraging correct spelling in new content.

## Common Misspellings Covered

### Infrastructure Terms
- Common available misspellings β†’ `available`
- Common backup misspellings β†’ `backup`
- Common terraform misspellings β†’ `terraform`
- Common resource misspellings β†’ `resource`
- Common configuration misspellings β†’ `configuration`

### Technical Terms
- Common environment misspellings β†’ `environment`
- Common performance misspellings β†’ `performance`
- Common implementation misspellings β†’ `implementation`

## Troubleshooting

### False Positives
If a legitimate word is flagged:
1. Add it to `typos.toml` under `[default.extend-words]`
2. Use the exact spelling: `WordName = "WordName"`

### Missing Spell Check
If typos aren't being caught:
1. Verify `typos.toml` exists and is properly formatted
2. Check pre-commit hook configuration
3. Ensure file types are included (`types: [markdown, text]`)

### Configuration Not Loading
If `typos.toml` changes aren't taking effect:
1. Verify the `--config typos.toml` argument in `.pre-commit-config.yaml`
2. Clear pre-commit cache: `pre-commit clean`
3. Reinstall hooks: `pre-commit install --install-hooks`

## Best Practices

### For Contributors
1. **Run spell check before committing**:
```bash
pre-commit run typos --files $(git diff --cached --name-only)
```

2. **Use consistent technical terminology**
3. **Check both content and variable descriptions in .tf files**
4. **Review example documentation for consistency**

### For Maintainers
1. **Regularly update typos.toml** with new technical terms
2. **Monitor for recurring misspellings** and add to configuration
3. **Keep the tool version updated** in `.pre-commit-config.yaml`
4. **Review spell-check failures** in CI/CD for patterns

## Integration with Development Workflow

### IDE Setup
Configure your IDE/editor for spell-checking:
- **VS Code**: Install Code Spell Checker extension
- **IntelliJ**: Enable built-in spell checker
- **Vim**: Use vim-spell plugin

### Git Hooks
Pre-commit hooks automatically run spell-check on:
- All staged markdown files
- Text files in the repository
- Documentation updates

### CI/CD Integration
Spell-checking is integrated into:
- Pre-commit CI workflow
- Pull request validation
- Release preparation checks

## Support

If you encounter spell-check issues:
1. Check this guide first
2. Review `typos.toml` configuration
3. Test with manual pre-commit run
4. Create an issue if problems persist

Remember: Good spelling improves documentation quality and user experience!
30 changes: 18 additions & 12 deletions .github/workflows/feature-discovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ jobs:

DISCOVERED_FILE="/tmp/discovered-features.json"
TRACKER_FILE=".github/feature-tracker/backup-features.json"
ISSUES_CREATED=0

TOTAL_ISSUES_CREATED=0

# Check if structured output exists
if [ ! -f "$DISCOVERED_FILE" ]; then
Expand All @@ -402,6 +403,7 @@ jobs:

if [ ! -f "$TRACKER_FILE" ]; then
echo "Feature tracker file not found, skipping post-processing"
echo "issues_created=0" >> $GITHUB_OUTPUT
exit 0
fi

Expand All @@ -410,6 +412,7 @@ jobs:

if [ -z "$PENDING_FEATURES" ]; then
echo "βœ… No features with pending_creation status found"
echo "issues_created=0" >> $GITHUB_OUTPUT
exit 0
fi

Expand Down Expand Up @@ -465,7 +468,9 @@ jobs:
# Extract issue number from URL
ISSUE_NUMBER=$(echo "$ISSUE_URL" | grep -o '[0-9]*$')
echo "βœ… Created issue #$ISSUE_NUMBER for $RESOURCE: $ISSUE_URL"
ISSUES_CREATED=$((ISSUES_CREATED + 1))

TOTAL_ISSUES_CREATED=$((TOTAL_ISSUES_CREATED + 1))


# Update the tracker file to mark as created
jq --arg resource "$RESOURCE" --arg issue_num "$ISSUE_NUMBER" --arg issue_url "$ISSUE_URL" '
Expand All @@ -478,8 +483,10 @@ jobs:
fi
done <<< "$PENDING_FEATURES"

echo "🎯 Fallback processing complete: Created $ISSUES_CREATED issues"
echo "issues_created=$ISSUES_CREATED" >> $GITHUB_OUTPUT

echo "🎯 Fallback processing complete: Created $TOTAL_ISSUES_CREATED issues"
echo "issues_created=$TOTAL_ISSUES_CREATED" >> $GITHUB_OUTPUT

exit 0
fi

Expand All @@ -499,11 +506,9 @@ jobs:

echo "Scan metadata: $SCAN_DATE, Provider: $PROVIDER_VERSION, Features: $FEATURE_COUNT"

if [ "$FEATURE_COUNT" -eq 0 ]; then
echo "βœ… No new features discovered"
echo "issues_created=0" >> $GITHUB_OUTPUT
exit 0
fi

# Initialize issue counter (will accumulate from both structured and fallback paths)
TOTAL_ISSUES_CREATED=0

# Process each discovered feature
jq -r '.discovered_features[] | @base64' "$DISCOVERED_FILE" | while IFS= read -r feature_data; do
Expand Down Expand Up @@ -588,12 +593,13 @@ jobs:
# Extract issue number
ISSUE_NUMBER=$(echo "$ISSUE_URL" | grep -o '[0-9]*$')
echo "βœ… Created issue #$ISSUE_NUMBER: $ISSUE_URL"
ISSUES_CREATED=$((ISSUES_CREATED + 1))
TOTAL_ISSUES_CREATED=$((TOTAL_ISSUES_CREATED + 1))
fi
done

echo "🎯 Issue creation complete: Created $ISSUES_CREATED issues"
echo "issues_created=$ISSUES_CREATED" >> $GITHUB_OUTPUT

echo "🎯 Issue creation complete: Created $TOTAL_ISSUES_CREATED issues"
echo "issues_created=$TOTAL_ISSUES_CREATED" >> $GITHUB_OUTPUT

- name: Commit feature tracker updates
if: steps.claude-discovery.conclusion == 'success'
Expand Down
138 changes: 0 additions & 138 deletions .github/workflows/pre-commit.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ test_formatting.tf
*test_formatting.tf
*_test.tf
test_*.tf
_typos.toml
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ repos:
rev: v1.16.23
hooks:
- id: typos
types: [markdown]
args: ['--format', 'brief']
types: [markdown, text]
args: ['--format', 'long', '--config', 'typos.toml']
exclude: '^test_.*\.md$|.*test_formatting.*'
Loading
Loading