|
| 1 | +# Spell Check Guide |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This repository uses automated spell-checking to maintain high documentation quality across all markdown files and text content. |
| 6 | + |
| 7 | +## Tools & Configuration |
| 8 | + |
| 9 | +### Primary Tool: Typos |
| 10 | +- **Tool**: [crate-ci/typos](https://github.com/crate-ci/typos) |
| 11 | +- **Configuration**: `typos.toml` |
| 12 | +- **Integration**: Pre-commit hook |
| 13 | + |
| 14 | +### Configuration File: typos.toml |
| 15 | + |
| 16 | +The `typos.toml` file contains: |
| 17 | +- **Company names**: HashiCorp, etc. |
| 18 | +- **Common misspellings**: See typos.toml for full list |
| 19 | +- **Technical terms**: AWS, Terraform, backup-specific vocabulary |
| 20 | +- **Infrastructure terms**: resource, configuration, environment, etc. |
| 21 | + |
| 22 | +## Pre-commit Integration |
| 23 | + |
| 24 | +Spell-checking runs automatically via pre-commit hooks: |
| 25 | + |
| 26 | +```yaml |
| 27 | +- repo: https://github.com/crate-ci/typos |
| 28 | + rev: v1.16.23 |
| 29 | + hooks: |
| 30 | + - id: typos |
| 31 | + types: [markdown, text] |
| 32 | + args: ['--format', 'long', '--config', 'typos.toml'] |
| 33 | + exclude: '^test_.*\.md$|.*test_formatting.*' |
| 34 | +``` |
| 35 | +
|
| 36 | +## Running Spell Check Manually |
| 37 | +
|
| 38 | +### Check all files: |
| 39 | +```bash |
| 40 | +pre-commit run typos --all-files |
| 41 | +``` |
| 42 | + |
| 43 | +### Check specific file: |
| 44 | +```bash |
| 45 | +pre-commit run typos --files README.md |
| 46 | +``` |
| 47 | + |
| 48 | +### Check all markdown files: |
| 49 | +```bash |
| 50 | +pre-commit run typos --files $(find . -name "*.md") |
| 51 | +``` |
| 52 | + |
| 53 | +## Adding New Words |
| 54 | + |
| 55 | +### For legitimate words flagged as typos: |
| 56 | + |
| 57 | +1. Edit `typos.toml`: |
| 58 | +```toml |
| 59 | +[default.extend-words] |
| 60 | +YourWord = "YourWord" |
| 61 | +``` |
| 62 | + |
| 63 | +2. Test the configuration: |
| 64 | +```bash |
| 65 | +pre-commit run typos --all-files |
| 66 | +``` |
| 67 | + |
| 68 | +### For actual misspellings to fix: |
| 69 | + |
| 70 | +1. Add the correction to `typos.toml`: |
| 71 | +```toml |
| 72 | +[default.extend-words] |
| 73 | +misspelling = "misspelling" |
| 74 | +``` |
| 75 | + |
| 76 | +2. This allows the word in existing content while encouraging correct spelling in new content. |
| 77 | + |
| 78 | +## Common Misspellings Covered |
| 79 | + |
| 80 | +### Infrastructure Terms |
| 81 | +- Common available misspellings → `available` |
| 82 | +- Common backup misspellings → `backup` |
| 83 | +- Common terraform misspellings → `terraform` |
| 84 | +- Common resource misspellings → `resource` |
| 85 | +- Common configuration misspellings → `configuration` |
| 86 | + |
| 87 | +### Technical Terms |
| 88 | +- Common environment misspellings → `environment` |
| 89 | +- Common performance misspellings → `performance` |
| 90 | +- Common implementation misspellings → `implementation` |
| 91 | + |
| 92 | +## Troubleshooting |
| 93 | + |
| 94 | +### False Positives |
| 95 | +If a legitimate word is flagged: |
| 96 | +1. Add it to `typos.toml` under `[default.extend-words]` |
| 97 | +2. Use the exact spelling: `WordName = "WordName"` |
| 98 | + |
| 99 | +### Missing Spell Check |
| 100 | +If typos aren't being caught: |
| 101 | +1. Verify `typos.toml` exists and is properly formatted |
| 102 | +2. Check pre-commit hook configuration |
| 103 | +3. Ensure file types are included (`types: [markdown, text]`) |
| 104 | + |
| 105 | +### Configuration Not Loading |
| 106 | +If `typos.toml` changes aren't taking effect: |
| 107 | +1. Verify the `--config typos.toml` argument in `.pre-commit-config.yaml` |
| 108 | +2. Clear pre-commit cache: `pre-commit clean` |
| 109 | +3. Reinstall hooks: `pre-commit install --install-hooks` |
| 110 | + |
| 111 | +## Best Practices |
| 112 | + |
| 113 | +### For Contributors |
| 114 | +1. **Run spell check before committing**: |
| 115 | + ```bash |
| 116 | + pre-commit run typos --files $(git diff --cached --name-only) |
| 117 | + ``` |
| 118 | + |
| 119 | +2. **Use consistent technical terminology** |
| 120 | +3. **Check both content and variable descriptions in .tf files** |
| 121 | +4. **Review example documentation for consistency** |
| 122 | + |
| 123 | +### For Maintainers |
| 124 | +1. **Regularly update typos.toml** with new technical terms |
| 125 | +2. **Monitor for recurring misspellings** and add to configuration |
| 126 | +3. **Keep the tool version updated** in `.pre-commit-config.yaml` |
| 127 | +4. **Review spell-check failures** in CI/CD for patterns |
| 128 | + |
| 129 | +## Integration with Development Workflow |
| 130 | + |
| 131 | +### IDE Setup |
| 132 | +Configure your IDE/editor for spell-checking: |
| 133 | +- **VS Code**: Install Code Spell Checker extension |
| 134 | +- **IntelliJ**: Enable built-in spell checker |
| 135 | +- **Vim**: Use vim-spell plugin |
| 136 | + |
| 137 | +### Git Hooks |
| 138 | +Pre-commit hooks automatically run spell-check on: |
| 139 | +- All staged markdown files |
| 140 | +- Text files in the repository |
| 141 | +- Documentation updates |
| 142 | + |
| 143 | +### CI/CD Integration |
| 144 | +Spell-checking is integrated into: |
| 145 | +- Pre-commit CI workflow |
| 146 | +- Pull request validation |
| 147 | +- Release preparation checks |
| 148 | + |
| 149 | +## Support |
| 150 | + |
| 151 | +If you encounter spell-check issues: |
| 152 | +1. Check this guide first |
| 153 | +2. Review `typos.toml` configuration |
| 154 | +3. Test with manual pre-commit run |
| 155 | +4. Create an issue if problems persist |
| 156 | + |
| 157 | +Remember: Good spelling improves documentation quality and user experience! |
0 commit comments