This document outlines the automated quality checks we use to maintain consistency in the repository.
The following checks run automatically when you commit changes:
- Spell Checking: Uses
cspell
with a custom dictionary - Link Checking: Validates all links using
markdown-link-check
- Code Block Validation: Ensures code blocks have language flags using
remark-lint-fenced-code-flag
- Markdown Linting: Uses
markdownlint-cli2
for consistent formatting
- ESLint: Enforces code style and catches potential errors
- Prettier: Ensures consistent code formatting
- jsonlint: Validates JSON syntax and formatting
- yaml-lint: Validates YAML syntax and structure
- Particularly important for GitHub Actions workflows
- shellcheck: Analyzes shell scripts for common errors and pitfalls
- Applied to husky hooks and other shell scripts
Our GitHub Actions workflows run additional checks on pull requests:
- Markdown Linting: Verifies all markdown files follow our style guide
- Auto-labeling: Automatically adds labels to PRs based on changed files
- Semantic Release: Manages versioning and changelog generation
All quality checks run automatically through pre-commit hooks when you commit changes. The hooks are installed automatically when you run npm install
.
-
Hook Not Running:
- Make sure you've run
npm install
- Check that
.git/hooks/pre-commit
exists - Ensure the hook file is executable
- Make sure you've run
-
Hook Permission Issues:
chmod +x .git/hooks/pre-commit
-
Skip Hooks Temporarily:
git commit --no-verify
Note: Use this sparingly and only when absolutely necessary.
Use these npm scripts to run quality checks:
# Run all quality checks
npm run lint:all
# Individual quality check suites
npm run lint:js # Check JavaScript files
npm run lint:json # Check JSON files
npm run lint:yaml # Check YAML files
npm run lint:shell # Check shell scripts
npm run fix:md # Check and fix markdown files
npm run spell-check # Check spelling
npm run check-links # Validate markdown links
npm run check-codeblocks # Validate code blocks
Potential areas for enhancement:
- Add unit testing for JavaScript code
- Implement integration tests for GitHub Actions
- Add automated security scanning
- Implement performance benchmarking for workflows
- Add automated accessibility checks for documentation
When adding new features or making changes:
- Add appropriate quality checks for new functionality
- Update this document if quality check procedures change
- Ensure all quality checks pass locally before pushing
- Consider adding new test cases for edge scenarios