Commit cfba529
committed
feat: add copyright check functionality
Added copyright check module that automatically verifies copyright and
license headers in staged files during commit process. The system checks
for copyright notices, validates copyright years, and ensures license
declarations are present. For new files, it examines staged content
while for modified files it checks working directory content. Users are
prompted to confirm continuation if copyright issues are detected.
The implementation includes file type detection, content extraction from
git staging area, and comprehensive copyright pattern matching. Uses
chrono crate for current year comparison to ensure copyright dates are
up-to-date.
Log: Added automated copyright checking during commit process
Influence:
1. Test copyright check with files containing valid copyright headers
2. Verify detection of missing copyright notices in new files
3. Test copyright year validation with outdated years
4. Check license declaration detection for various license types
5. Verify user prompt behavior when copyright issues are found
6. Test skip functionality when using amend mode
7. Validate file type detection for different file extensions
8. Test content extraction from both staged and working directory files1 parent 3c0ebad commit cfba529
6 files changed
Lines changed: 566 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
718 | 720 | | |
719 | 721 | | |
720 | 722 | | |
721 | | - | |
722 | 723 | | |
723 | | - | |
| 724 | + | |
724 | 725 | | |
725 | 726 | | |
726 | 727 | | |
| |||
786 | 787 | | |
787 | 788 | | |
788 | 789 | | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
789 | 822 | | |
790 | 823 | | |
791 | 824 | | |
| |||
0 commit comments