Skip to content

Commit

Permalink
Merge pull request #305 from padjal/copyright
Browse files Browse the repository at this point in the history
Add copyright protection
  • Loading branch information
yegor256 authored May 6, 2024
2 parents b621604 + 58d876d commit 0d963b5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions steps/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,20 @@ fi
bibcop tex/report.bib

find "${LOCAL}" -name '*.sh' -type f -print0 | xargs -0 -n1 shellcheck --shell=bash --severity=style

header="Copyright (c) 2021-$(date +%Y) Yegor Bugayenko"

copyright_check="false"

# Iterate over each file in the directory recursively
while IFS= read -r file; do
# Search for the pattern in the file
if ! grep -q "$header" "$file"; then
copyright_check="true"
echo "⚠️ Copyright not found in file: $file"
fi
done < <(find "$LOCAL" -type f \( -name "*.sh" -o -name "*.py" -o -name "*.rb" \))

if [[ "${copyright_check}" = "true" ]]; then
exit 1
fi

0 comments on commit 0d963b5

Please sign in to comment.