File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,10 +17,8 @@ repos:
1717 name : copyright
1818 language : system
1919 types : [ python ]
20- pass_filenames : false
21- # Lists the Python files that do not have an Aiven copyright. Exits with a
22- # non-zero exit code if any are found.
23- entry : bash -c "! git grep -ELm1 'Copyright \(c\) 20[0-9]{2} Aiven' -- '*.py' ':!*__init__.py'"
20+ exclude : __init__\.py
21+ entry : ./copyright.sh
2422
2523- repo : https://github.com/shellcheck-py/shellcheck-py
2624 rev : v0.9.0.2
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ missing_copyright=$(
4+ grep \
5+ --extended-regexp \
6+ --files-without-match \
7+ --max-count=1 \
8+ ' Copyright \(c\) 20[0-9]{2} Aiven' \
9+ -- " $@ "
10+ )
11+
12+ if [[ -n $missing_copyright ]]; then
13+ echo " 💥 There are files missing required copyright statement."
14+ echo " $missing_copyright "
15+ exit 1
16+ else
17+ echo " ✅ All files have required copyright statement."
18+ fi
You can’t perform that action at this time.
0 commit comments