aRustyDev / aRustyDev/pre-commit-hooks
test: Add comprehensive test coverage for all hooks
- 主要言語
- Python
- スター
- 5
- フォーク
- 3
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
## Overview
Extend the bats testing framework to provide comprehensive test coverage for all 26 hook scripts.
## Current State
- Testing framework established with bats
- Sample tests created for:
- `hooks/commits/gitlint.sh`
- `hooks/nix/nix-fmt.sh`
- Test helper utilities available
- CI integration configured
## Requirements
### Test Coverage Goals
- [ ] 100% of hooks have at least basic tests
- [ ] 80%+ code coverage across all hooks
- [ ] Edge cases and error conditions tested
- [ ] Multi-platform compatibility verified
### Hooks Needing Tests
#### Commits
- [ ] commitizen.sh
- [ ] commitlint.sh
- [x] gitlint.sh ✅
#### Nix
- [ ] attestation.nix
- [ ] nix-build-check.sh
- [ ] nix-build.sh
- [ ] nix-darwin-check.sh
- [ ] nix-flake-check.sh
- [x] nix-fmt.sh ✅
- [ ] nix-home-manager-check.sh
- [ ] nix-lint.sh
- [ ] publish-to-nixpkgs.sh
#### CI
- [ ] github.sh
- [ ] gitlint.sh
#### Configs
- [ ] yamlfmt.sh
#### Terraform
- [ ] pluralith.sh
- [ ] tfupdate.sh
#### Web
- [ ] css/csslint.sh
- [ ] js/eslint.sh
- [ ] js/fixmyjs.sh
- [ ] js/jshint.sh
- [ ] scss/scss-lint.sh
#### Other
- [ ] backup-nixos.sh
- [ ] update-vm.sh
- [ ] witness.sh
- [ ] pluralith.sh (root)
## Test Structure
Each test file should include:
1. Existence and executability check
2. Missing dependency handling
3. Success case validation
4. Failure case validation
5. Edge case handling (empty input, malformed data, etc.)
## Deliverables
- [ ] Complete test suite for all hooks
- [ ] Test documentation updates
- [ ] CI passing with all tests
- [ ] Coverage report generation
- [ ] Performance benchmarks
## Success Criteria
- All hooks have corresponding test files
- Tests run successfully on Ubuntu and macOS
- Code coverage >80%
- All tests pass in CI
- Clear documentation for adding new tests
## Related
- #26 - CI/CD pipeline implementation
- #22 - Nix hooks test suite
コントリビューションガイド
調査の方向性
まず hooks/commits/gitlint.sh と hooks/nix/nix-fmt.sh の既存のテストを読み、次に利用可能なテストヘルパーユーティリティを確認して、現在のスイートを実行します。残りの一覧にある hook に対応するテストを追加し、存在、依存関係、成功、失敗、エッジケースを網羅します。すべての hook がテストされ、Ubuntu と macOS の CI が通過し、カバレッジが 80% を超え、テストドキュメントとカバレッジレポートが更新されていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- shell
- 領域
- testing
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100